how to solve this nonlinear equation to reach M2?

2 visualizaciones (últimos 30 días)
fatemeh p
fatemeh p el 31 de Mzo. de 2019
Respondida: madhan ravi el 31 de Mzo. de 2019
I want reach M2 from this code but i have problems with the solve function, should i use fsolve and how?
clc
clear
syms M2;
L=input('enter the L value\n');
D=input('enter the D value\n');
% P1=input('enter the P1 value\n');
% T1=input('enter the T1 value\n');
M1=input('enter the M1 value\n');
f=0.005;
Ls1=(((1-M1^2)/(1.4*(M1^2)))+((2.4/2.8)*log((2.4*(M1^2))/(2+0.4*(M1^2)))))*(D/(4*f));
disp(Ls1);
M20=0;
% if L<Ls1;
Ls2=Ls1-L;
M2=solve('(((1-M2^2)/(1.4*(M2^2)))+((2.4/2.8)*log((2.4*(M2^2))/(2+0.4*(M2^2)))))*(D/(4*f))- Ls2',M2);
disp(M2);
  2 comentarios
madhan ravi
madhan ravi el 31 de Mzo. de 2019
Editada: madhan ravi el 31 de Mzo. de 2019
M2=solve((((1-M2^2)/(1.4*(M2^2)))+((2.4/2.8)*log((2.4*(M2^2))/(2+0.4*(M2^2)))))*(D/(4*f))- Ls2,M2); %?
[comment moved to answer section]
fatemeh p
fatemeh p el 31 de Mzo. de 2019
it worked, thanks

Iniciar sesión para comentar.

Respuesta aceptada

madhan ravi
madhan ravi el 31 de Mzo. de 2019

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by