Help on solving equation?

1 回表示 (過去 30 日間)
ABDULLA RAHIL
ABDULLA RAHIL 2019 年 4 月 29 日
回答済み: Stephan 2019 年 4 月 29 日
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 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by