solving an equation for a variable that has changing varibles in it
Show older comments
im trying to solve for M1 based off a changing Pr
index1=1:304;
index2=697:1000;
index3=305:696;
figure
plot(t(index1),M(index1), 'b')
hold on
plot(t(index2),M(index2), 'b')
%plot(t(index3),M(index3), 'r')
M2=(((M1).^(2))+(2/(gamma-1)))./((((2*gamma)/(gamma-1)).*(M1).^2)-1)
pr=Po(index3)./P(index3)
eqn=((1+((gamma-1)/2).*(M2).^2)).^(gamma/(gamma-1)).*(((gamma+1).*(M1).^2)./(2+(gamma-1).*(M1).^2))==pr
superM=vpasolve(eqn,M, 'real')
plot(t(index3),superM, 'r')
im trying to get only real vaules for M1
8 Comments
Torsten
on 9 Oct 2022
eqn does not depend on a variable M.
joshua payne
on 9 Oct 2022
joshua payne
on 9 Oct 2022
Torsten
on 9 Oct 2022
And did you define M1 as syms somewhere ?
joshua payne
on 9 Oct 2022
Torsten
on 9 Oct 2022
Please show executable code that reproduces your errors.
joshua payne
on 9 Oct 2022
Ghazwan
on 9 Oct 2022
Please, re-post your quesiton after you put the data in an excel spreadsheet as it is diffcult to read it. Thanks!
Answers (0)
Categories
Find more on Logical 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!