Message Boards Message Boards

0
|
6437 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Help me to solve the simultaneous equations

Posted 10 years ago

HI I have a simultaneous equation in terms of a, b, c, d. when I try to use NSolve to solve the equation and get the vales of a, b, c, d in terms of p,q,r,s it is just giving empty bracket as an answer. Any one can help me to solve this equation.

NSolve[{a*b + a*c + b*d + c*d == p && 
              a*b + b*c - b*d == q &&  
              a*b + b*c + a*d + c*d == r && 
              a*b + a*c - a*d == s}, 
            {a, b, c, d}]

Thanks in advance.

POSTED BY: Aadhi A
4 Replies

together enter image description here

POSTED BY: Simon Cadrin
In[3]:= Reduce[{a*b + a*c + b*d + c*d == p && a*b + b*c - b*d == q && 
   a*b + b*c + a*d + c*d == r && a*b + a*c - a*d == s}, {a, b, c, d}, 
 Backsubstitution -> True]

Out[3]= (p == -q + r + s && a != 0 && 
   b == (a^2 + s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])/(2 a) && 
   a^2 + s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] != 0 && 
   c == (-3 a^4 + 4 a^2 q - 4 a^2 s - s^2 + 
       3 a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       Sqrt[2] a^2 \[Sqrt](-(1/(
           a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (-a^4 + 
              2 a^2 q - 2 a^2 s - s^2 + 
              a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
              s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s -
          Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])) && 
   d == -((a^4 + 2 a^2 s + s^2 - 
         a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
         s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
         Sqrt[2] a^2 \[Sqrt](-(1/(
             a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (-a^4 + 
                2 a^2 q - 2 a^2 s - s^2 + 
                a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
                s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + 
           s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))) || (p == -q + 
     r + s && a != 0 && 
   b == (a^2 + s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])/(2 a) && 
   a^2 + s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] != 0 && 
   c == (-3 a^4 + 4 a^2 q - 4 a^2 s - s^2 + 
       3 a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
       Sqrt[2] a^2 \[Sqrt](-(1/(
           a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (-a^4 + 
              2 a^2 q - 2 a^2 s - s^2 + 
              a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
              s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s -
          Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])) && 
   d == -((a^4 + 2 a^2 s + s^2 - 
         a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
         s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
         Sqrt[2] a^2 \[Sqrt](-(1/(
             a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (-a^4 + 
                2 a^2 q - 2 a^2 s - s^2 + 
                a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
                s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + 
           s - Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))) || (p == -q + 
     r + s && a != 0 && 
   b == (a^2 + s + Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])/(2 a) && 
   a^2 + s + Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] != 0 && 
   c == (-3 a^4 + 4 a^2 q - 4 a^2 s - s^2 - 
       3 a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       Sqrt[2] a^2 \[Sqrt]((1/(
          a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (a^4 - 
             2 a^2 q + 2 a^2 s + s^2 + 
             a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
             s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s + 
         Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])) && 
   d == (-a^4 - 2 a^2 s - s^2 - 
       a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       Sqrt[2] a^2 \[Sqrt]((1/(
          a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (a^4 - 
             2 a^2 q + 2 a^2 s + s^2 + 
             a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
             s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s + 
         Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2]))) || (p == -q + r + s &&
    a != 0 && 
   b == (a^2 + s + Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])/(2 a) && 
   a^2 + s + Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] != 0 && 
   c == (-3 a^4 + 4 a^2 q - 4 a^2 s - s^2 - 
       3 a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
       Sqrt[2] a^2 \[Sqrt]((1/(
          a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (a^4 - 
             2 a^2 q + 2 a^2 s + s^2 + 
             a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
             s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s + 
         Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])) && 
   d == (-a^4 - 2 a^2 s - s^2 - 
       a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] - 
       s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
       Sqrt[2] a^2 \[Sqrt]((1/(
          a^4))(a^4 - 4 a^2 q + 4 a^2 r + 2 a^2 s + s^2) (a^4 - 
             2 a^2 q + 2 a^2 s + s^2 + 
             a^2 Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2] + 
             s Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2])))/(2 a (a^2 + s + 
         Sqrt[a^4 - 4 a^2 q + 2 a^2 s + s^2]))) || (s == 0 && 
   p == -q + r && a == 0 && b != 0 && 
   c == (-b^2 + q - Sqrt[b^4 - 2 b^2 q + q^2 + 4 b^2 r])/(2 b) && 
   d == (-b^2 - q - Sqrt[b^4 - 2 b^2 q + q^2 + 4 b^2 r])/(
    2 b)) || (s == 0 && p == -q + r && a == 0 && b != 0 && 
   c == (-b^2 + q + Sqrt[b^4 - 2 b^2 q + q^2 + 4 b^2 r])/(2 b) && 
   d == (-b^2 - q + Sqrt[b^4 - 2 b^2 q + q^2 + 4 b^2 r])/(
    2 b)) || (q == 0 && p == r + s && b == 0 && a != 0 && 
   c == (-a^2 + s - Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2])/(
    2 a) && -a^2 + s - Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2] != 0 && 
   d == -((a (a^2 + 2 r + s + Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2]))/(
     a^2 - s + Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2]))) || (q == 0 && 
   p == r + s && b == 0 && a != 0 && 
   c == (-a^2 + s + Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2])/(
    2 a) && -a^2 + s + Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2] != 0 && 
   d == -((a (a^2 + 2 r + s - Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2]))/(
     a^2 - s - Sqrt[a^4 + 4 a^2 r + 2 a^2 s + s^2]))) || (r == -s && 
   q == 0 && p == 0 && b == 0 && c == 0 && a != 0 && 
   d == -(s/a)) || (s == 0 && q == 0 && p == r && a == 0 && b == 0 && 
   c != 0 && d == r/c) || (s == 0 && r == 0 && q == 0 && p == 0 && 
   a == 0 && b == 0 && c == 0)
POSTED BY: Frank Kampas

Possibly solve the equations stepwise. For example

In[49]:= Solve[a*b + a*c + b*d + c*d == p, a]

Out[49]= {{a -> (-b d - c d + p)/(b + c)}}

In[52]:= a = (-b d - c d + p)/(b + c);

Then use this result in second equation for b, etc.

POSTED BY: S M Blinder

That means there is no solution. Also since there are nonnumeric parameters, you might as well use Solve because that's what NSolve will have to do anyway.

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