Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <i8j0bd$6r$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1286409380 8352 172.30.248.35 (6 Oct 2010 23:56:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 6 Oct 2010 23:56:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:676394

"sonia " <sonia_elwardi@yahoo.fr> wrote in message <i8j0bd$6r$1@fred.mathworks.com>...
> 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