how to solve this nonlinear equation to reach M2?

2 次查看(过去 30 天)
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 个评论
madhan ravi
madhan ravi 2019-3-31
编辑:madhan ravi 2019-3-31
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]

请先登录,再进行评论。

采纳的回答

madhan ravi
madhan ravi 2019-3-31

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by