Re: problem with numerical values in Solve/NSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg63760] Re: [mg63726] problem with numerical values in Solve/NSolve
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 13 Jan 2006 04:49:02 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
m1={{-a-b-c,0,f,h,l},{0,-c-d-e,g,k,m},
{a,c,-f-g,0,0},{b,d,0,-h-k,0},{c,e,0,0,-l-m}};
variables=Array[p,5];
eqn=Thread[m1.variables==0];
evec=Simplify[Flatten[Solve[eqn,Most[variables]]]];
And@@Simplify[eqn/.evec]
True
m2=Rationalize[{
{-1.870413280501348*^10,0,1.7479373054791087*^8,
7.607967609656633*^9,2.5605854781972427*^7},
{0,-1.2870235495030115*^10,206293.3885126606,
8.754725514677356*^7,1.3554510956434595*^10},
{1.747937063721231*^10,2.062933885126606*^7,
-1.7500002393642354*^8,0,0},
{1.2247621677975328*^9,8.754722967399057*^9,
0,-7.695514864803408*^9,0},
{0.0036402209477187386,4.094883188779791*^9,
0,0,-1.3580116811216568*^10}},
0];
Reduce[Thread[m2.variables==0],Most[variables]]
p[5] == 0 && p[1] == 0 && p[2] == 0 && p[3] == 0 && p[4] == 0
Bob Hanlon
>
> From: Jacob Grose <jeg35 at Cornell.edu>
To: mathgroup at smc.vnet.net
> Subject: [mg63760] [mg63726] problem with numerical values in Solve/NSolve
>
> Hello,
>
> I writing a physics simulation and I need to solve a system of 41 equations.
However, I am having problems even with a more simple 5x5 matrix. The
problem is as follows: If I symbolically solve the matrix m1:
>
> \!\(\*
> TagBox[
> RowBox[{"(", "\[NoBreak]", GridBox[{
> {\(\(-a\) - b - c\), "0", "f", "h", "l"},
> {"0", \(\(-c\) - d - e\), "g", "k", "m"},
> {"a", "c", \(\(-f\) - g\), "0", "0"},
> {"b", "d", "0", \(\(-h\) - k\), "0"},
> {"c", "e", "0", "0", \(\(-l\) - m\)}
> }], "\[NoBreak]", ")"}],
> Function[ BoxForm`e$,
> MatrixForm[ BoxForm`e$]]]\)
>
> Using the code:
>
> variables = Array[p, 5];
> evec = Simplify[Solve[m1.variables \[Equal] Table[0, {i, 1, 5}], Array[p, 4]]]
>
> I get a result. However, if I try to solve for a matrix (m) of the same form
but with values substituted for the variables:
>
> \!\(\*
> TagBox[
> RowBox[{"(", "\[NoBreak]", GridBox[{
> {\(-1.870413280501348`*^10\),
> "0", "1.7479373054791087`*^8", "
> 7.607967609656633`*^9", "2.5605854781972427`*^7"},
> {"0
> ", \(-1.2870235495030115`*^10\), "206293.3885126606`", \
> "8.754725514677356`*^7", "1.3554510956434595`*^10"},
> {"1.747937063721231`*^10", "2.062933885126606`*^7
> ", \(-1.7500002393642354`*^8\), "0", "0"},
> {"1.2247621677975328`*^9", "8.754722967399057`*^9", "0", \
> \(-7.695514864803407`*^9\), "0"},
> {"0.0036402209477187386`", "4.094883188779791`*^9", "0", "0",
\
> \(-1.3580116811216568`*^10\)}
> }], "\[NoBreak]", ")"}],
> Function[ BoxForm`e$,
> MatrixForm[ BoxForm`e$]]]\)
>
> Using the same code:
>
> variables = Array[p, 5];
> evec = Simplify[Solve[m.variables \[Equal] Table[0, {i, 1, 5}], Array[p, 4]]]
>
> mathematica returns: {}.
>
> I tried using Nsolve instead of solve, as well as setting $MaxExtraPrecision
= 5000, but it didn't help. Any ideas?
>
> Thanks,
> Jacob
>
>