Help on solving equation?

2 次查看(过去 30 天)
Hello,
I need urgent help for the small code belwo to solave the equation I jave tried but I always seeing this error ((Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters)).
Code is belwo:
A1=1.825*10^6;
Zi=67;
M=123;
B=50.29;
a=5;
Z=134;
AO0=2.6;
P0=54.6;
C=12;
Ka=2.45;
V=10^((-A1*(Zi^2)*sqrt(M))/(1+B*a*sqrt(M)));
syms A
eqn=AO0-(C*V*(A*(((1-Z*C^0.5)^(-1))+((AO0-P0)/(2*A))/(1+((AO0-P0)/(2*AO0))-(AO0/2)))*(Ka/AO0)-(A*(((1-Z*C^0.5)^(-1))+((AO0-P0)/(2*A))/(1+((AO0-P0)/(2*AO0)));
sola = solve(eqn, A)
  1 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-4-29
My suggestion break the eqn statement in multiple parts, because it is confusing check.

请先登录,再进行评论。

采纳的回答

Stephan
Stephan 2019-4-29
Hi,
try:
A1=1.825*10^6;
Zi=67;
M=123;
B=50.29;
a=5;
Z=134;
AO0=2.6;
P0=54.6;
C=12;
Ka=2.45;
V=10^((-A1*(Zi^2)*sqrt(M))/(1+B*a*sqrt(M)));
syms A
eqn=AO0-C*V*A*(((1-Z*C^0.5)^(-1))+((AO0-P0)/(2*A))/(1+((AO0-P0)/(2*AO0))-(AO0/2)))*(Ka/AO0)-(A*(((1-Z*C^0.5)^(-1))+((AO0-P0)/(2*A))/(1+((AO0-P0)/(2*AO0)))));
sola = double(solve(eqn, A))
result is:
sola =
133.8103
Does this appear to be a correct result? If not check the parenthesis of your equation.
Best regards
Stephan

更多回答(0 个)

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by