Frage

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!

War es hilfreich?

Lösung

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

 AA = solve(Sys,x,y,z,w,q,r,t)

Andere Tipps

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.

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top