To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
BuckeyeBTH
New to the neighborhood
BuckeyeBTH
2 Posts

Matlab solver function variable question

I have to write a matlab code to solve for some numbers using given 1-D flow with heat added equations.
I need to solve for a variable M2, using the following relation
To2/To1=(1.480988*M2^4-7.40494*M2^2)/(M2^4+1.4285714*M2^2+.5102)
with To2 as a variable defined by
To2=(Qo*l)/(Cp)+To1 where Qo, Cp, l and To1 are knowns.
When i try to run the full program i get the following error:
??? Undefined function or method 'solve' for input arguments of type 'char'.

Error in ==> Hw73 at 20
solve('To2/To1=(1.480988*M2^4-7.40494*M2^2)/(M2^4+1.4285714*M2^2+.5102)','M2')

Here is my full code:
V1=100;
T1=293;
P1=101.3;
Qo=4*10^4;
g=1.4;
R=287.5;
Cp=1005;
M1=sqrt((V1)^2/(g*R*T1))
To1=T1*(1+((g-1)/2)*(M1)^2)
%s=star conditions
%T1/Ts=Tratio1
%P1/Ps=Pratio1
%Po1/Pos=Poratio1
Tratio1=((1+g)^2*M1^2)/(1+g*M1^2)^2
Pratio1=(1+g)/(1+g*M1^2)
Poratio1=((1+g)/(1+g*M1^2))*((2*(1+((g-1)/2)*(M1)^2))/(1+g))^(1.4/(1.4-1))
for l=0:1:12
To2=(Qo*l)/(Cp)+To1
solve('To2/To1=(1.480988*M2^4-7.40494*M2^2)/(M2^4+1.4285714*M2^2+.5102)','M2')
M2
%T2/Ts=Tratio2
%P2/Ps=Pratio2
%Po2/Pos=Poratio2
Tratio2=((1+g)^2*M2^2)/(1+g*M2^2)^2;
Pratio2=(1+g)/(1+g*M2^2);
Poratio2=((1+g)/(1+g*M2^2))*((2*(1+((g-1)/2)*(M2)^2))/(1+g))^(1.4/(1.4-1));
To=To2/To1;
T=Tratio2/Tratio1;
P=Pratio2/Pratio1;
Po=Poratio2/Poratio1;
end
HELP please? anything is appricated
shwaip
elaborate bot
shwaip
5,730 Posts
that means solve isn't in your path. what happens if you just type solve on the command prompt.
__________________ my photostream for ic photography challenge

Anyone who wants dropbox, please use my referral link
BuckeyeBTH
New to the neighborhood
BuckeyeBTH
2 Posts
that means solve isn't in your path. what happens if you just type solve on the command prompt.
The solve function requires the data from To2 defined earlier in the code. I
cant just write the solve equation into the command prompt or i get the same error.
shwaip
elaborate bot
shwaip
5,730 Posts
the error means matlab can't find the solve.m file needed.
Similar Threads
Thread Thread Starter Forum Replies Last Post
matlab solver - grid search Dina Matlab Help 8 6 Jun 2007 5:29pm
MatLab problem - inline function zero finder PGolasze Matlab Help 4 10 May 2007 12:38am
Are you sure my dv8000t is Not a dv8000t? ~*~ Miska ~*~ General Hardware 19 25 Nov 2006 2:30am
Ad-Aware crashes in registry deep scan...possible malware? Treadstone71 Resolved / Inactive 23 8 Mar 2006 12:58am
C++ question; MFC function called OnInitialUpdate ?! Mizugori Web & Digital Media 1 13 Aug 2004 12:25pm

Go Back   Icrontic Forums > Tech: Software > General Software > Matlab Help
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 9:41pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.