1

I'm trying to solve symbolically the following system of equation:

Sys = [...
   k1*x - y == 0,... 
   y - k2*z*w == 0,... 
   1 - x*k8 - y - w == 0,...
   k3*q + k5*q*r - k2*w*z - k4*z*t == 0,...
   1 - z - q == 0,...
   k4*z*t - k5*r*q == 0,...
   1 - r - t == 0];

using the function solve(Sys,[x,y,z,w,q,r,t]) i got: Warning: Explicit solution could not be found.

In solve at 169

but if i try to solve the same system of equation in Mathematica i find two solutions. Am I doing something wrong???

Thanks!

Yyrkoon
  • 13
  • 1
  • 3

3 Answers3

1

As per the documentation you must list every variable to be solved explicitly:

 AA = solve(Sys,x,y,z,w,q,r,t)
Rasman
  • 5,349
  • 1
  • 25
  • 38
  • No, the documentation does't say that. See the "solution" from @fpe, for example. Listing the variables to be solved is good form and helpful (otherwise Matlab tries to guess them and it does't always get it right) and it allows you specify the order of the output (what the documentation you linked to actually says). – horchler May 29 '13 at 16:37
0

I think it has to do with the formatting of the equation. The following code works for me (using MATLAB R2011b):

syms k1 k2 k3 k4 k5 k6 k7 k8 x y z q r t w

[x,y,z,q,r,t,w] = solve(...
                        'k1*x - y = 0',... 
                        'y - k2*z*w = 0',... 
                        '1 - x*k8 - y - w = 0',...
                        'k3*q + k5*q*r - k2*w*z - k4*z*t = 0',...
                        '1 - z - q = 0',...
                        'k4*z*t - k5*r*q = 0',...
                        '1 - r - t = 0',x,y,z,q,r,t,w);

Just as an aid to future debuggers: When I first tried the equations in this form k1*x - y == 0 I got this error message:

Error using char
Conversion to char from logical is not possible.  

This is due to the logical expression. Just removing that gave this error:

The expression to the left of the equals sign is not a valid target
for an assignment.  

Which means that Matlab only understands the equation if you put it as quoted strings.

Schorsch
  • 7,761
  • 6
  • 39
  • 65
0

I have tried this:

syms x y z w q r t k1 k2 k8 k3 k4 k5;

Sys = [...
   k1*x - y == 0,... 
   y - k2*z*w == 0,... 
   1 - x*k8 - y - w == 0,...
   k3*q + k5*q*r - k2*w*z - k4*z*t == 0,...
   1 - z - q == 0,...
   k4*z*t - k5*r*q == 0,...
   1 - r - t == 0];

S = solve(Sys);

and it found two solutions as you said.

fpe
  • 2,700
  • 2
  • 23
  • 47