From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: solve
Date: Wed, 6 Oct 2010 23:56:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <i8j2b4$850$>
References: <i8j0bd$6r$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1286409380 8352 (6 Oct 2010 23:56:20 GMT)
NNTP-Posting-Date: Wed, 6 Oct 2010 23:56:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:676394

"sonia " <> wrote in message <i8j0bd$6r$>...
> Hello,
> I just want to solve an eqation, and I want to have the results as function  of z0 and z1.
> clear all; clc; clf; hold off;
> %Y=z2.^4+(-23/2)*z1^2.*z2.^2-13*z0^2*z1.*z2+C;%% the eqation to solve 
> syms z0 z1 z2;
> % z0=300e-3;
> % z1=700e-3;
> solve(z2.^4+(-23/2)*z1^2.*z2.^2-13*z0^2*z1.*z2+(16*z1^2-43*z1^4*z0^2-148*z0^4*z1^2-192*z0^6)/(16*(z0^2+z1^2)),z2)
> Please help me to find the results as function of z0 and z1.
> Thanks 
> Sonia
- - - - - - - - -
  There does exist a closed-form 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.

  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.

  However, the problem with either method is that quartic equations will in general have four roots, and some of these may be complex-valued, so it cannot constitute a single-valued function of your inputs.  With real-valued coefficients you will get either four real roots, two real and two complex, or all four complex.

Roger Stafford