Re: System of Equations

• To: mathgroup at smc.vnet.net
• Subject: [mg6034] Re: [mg6024] System of Equations
• From: Luci Ellis <elisha at dot.net.au>
• Date: Thu, 13 Feb 1997 02:26:16 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```>I have a system of equations with 7 equations and 8 variables. It look
>very typical. Can anyone give me some ideas how to solve this system of
>equations in Mathematica? I don`t know, first what should I do in
>with these system of equations in Mathematica?

Well, 7 equations and 8 variables suggests you _won't_ be able to solve it
completely, even if it's a linear system. You will only be able to solve
for some of the variables.

As an illustration, take a simple example:
2x + 3y + 7z ==0
4 x^2 - y + z^2==0

This is three unknowns but only two equations.

Mathematica can solve for two variables at once:
Solve[{2x + 3y + 7z ==0,4 x^2 - y + z^2==0},{x,y}]

\!\({{y \[Rule]
1\/36\ \((2 - 84\ z - \ at \(4 + 48\ \((\(-7\) - 3\ z)\)\ z\))\),
x \[Rule] 1\/24\ \((\(-2\) + \ at \(4 + 48\ \((\(-7\) - 3\ z)\)\ z\))\)}, {
y \[Rule]
1\/36\ \((2 - 84\ z + \ at \(4 + 48\ \((\(-7\) - 3\ z)\)\ z\))\),
x \[Rule] 1\/24\ \((\(-2\) - \ at \(4 + 48\ \((\(-7\) - 3\ z)\)\ z\))\)}}\)

Or for those without Mathematica 3.0:

{{y-> 1/36 *(2-84 z - Sqrt[4-48(-7-3z)z]),x->1/24 *(-2 + Sqrt[4-48(-7-3z)z])},
{y-> 1/36 *(2-84 z + Sqrt[4-48(-7-3z)z]),x->1/24 *(-2- Sqrt[4-48(-7-3z)z])}}

But if you try to solve for all three unknowns at once, you get this message:

Solve[{2x + 3y + 7z ==0,4 x^2 - y + z^2==0},{x,y,z}]

Solve::"svars": "Equations may not give solutions for all "solve" variables.

And it just tries to solve for  as many variables as it can.

Anyway, in general, simple systems can be solved analytically using
Solve[{list of equations}, {list of variables you want to Solve for}]

but if it's a problem involving higher-order powers of the variables, you
may not be able to use Solve to get analytical solutions -- instead you
will have to use root finding (FindRoot) or NSolve.

Hope this helps,

Luci

--------------
Luci Ellis:  elisha at dot.net.au
http://www.dot.net.au/~elisha

```

• Prev by Date: Re: Re: Graphics
• Next by Date: Recommended Intro Book
• Previous by thread: Re: Re: Graphics
• Next by thread: Re: System of Equations