Clear Filters
Clear Filters

how to solve this nonlinear equation to reach M2?

2 views (last 30 days)
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 Comments
madhan ravi
madhan ravi on 31 Mar 2019
Edited: madhan ravi on 31 Mar 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]

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 31 Mar 2019

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!