Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following system of equations that I need to solve:

ArrayOfEquations={-(u/10) + 0.4 v[1] - 0.16 v[2] + 0.064 v[3] - 0.0256 v[4] + 
0.01024 v[5] - 0.004096 v[6] + 0.0016384 v[7] - 0.00065536 v[8] + 
0.000262144 v[9] == g[1], 
-0.4 v[1] + 0.32 v[2] - 0.192 v[3] + 0.1024 v[4] - 
0.0512 v[5] + 0.024576 v[6] - 0.0114688 v[7] + 0.00524288 v[8] - 
0.0023593 v[9] == g[2], 
-0.16 v[2] + 0.192 v[3] - 0.1536 v[4] + 0.1024 v[5] - 
0.06144 v[6] + 0.0344064 v[7] - 0.0183501 v[8] + 0.00943718 v[9] ==g[3], 
-0.064 v[3] + 0.1024 v[4] - 0.1024 v[5] + 0.08192 v[6] - 
0.057344 v[7] + 0.0367002 v[8] - 0.0220201 v[9] == g[4], 
-0.0256 v[4] + 0.0512 v[5] - 0.06144 v[6] + 0.057344 v[7] - 
0.0458752 v[8] + 0.0330301 v[9] == g[5], 
-0.01024 v[5] + 0.024576 v[6] - 0.0344064 v[7] + 
0.0367002 v[8] - 0.0330301 v[9] == g[6], 
-0.004096 v[6] + 0.0114688 v[7] - 0.0183501 v[8] + 
0.0220201 v[9] == g[7], 
-0.0016384 v[7] + 0.00524288 v[8] - 0.00943718 v[9] == g[8], 
-0.00065536 v[8] + 0.0023593 v[9] == g[9], 
-0.000262144 v[9] == g[10]}

I want to solve it for variables $u$ and $v[i]$, $i=1,..9$. When I call

Solve[ArrayOfEquations, Join[{u}, Array[v, 9]]]

I get {} as an output.

Why doesn't it work?

I understand that {} in general means no solution. However, I tried it with some numbers substituted for g[i] and got a numerical output. Can't understand what goes wrong if I keep the g[i] symbolically

Thanks for any help!

share|improve this question
    
ToRules@Reduce[ArrayOfEquations, Join[{u}, Array[v, 9]]] – Dr. belisarius May 15 '14 at 13:28
    
...or add ,Reals as an option at the end – gpap May 15 '14 at 13:30
    
@belisarius I don't understand the output if I give your code line. For example, if I put Solve[ArrayOfEquations[[10]], v[9]], then I get v[9] -> -3814.7 g[10]. However, with your solution I get a different expression. Where do all the other terms come from? From the last equation, it's clear that for v[9] the answer is simple... – GregVoit May 15 '14 at 13:32
    
@gpap the same output as from belisarius... – GregVoit May 15 '14 at 13:33
    
Please see (for example)mathematica.stackexchange.com/a/18706/193 – Dr. belisarius May 15 '14 at 13:35

Your equations are actually inconsistent unless $g$ has a particular form.

When I rationalise and solve, I obtain the following requirements on the solution

{True,
 7.10543*10^-15 g[7] + 7.10543*10^-15 g[8] + 7.10543*10^-15 g[9] == 0, 
 3.55271*10^-15 g[6] + 5.68434*10^-14 g[9] == 0,
 True,
 True, 
 1.11022*10^-16 g[6] + 8.88178*10^-16 g[7] + 3.55271*10^-15 g[8] + 7.10543*10^-15 g[9] == 0,
 True, True, True, True}

As others have said, this is a rounding error problem: when you substitute numerical values for g, those small terms will become very close to 0..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.