Re: what is my error?

• To: mathgroup at smc.vnet.net
• Subject: [mg100465] Re: [mg100438] what is my error?
• From: "David Park" <djmpark at comcast.net>
• Date: Fri, 5 Jun 2009 03:00:03 -0400 (EDT)
• References: <18096534.1244101248730.JavaMail.root@n11>

```Richard,

eqns = {mr + mp == 13, fr + fp == 19, mr + fr == 15, mp + fp == 17};

These equations are not all independent so if we use NSolve or Solve or
Reduce we do not obtain a complete solution.

Reduce[eqns]
mp == 13 - mr && fr == 15 - mr && fp == 4 + mr

We can see this by setting up the matrix and rhs to use LinearSolve:

m = ( {
{1, 1, 0, 0},
{0, 0, 1, 1},
{1, 0, 1, 0},
{0, 1, 0, 1}
} );
b = {13, 19, 15, 17};
Det[m]
0

But, LinearSolve will obtain a solution as long as the rhs is linearly
dependent in the same way as the rows of the matrix are.

lsols0 = LinearSolve[mat, {13, 19, 15, 17}]
lsols1 = {mr, mp, fr, fp} -> lsols0 // Thread
{-4, 17, 19, 0}
{mr -> -4, mp -> 17, fr -> 19, fp -> 0}

eqns /. lsols1
{True, True, True, True}

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/

From: Richard Palmer [mailto:rhpalmer at gmail.com]

eqns = {mr + mp == 13, fr + fp == 19, mr + fr == 15, mp + fp ==
17}NSolve[eqns,
{mr, mp, fr, fp}]

gives {{mr->-4.+1. fp,mp->17.-1. fp,fr->19.-1. fp}}

The solution is  {mr->8, mp->5, fr->7, fp->12} if mr,mp,fr,fp are greater
than zero

--
Richard Palmer

```

• Prev by Date: Re: Replacing expressions with smaller atoms
• Next by Date: Repositioning AxesLabel position
• Previous by thread: Re: what is my error?
• Next by thread: Re: what is my error?