solving non linear equations

2 ビュー (過去 30 日間)
sunitha
sunitha 2021 年 1 月 21 日
コメント済み: sunitha 2021 年 1 月 21 日
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)

回答 (1 件)

Stephan
Stephan 2021 年 1 月 21 日
編集済み: Stephan 2021 年 1 月 21 日
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
  2 件のコメント
sunitha
sunitha 2021 年 1 月 21 日
how can i get these results all at a time and i want the results in decimal form .bze i want to import the results to excel data again
sunitha
sunitha 2021 年 1 月 21 日
And in order to calculate the N values first i have to find the J value and then i have to find N values .but here i am not getting the J values and i am getting the N values and J values i am getting interms of i
this is the value for J for 10 th input

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by