solving non linear equations
1 view (last 30 days)
Show older comments
i have imported the data from excel to find out the variable N for different inputs.i have two equations.using two equations i have to find the variable N , in order to find the N value, i have to calculate the J values..i have written the code foe this, i didnt get any errors but i am not getting any result. can anyone help me to find out this ??
i am attaching my code here
syms N J
Qo=xlsread('suspended.xlsx','A:A')
R=xlsread('suspended.xlsx','B:B')
No=xlsread('suspended.xlsx','C:C')
X=xlsread('suspended.xlsx','D:D')
V = 2435 ;
k = 1.076 ;
Kn = 0.27 ;
k=1.076
Y=0.39
kd=0.04
bs=0.15
Xf=0.49
Df=1.04
Dw=1.3
L=0.04
a=2.24
bt=kd+bs
Nstar=N/Kn;
Nmin=Kn/((Y*k/bt)-1)
Lstar=L*(sqrt(k*Xf/Kn*Df))*Df*Dw;
jstar=(J/sqrt(Kn*k*Xf*Df));
Nstar_min=(1/(Y*k*(bt-1)));
nX = size(X,1 );
solutions = cell(1, nX);
for S=1:nX
solutions{S}=solve(Qo(S)*(1+R(S))*(No(S)-N)-V*(a* J+((X(S)*k*N)/(Kn+N))),N,J)
end
eqn1=sqrt((Lstar^1.76)+5.2*(Nstar-Nstar_min)-(Lstar^0.88))/2.6==jstar^0.88;
soln=vpasolve([eqn1],[N,J]);
celldisp(solutions)
0 Comments
Answers (1)
Stephan
on 21 Jan 2021
Edited: Stephan
on 21 Jan 2021
Your code works properly for me. To access the the results - for example for the solution if N in the third iteration use:
>> solutions{3}.N
which is:
ans =
- 35982859979292405178846235256893762420449^(1/2)/1138918124515491800 - 189414339703334141393/1138918124515491800
35982859979292405178846235256893762420449^(1/2)/1138918124515491800 - 189414339703334141393/1138918124515491800
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!