Problems with Mathematica 8.0 Solve
- To: mathgroup at smc.vnet.net
- Subject: [mg114198] Problems with Mathematica 8.0 Solve
- From: leigh pascoe <leigh at evry.inserm.fr>
- Date: Fri, 26 Nov 2010 05:32:06 -0500 (EST)
Dear Mathgroup,
Like many of you I have recently installed Mathematica 8.0 and have been
exploring its new features. I have encountered the following problem
using the Solve Function:
Firstly in Mathematica 7.0
I try to solve the following two simultaneous equations
In[35]
eq1 = (b + d + f)/x - (a + b)/(1 + x) - 2*(c + d + e)/(1 + 2*x + y) -
(f + g)/(x + y) == 0
eq2 = (e + g)/y - (c + d + e)/(1 + 2*x + y) - (f + g)/(x + y) == 0
In[36}
Timing[sols = Solve[{eq1, eq2}, {x, y}];]
Out[36]
{52.437, Null}
A bit slow but it gives me the result I want. I then Simplify the
solutions and evaluate them with a set of vectors of the constants
{a,b,c,d,e,f,g}.
subs = {{a -> 45, b -> 79, c -> 4, d -> 11, e -> 8, f -> 0, g -> 2},
{a -> 95, b -> 85, c -> 9, d -> 13, e -> 6, f -> 0, g -> 1},
{a -> 18, b -> 45, c -> 0, d -> 1, e -> 2, f -> 0, g -> 0}, {a -> 50,
b -> 41, c -> 0, d -> 1, e -> 0, f -> 0, g -> 0},
{a -> 17, b -> 61, c -> 1, d -> 9, e -> 14, f -> 0, g -> 1}, {a ->
68, b -> 60, c -> 10, d -> 7, e -> 3, f -> 2, g -> 0},
{a -> 42, b -> 90, c -> 5, d -> 29, e -> 49, f -> 6, g -> 17}, {a ->
140, b -> 108, c -> 23, d -> 32, e -> 19, f -> 16, g -> 8}}
nsols = Simplify[RootReduce[sols /. subs]]
N[%]
giving me the answers I want
{{{y -> -2.18473, x -> 2.02599}, {y -> -0.0457403, x -> -0.53058}, {y ->
2.72299, x -> 1.70867}}, {{y -> -1.05434, x -> 1.00657}, {y ->
-0.0244319, x -> -0.536953},
{y -> 0.83139, x -> 0.871734}}, {{y -> -2.66667, x -> 2.66667}, {y ->
-0.0183209, x -> -0.50458}, {y -> 12.1294, x -> 2.53236}}, {{y -> -0.84,
x -> 0.84},
{y -> 0., x -> -0.503749}, {y -> 0., x -> 0.833749}}, {{y -> -4.83381,
x -> 4.69898}, {y -> -0.100097, x -> -0.530885}, {y -> 12.0561, x ->
3.63746}}, {{y -> -1.05985,
x -> 0.917926}, {y -> -0.014617, x -> -0.542283}, {y -> 0.351798, x
-> 0.797433}}, {{y -> -4.52487, x -> 3.85637}, {y -> -0.240225, x ->
-0.548865}, {y -> 7.61935, x -> 2.24569}},
{{y -> -1.46526, x -> 1.07904}, {y -> -0.0612374, x -> -0.561339}, {y ->
0.684794, x -> 0.770645}}}
In Mathematica 8.0 this process hangs at the Solve command. I was forced
to abort the evaluation after more than an hour with no result. The
program seems to use only 25% of the available cpu (i.e. 1 of the 4
available in the quadcore) and never arrives at a result. I thought that
equation solving was much improved in the new version, so what is going on?
Perhaps there is a much better way to get the results I want. I need to
evaluate the solutions to the above equations for large numbers of data
vectors. I would appreciate any suggestions. Thanks in advance.
LP