Solving systems of equuations, receiving z1 in solution.
Mostra commenti meno recenti
I am trying to solve for 2 unknowns in 2 equations, pretty standard stuff. The equations have 4th order polynomials (Radiation effects) and are heat balance equations. when I put them into Matlab's symbolic engine and solve for each variable, they have extreme coefficients with z1's attached to them (a root function I am guessing). Mathcad users in my course seem to get simple, whole solutions, so I know that a solution exists and that Matlab can find it, it is just a matter of knowing how to do it.The script is as follows, copy and paste it to see the results to better understand what I am talking about.
clc,clear all
syms To T1 real
Ty=459.67
Ta=459.67+70
Tp=600+459.67
qconv=8.5*(To-Ta)*2*pi
Lp=log(3.5/3)
Ls=log(5.5/3.5)
Kp=12.5
Tave=((To-459.67)+(T1-459.67))/2
Ks=.0256+3.67*10^-5*(Tave-50)
Ap=2*pi
As=2*pi
qrad=2*pi*5.5/24*.76*.1714*10^-8*(To^4-Ty^4)
qrad+qconv==(Tp-To)/(Lp/(Kp*Ap)+Ls/(Ks*As))
(Tp-T1)/(Lp/(2*pi*Kp))==(To-T1)
s=solve((Tp-T1)/(Lp/(2*pi*Kp))==(To-T1)/(Ls/(2*pi*Ks)),qrad+qconv==(Tp-To)/(Lp/(Kp*Ap)+Ls/(Ks*As)))
[s.To s.T1]
Again, what I am after is how to find what that z function is and it turn, find a whole number for a solution.
Risposte (2)
Walter Roberson
il 3 Ott 2012
Modificato: Walter Roberson
il 3 Ott 2012
0 voti
The z's will not be functions: they will be placeholders introduced to represent values according to a characterization encoded into the output.
For example, you might get an z introduced but within a RootOf() enclosure. Such z's would represent the set of values such that when those values are substituted for z, the result of the expression is 0 (the roots of the expression.)
If you have 4th or higher order polynomials, then you are quite likely to get RootOf() introduced into the expressions.
If the expression within the first parameter to RootOf() has z to a power 5 or higher, you will not be able to find analytic solutions (not unless some other part of the expression can be induced to cancel out other parts so that an analytical can be found.) In such a case, you will need to do numeric solving, or (if the situation warrants) convert the RootOf() into an appropriate call to roots().
If the expression within the first parameter to RootOf() has z to a power 3 or 4 exactly, then it is possible to force solve() to resolve the roots analytically, by passing an optional argument to solve() that is the maximum root degree to represent analytically. Roots of cubics are semi- manageable analytically, but roots of quartics are so messy analytically that expanding them will usually obscure the solutions horribly.
There are some other situations in which MuPAD might introduce variables for compactness, such as when solving ODEs.
When one symbolic solver finds a nice solution but another does not, then sometimes the issue is that the one that finds the solution is making analytic assumptions that the other is not, such as assuming that variables are not complex. If you do have constraints then it can be worth telling MuPAD what they are by using assume()
Patrick duncan
il 3 Ott 2012
Modificato: Patrick duncan
il 3 Ott 2012
0 voti
1 Commento
Walter Roberson
il 3 Ott 2012
If the matrices contain only constants and numeric functions of constants, then you can use double() on the symbolic expression to force evaluation.
Categorie
Scopri di più su Code Performance in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!