필터 지우기
필터 지우기

I am not getting the solution for my coding.

조회 수: 2 (최근 30일)
shunmugam hemalatha
shunmugam hemalatha 2020년 3월 26일
댓글: Star Strider 2020년 3월 26일
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