Effacer les filtres
Effacer les filtres

Help on solving equation?

3 vues (au cours des 30 derniers jours)
ABDULLA RAHIL
ABDULLA RAHIL le 29 Avr 2019
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 commentaire
KALYAN ACHARJYA
KALYAN ACHARJYA le 29 Avr 2019
My suggestion break the eqn statement in multiple parts, because it is confusing check.

Connectez-vous pour commenter.

Réponse acceptée

Stephan
Stephan le 29 Avr 2019
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

Plus de réponses (0)

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by