Message Boards Message Boards

Solving equations for all occurences of [constant]

Posted 10 years ago

Hey, slightly new to the whole software of Mathematica, as well as programming, etc. And i've occured a simple problem in my need

It occures that whenever i try to calculate a set of equations with an unknown (set of) constant(s), (which normally would be done through hand) seem to eliminate the constant through the equations, leaving it with a wrong answer, as an example i'd like to be able to compute the reduced solution for x1+2x2+4x3+4*x4=b1 3x1+x2+7x3-3*x4=b2 2x1+x2+5x3-x4=b3 x1+x2+3*x3+x4=b4 or likewise, thanks in advance.

POSTED BY: Oliver Madsen
2 Replies
In[1]:= eqs = {x1 + 2 x2 + 4 x3 + 4 x4 == b1, 
   3 x1 + x2 + 7 x3 - 3 x4 == b2 , 2 x1 + x2 + 5 x3 - x4 == b3, 
   x1 + x2 + 3*x3 + x4 == b4};

In[3]:= Reduce[eqs, {x1, x2, x3, x4}]

Out[3]= b2 == 2 b3 - b4 && b1 == -b3 + 3 b4 && 
 x3 == b3/8 + b4/8 - (3 x1)/8 - x2/4 && 
 x4 == -((3 b3)/8) + (5 b4)/8 + x1/8 - x2/4
POSTED BY: Frank Kampas

Are you specifying which are the variables to solve for? (Really hard to diagnose when no code is provided.)

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract