Answered
MIL PROBLEM WITH A VECTOR DATA - HOW TO FIND AN UNIQUE SOLUTION AND NOT ONE FOR EACH DATA?
Solutions to MILP problems are for a specific set of numerical input data (in your case wind data). Usually, there are no symb...

4 years ago | 0

Answered
problem regarding plotting cuvres
Insead of using plot(x,y) try [sorted_x,I] = sort(x); sorted_y = y(I); plot(sorted_x,sorted_y) for the green and blue cur...

4 years ago | 0

| accepted

Answered
I am trying to solve a coupled set of ODE's different ways. (1) using ode45 which I have been able to do (2) solve them using Euler's method while calling the same function.
for i=1:n-1 q(i,:) = proj2ode45(t_E(i),N_E(i,:)); Na(i+1)=Na(i)+h*q(i,1); Nb(i+1)=Nb(i)+h*q(i,2); Nc(i+1)=Nc...

4 years ago | 1

| accepted

Answered
Solving Differential Equations Symbolically and Numerically
Did you read the part "Solve Differential Equations with conditions" under https://de.mathworks.com/help/symbolic/dsolve.html...

4 years ago | 0

| accepted

Answered
PDE model not producing desired results
You need to impose a boundary condition for y at z=0. Since the equations are hyperbolic in nature, central differencing is str...

4 years ago | 1

| accepted

Answered
How to get the sum of the rows of a matrix?
Multiply the matrix with ones(3,1)

4 years ago | 0

Answered
Answers of equation are mismatch
Ix = ((w.^2+4*w*81+81^2)./(36*(w+81))).*h.^3; instead of Ix = ((w.^2+4*w*81+81.^2)/(36*(w+81)))*h.^3;

4 years ago | 1

Answered
The last line is wrong. The system reminds that "Input function must return 'double' or 'single' values. Found 'sym'." How can I obtain the constant matrix K after integral ?
So many problems. Had to restructure the code completely. value = zeros(3,3); for i=1:3 for j=1:3 value(i,j) = inte...

4 years ago | 1

| accepted

Answered
How can I solve 3 non linear functions simultaneously?
dOD0 = 7.0; dOD = fzero(@fun,dOD0) function res = fun(dOD) CNO3=0; CMNO3=0; Q=0.0107; tao=0.0217; TR=0.0048; Temp=13.4232...

4 years ago | 0

| accepted

Answered
Find exponent of equation
A good approximation for K, x and y can be obtained by taking the log on both sides of your equation: log(P) = log(K) + x*log(f...

4 years ago | 0

Answered
Solving of two interdependent functions
If you solve both of the two equations u=sqrt((8/3)*((ro-1.24)*R*9.8)/(Cd*1.24)) Re=(1.24)*u*2*R/(18*10^-6) for u, you get a ...

4 years ago | 0

Answered
Error using surf: Data dimensions must agree
d1=(log(S0./X)+(((r_base-r_quote)+((vol).^ 2./2)).*(T-t)))./(vol.*sqrt(T-t)); instead of d1=(log(S0./X)+(((r_base-r_quote)+((v...

4 years ago | 0

| accepted

Answered
Solving a non linear ODE with unknown parameter
Your ODE for D_p gives D_p = 1/(1/D_p0 + k1*(t-t0)) where D_p0 = D_p(t0). Now you can apply "lsqcurvefit" to fit the unknown ...

4 years ago | 1

Answered
Split up a matrix into n peices
A = reshape(A,60,24).'

4 years ago | 0

Answered
Plotting Solution Curve on Direction Field
ySol = dsolve(ode, [y(-1)==0,Dy(0)==0]); dySol = diff(ySol,x); instead of ySol1 = dsolve(ode, y(-1)==0); % Solution to DE app...

4 years ago | 0

| accepted

Answered
"Index exceeds the number of array elements. Index must not exceed 1."
tau(i)= beta*gamma*((mu*u0)/delta2(i)); instead of tau(i)= beta*gamma*((mu*u0(i))/delta2(i));

4 years ago | 1

| accepted

Answered
estimation of parameters by using lsqnonlin for system of differential equations
data = [ 1 36456 2 70217 3 108526 4 145164 5 181275 6 213547 7 240654 8 272721 ...

4 years ago | 0

Answered
Error with Integral2 where func is a constant number
f=@(x,y) ones(size(x))

4 years ago | 0

Answered
Fit 2 parameters with lsqcurvefit including an integral term
xdata = [10.30, 29.88, 59.64, 99.58, 149.66, 209.96, 280.44, 361.03, 451.87, 552.89, 664.10, 785.38, 916.94, 1058.68, 1210.48, 1...

4 years ago | 1

Answered
Least Squares Curve Fit make minimum add to 1
C = [xdata(:,1),xdata(:,2)]; d = ydata(:); lb = [0; 0]; ub = [1 ;1]; Aeq = [1 1]; beq = 1; a = lsqlin(C,d,[],[],Aeq,beq,lb...

4 years ago | 0

Answered
How would I set parameters for the output value of my script to say if something was laminar or turbulent?
function [Re,FlowRegime] = reynum(P,v,l,u) Re = P*v*l/u; if Re <= 2000 FlowRegime = 'Laminar'; else FlowRegim...

4 years ago | 0

Answered
Nonlinear differential equation with unknown parameter
Seems your problem is easier than the one discussed under (Solving a 6th order non-linear differential equation in Matlab) for...

4 years ago | 0

Answered
how to find a max value of a plot at a certain x value
V_x= @(x)R1*(x>0).*(x-0).^0 - Wshaft*(x>0).*(x-0).^1 + Wshaft*(x>14).*(x-14).^1 - Wsprocket*(x>4.2917).*(x-4.2917).^1 + Wsprocke...

4 years ago | 1

| accepted

Answered
Double integral using matlab multiplication
th=pi/(2*180):pi/180:pi-pi/(2*180); %theta phi=pi/(2*180):pi/180:2*pi-pi/(2*180); %phi dth=th(6)-th(5); dphi=phi(6)-phi(5); ...

4 years ago | 0

| accepted

Answered
how to multiply every element in an array?
product = prod(o) is the short version, product = 1.0; for i = 1:numel(o) product = product*o(i); end product is the...

4 years ago | 1

Answered
ODE solver vs discrete integration
alpha_0 = 0.03; alpha = 298.2; beta = 0.2; n = 2; time = [0:0.1:300]; dt = 0.1; method = 1; init_cond = [10 10 0 0 0 0]; ...

4 years ago | 0

Answered
Plot function given by integral depending on a parameter
f = @(a,t) sin(a*t); F = @(a,x) integral(@(t)f(a,t),0,x); a = 1; x = 0:0.1:2*pi; Result = arrayfun(@(x)F(a,x),x); plot(x,Re...

4 years ago | 0

| accepted

Answered
Matrix dimensions must agree when doing an elementwise operation
Yes, a,b and c must have the same number of elements for that an elementwise multiplication makes sense. Maybe you mean d = (a...

4 years ago | 0

Answered
How can I model temperature advection due to percolating rain water?
I think the equation to calculate the increase in temperature T of the falling raindrop is -u*rho*cp*dT/dx = 3/R * alpha * (T-T...

4 years ago | 0

Answered
How can I multiply each row of 3 matrices individually?
(x.*rij).' * ai - Kj*y <= 0 assuming that ai and y are column vectors.

4 years ago | 0

Load more