I am not getting the solution for my coding.

2 次查看(过去 30 天)
syms q
S=6;
D=4800;
A=25;
Delta=0.2;
F=50;
V=1;
d=50;
tow=0.1;
M=7250;
n=2;
G1=0.2075;
c0=800;
C=((2*n*q)/((2*D)+(q*G1)))*(tow*M);
q=Sqrt(((2*D)*(A+C+(n*F)))/(n*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1)+(V*G1))))
TOT=(tow*M*(ln(c0/C)))+((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))];
Soln=Solve(q, C, TOT)

回答(1 个)

Star Strider
Star Strider 2020-3-26
Try this corrected version of your code:
syms q B P
S=6;
D=4800;
A=25;
Delta=0.2;
F=50;
V=1;
d=50;
tow=0.1;
M=7250;
n=2;
G1=0.2075;
c0=800;
C=((2*n*q)/((2*D)+(q*G1)))*(tow*M);
q=sqrt(((2*D)*(A+C+(n*F)))/(n*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1)+(V*G1))))
TOT=(tow*M*(log(c0/C)))+((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))];
[Soln,Parms,Conds]=solve(q, 'ReturnConditions',1)
  3 个评论
Guillaume
Guillaume 2020-3-26
"Also, instead of log function , I want to use ln function"
Perhaps, you should look at the documentation of log. As it clearly says log calculates the natural logarithm (that some may write as ).
Star Strider
Star Strider 2020-3-26
@shunmugam hemalatha — The solution is:
Soln =
-1280000/3121
Parms =
Empty sym: 1-by-0
Conds =
B ~= -10783/400
Use the vpa function to return a decimal fraction.
@Guillaume — Thank you!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by