Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
solve

Subject: solve

From: sonia

Date: 6 Oct, 2010 23:22:21

Message: 1 of 2

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

Subject: solve

From: Roger Stafford

Date: 6 Oct, 2010 23:56:20

Message: 2 of 2

"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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us