# [Maxima] solving system of nonlinear eqs

Richard Fateman fateman at cs.berkeley.edu
Thu Nov 29 13:11:00 CST 2007

```No, I think you are wrong, it gets the right answer, but your checking is
incorrect.

A+AG comes out
exactly

(2184135169953*sqrt(19)*sqrt(251)-150831890300561)/(148394627983*sqrt(19)*sq
rt(251)-10247828345671)-(3452*sqrt(19)*sqrt(251)-238424)/(357*sqrt(19)*sqrt(
251)-24409)

which exactly evaluates, using radcan, to 5.

if you evaluate it numerically, because of massive cancellations, you get
8.14699...

if the answer to the solve  is    labeled ANS,   then do

A+AG,ANS;

try fpprec:100;
A+AG,ANS;
bfloat(%);

too

_____

From: LiMuti, Chuck [OCDUS] [mailto:CLiMuti at ocdus.jnj.com]
Sent: Thursday, November 29, 2007 10:54 AM
To: fateman at cs.berkeley.edu
Subject: RE: [Maxima] solving system of nonlinear eqs

This is the test system that appears to fail -

Eq1: 0.5*A*B-AB = 0

Eq2:  0.5*A*C-AC = 0

Eq4:  0.5*A*E -AE = 0

Eq5: 0.5*A*F-AF = 0

Eq6: 0.5*A*G-AG = 0

Eq7: 100 = A + AB + AC + AD + AE + AF + AG

Eq8: 10 = B + AB

Eq9:   5 = C + AC

Eq10: 5 = D + AD

Eq11: 5 = E + AE

Eq12: 5 = F + AF

Eq13: 5 = G + AG

solve([Eq1,Eq2,Eq3,Eq4,Eq5,Eq6,Eq7,Eq8,Eq9,Eq10,

It produces in (my hands) solutions in which G and AG sum to 8 --- not 5.
The others sum correctly.

CLimuti

-----Original Message-----
From: Richard Fateman [mailto:fateman at cs.berkeley.edu]
Sent: Thursday, November 29, 2007 1:37 PM
To: LiMuti, Chuck [OCDUS]
Cc: Maxima at math.utexas.edu
Subject: RE: [Maxima] solving system of nonlinear eqs

Can you be more specific about what you did and why you think the answer is
wrong?

The typical approach in Maxima is to solve the problem EXACTLY when
possible. This is much harder than an approximate numerical solution.
Using a numerical program from the start may be better.

Even so, it is hard to image that you really want to produce a plot of 16
variables in 23 dimensions.
RJF

_____

From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of LiMuti, Chuck [OCDUS]
Sent: Thursday, November 29, 2007 10:24 AM
To: maxima at math.utexas.edu
Subject: [Maxima] solving system of nonlinear eqs

I am new to Maxima (and I am not a mathematician). I have a system of 16
nonlinear equations (16 unknowns) that I would like to be able to solve
numerically - change the values of the 23 constants in the equations and be
able to plot the 16 dependent variables as a function of these constants.

I experimented with small nonlinear sets of 3 to 6 dependent variables --
when I got to 6 - Maxima produced an erroneous result.

Is this something experienced by others -- or am I perhaps not doing
something I should be doing or doing something I shouldn't be doing?

C. Limuti

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20071129/7e2a1477/attachment-0001.htm
```