MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problem with numerical values in Solve/NSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63739] Re: problem with numerical values in Solve/NSolve
  • From: dh <dh at metrohm.ch>
  • Date: Fri, 13 Jan 2006 04:48:15 -0500 (EST)
  • References: <dq53td$abp$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Jacob,
the problem you face is that the variables in the equation and in Solve 
are not identical.
Either you solve for all variables like:

variables = Array[p, 5];
evec = Simplify[Solve[m.variables == Table[0, {i, 1, 5}], variables]]

  or you have to tell Mathematica to eliminate the unwanted variable:
variables = Array[p, 5];
evec = Simplify[Solve[m2.variables == Table[0, {i, 1, 5}], Array[p, 
4],p[5]]]

Daniel

Jacob Grose wrote:
> 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
> 


  • Prev by Date: Re: Confusing behaviour with caching of evaluated expressions ?
  • Next by Date: Re: A question about pattern-matching
  • Previous by thread: Re: problem with numerical values in Solve/NSolve
  • Next by thread: Re: problem with numerical values in Solve/NSolve