http://www.mathworks.com/matlabcentral/newsreader/view_thread/293282
MATLAB Central Newsreader  solve
Feed for thread: solve
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Wed, 06 Oct 2010 23:22:21 +0000
solve
http://www.mathworks.com/matlabcentral/newsreader/view_thread/293282#785754
sonia
Hello,<br>
I just want to solve an eqation, and I want to have the results as function of z0 and z1.<br>
<br>
clear all; clc; clf; hold off;<br>
%Y=z2.^4+(23/2)*z1^2.*z2.^213*z0^2*z1.*z2+C;%% the eqation to solve <br>
syms z0 z1 z2;<br>
% z0=300e3;<br>
% z1=700e3;<br>
solve(z2.^4+(23/2)*z1^2.*z2.^213*z0^2*z1.*z2+(16*z1^243*z1^4*z0^2148*z0^4*z1^2192*z0^6)/(16*(z0^2+z1^2)),z2)<br>
<br>
<br>
Please help me to find the results as function of z0 and z1.<br>
<br>
Thanks <br>
Sonia

Wed, 06 Oct 2010 23:56:20 +0000
Re: solve
http://www.mathworks.com/matlabcentral/newsreader/view_thread/293282#785759
Roger Stafford
"sonia " <sonia_elwardi@yahoo.fr> wrote in message <i8j0bd$6r$1@fred.mathworks.com>...<br>
> Hello,<br>
> I just want to solve an eqation, and I want to have the results as function of z0 and z1.<br>
> <br>
> clear all; clc; clf; hold off;<br>
> %Y=z2.^4+(23/2)*z1^2.*z2.^213*z0^2*z1.*z2+C;%% the eqation to solve <br>
> syms z0 z1 z2;<br>
> % z0=300e3;<br>
> % z1=700e3;<br>
> solve(z2.^4+(23/2)*z1^2.*z2.^213*z0^2*z1.*z2+(16*z1^243*z1^4*z0^2148*z0^4*z1^2192*z0^6)/(16*(z0^2+z1^2)),z2)<br>
> <br>
> <br>
> Please help me to find the results as function of z0 and z1.<br>
> <br>
> Thanks <br>
> Sonia<br>
        <br>
There does exist a closedform solution for the general quartic equation, but it is rather messy and I doubt if you would like dealing with it. My own 'solve' function even refuses to give it.<br>
<br>
If yours doesn't work or is unsuitable, the next best thing you can do is write a function that has z0 and z1 as inputs and uses the 'roots' function to solve your equation for each set of inputs.<br>
<br>
However, the problem with either method is that quartic equations will in general have four roots, and some of these may be complexvalued, so it cannot constitute a singlevalued function of your inputs. With realvalued coefficients you will get either four real roots, two real and two complex, or all four complex.<br>
<br>
Roger Stafford