I am not getting the solution for my coding.

1 view (last 30 days)
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)

Answers (1)

Star Strider
Star Strider on 26 Mar 2020
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 Comments
Guillaume
Guillaume on 26 Mar 2020
"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 on 26 Mar 2020
@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!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!