vpasolve to find all real roots for multiple nonlinear equations and multiple variables

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
Hi all

I would appreciate any help in this thanks! Im 2 months old to coding!
Before I go on to my codes, my main aim is to find all real roots for 2 nonlinear equations(ss_prot1 and ss_prot2 which are steady-state rate equations(==0) of 2 different proteins ) that contain 2 variables( prot1 and prot2s).
I am currently using the "symbolic" package 2.3 for octave source forge

## Constant parameters
k0 = 0.1; #uM/min
kd = 0.05; #/min
k1 = 0.6; #uM/min
j1 = 0.1; #uM
km1 = 0.2; #uM/min
jm1 = 0.1; #uM
k2 = 0.4; #/min
j2 = 0.1;#uM
km3 = 7.05;# /min
jm3 = 2; #uM


## setting the variables prot1 and prot2s
total_prot2 = 2; # total protein2 in the cell
syms prot1 prot2s positive; #prot2s = activated protein2
prot2 = total_prot2 - prot2s # prot2 = unactivated protein2


## setting the rate expressions (degradation rate, production rate etc)
v0 = k0;
v1 = vpa((k1 * prot2) / (j1 + prot2));      
vm1 = vpa((km1 * prot2s) / (jm1 + prot2s));        
v2 = vpa((k2 * prot1 * prot2s) / (j2 + prot2s));        
vm3 = vpa((km3 * prot1 * prot2s) / (jm3 + prot2s));


## 2 steady state equations to be solved by vpasolve etc...
ss_prot1 = v0 - v2 - kd*prot1 == 0;
ss_prot2 = v1 - vm1 - vm3 == 0;
equations = [ss_prot1, ss_prot2];
variables = [prot1, prot2];


## vpasolve!
[sol_prot1 sol_prot2] = vpasolve(equations, variables)

Resuts:
Python exception: TypeError: bad operand type for abs(): 'MutableDenseMatrix'
    occurred at line 20 of the Python code block
_______________________________________________________________


Does anyone know what this means?

Thanks for your time!










Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Doug Stewart-4


On Mon, May 30, 2016 at 10:38 AM, sam kjm <[hidden email]> wrote:
Hi all

I would appreciate any help in this thanks! Im 2 months old to coding!
Before I go on to my codes, my main aim is to find all real roots for 2
nonlinear equations(ss_prot1 and ss_prot2 which are steady-state rate
equations(==0) of 2 different proteins ) that contain 2 variables( prot1 and
prot2s).
I am currently using the "symbolic" package 2.3 for octave source forge

## Constant parameters
k0 = 0.1; #uM/min
kd = 0.05; #/min
k1 = 0.6; #uM/min
j1 = 0.1; #uM
km1 = 0.2; #uM/min
jm1 = 0.1; #uM
k2 = 0.4; #/min
j2 = 0.1;#uM
km3 = 7.05;# /min
jm3 = 2; #uM


## setting the variables prot1 and prot2s
total_prot2 = 2; # total protein2 in the cell
syms prot1 prot2s positive; #prot2s = activated protein2
prot2 = total_prot2 - prot2s # prot2 = unactivated protein2


## setting the rate expressions (degradation rate, production rate etc)
v0 = k0;
v1 = vpa((k1 * prot2) / (j1 + prot2));
vm1 = vpa((km1 * prot2s) / (jm1 + prot2s));
v2 = vpa((k2 * prot1 * prot2s) / (j2 + prot2s));
vm3 = vpa((km3 * prot1 * prot2s) / (jm3 + prot2s));


## 2 steady state equations to be solved by vpasolve etc...
ss_prot1 = v0 - v2 - kd*prot1 == 0;
ss_prot2 = v1 - vm1 - vm3 == 0;
equations = [ss_prot1, ss_prot2];
variables = [prot1, prot2];


## vpasolve!
[sol_prot1 sol_prot2] = vpasolve(equations, variables)

Resuts:
Python exception: TypeError: bad operand type for abs():
'MutableDenseMatrix'
    occurred at line 20 of the Python code block
_______________________________________________________________


Does anyone know what this means?

Thanks for your time!


I dont know to full answer but I see that "variables" on line 37 is:

 [prot₁  -prot2s + 2]
 
 
The + 2 looks wrong to me.

--
DAS


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
Thanks for pointing that out!

My updated codes are as follows:
## Constant parameters
k0 = 0.1; #uM/min
kd = 0.05; #/min
k1 = 0.6; #uM/min
j1 = 0.1; #uM
km1 = 0.2; #uM/min
jm1 = 0.1; #uM
k2 = 0.4; #/min
j2 = 0.1;#uM
km3 = 7.05;# /min
jm3 = 2; #uM



## setting the variables prot1 and prot2s
total_prot2 = 2; # total protein2 in the cell
syms prot1 prot2s positive; #prot2s = activated protein2
prot2 = total_prot2 - prot2s; # prot2 = unactivated protein2



## setting the rate expressions (degradation rate, production rate etc)
v0 = k0;
v1 = vpa((k1 * prot2) / (j1 + prot2));      
vm1 = vpa((km1 * prot2s) / (jm1 + prot2s));        
v2 = vpa((k2 * prot1 * prot2s) / (j2 + prot2s));        
vm3 = vpa((km3 * prot1 * prot2s) / (jm3 + prot2s));



## 2 steady state equations to be solved by vpasolve etc...
ss_prot1 = v0 - v2 - kd*prot1 == 0;
ss_prot2s = v1 - vm1 - vm3 == 0;


equations = [ss_prot1, ss_prot2];
variables = [prot1, prot2s]; ## an update here prot2s
[sol_prot1 sol_prot2] = vpasolve(equations, variables)



And I got the following
Python exception: TypeError: bad operand type for abs(): 'MutableDenseMatrix'
    occurred at line 20 of the Python code block

Is there probably another way to vpasolve? I tried fsolve before but it needs initial values so it gives me only 1 answer for prot1 and 1 answer for prot2s for a particular start value for prot1 and prot2s

Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Oliver Heimlich
Am 30. Mai 2016 17:45:37 MESZ, schrieb sam kjm <[hidden email]>:

>Thanks for pointing that out!
>
>My updated codes are as follows:
>## Constant parameters
>k0 = 0.1; #uM/min
>kd = 0.05; #/min
>k1 = 0.6; #uM/min
>j1 = 0.1; #uM
>km1 = 0.2; #uM/min
>jm1 = 0.1; #uM
>k2 = 0.4; #/min
>j2 = 0.1;#uM
>km3 = 7.05;# /min
>jm3 = 2; #uM
>
>
>
>## setting the variables prot1 and prot2s
>total_prot2 = 2; # total protein2 in the cell
>syms prot1 prot2s positive; #prot2s = activated protein2
>prot2 = total_prot2 - prot2s; # prot2 = unactivated protein2
>
>
>
>## setting the rate expressions (degradation rate, production rate etc)
>v0 = k0;
>v1 = vpa((k1 * prot2) / (j1 + prot2));      
>vm1 = vpa((km1 * prot2s) / (jm1 + prot2s));        
>v2 = vpa((k2 * prot1 * prot2s) / (j2 + prot2s));        
>vm3 = vpa((km3 * prot1 * prot2s) / (jm3 + prot2s));
>
>
>
>## 2 steady state equations to be solved by vpasolve etc...
>ss_prot1 = v0 - v2 - kd*prot1 == 0;
>ss_prot2s = v1 - vm1 - vm3 == 0;
>
>
>equations = [ss_prot1, ss_prot2];
>variables = [prot1, prot2s]; ## an update here prot2s
>[sol_prot1 sol_prot2] = vpasolve(equations, variables)
>
>
>
>And I got the following
>Python exception: TypeError: bad operand type for abs():
>'MutableDenseMatrix'
>    occurred at line 20 of the Python code block
>
>Is there probably another way to vpasolve? I tried fsolve before but it
>needs initial values so it gives me only 1 answer for prot1 and 1
>answer for
>prot2s for a particular start value for prot1 and prot2s
>
>
>
>
>
>--
>View this message in context:
>http://octave.1599824.n4.nabble.com/vpasolve-to-find-all-real-roots-for-multiple-nonlinear-equations-and-multiple-variables-tp4677276p4677279.html
>Sent from the Octave - General mailing list archive at Nabble.com.
>
>_______________________________________________
>Help-octave mailing list
>[hidden email]
>https://lists.gnu.org/mailman/listinfo/help-octave

Did you look at fsolve of the interval package? It will compute a coverage of any solutions in the search range, e. g., in the range [0, 2] for each variable. There are several examples in the package documentation.

Oliver

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Colin Macdonald-2
In reply to this post by sam kjm
On 30/05/16 08:45, sam kjm wrote:
> equations = [ss_prot1, ss_prot2];

I pasted in your code and got:

>> equations = [ss_prot1, ss_prot2];
error: 'ss_prot2' undefined near line 1 column 23

> Is there probably another way to vpasolve? I tried fsolve before but it
> needs initial values so it gives me only 1 answer for prot1 and 1 answer for
> prot2s for a particular start value for prot1 and prot2s

You said "main aim is to find all real roots for 2 nonlinear equations".
 This is hard problem in general (because nonlinear).
Algorithm-wise, `vpasolve` is going to pretty much do what `fsolve`
does.  It will also need a initial guess (I think it makes one up---like
zero---if you don't specify it).  Roughly speaking, `vpasolve` is
intended for use when you need more than 16 digits of precision from
`fsolve`.

`@sym/solve` in some cases can solve nonlinear equations symbolically
(finding all solutions).  I would suggest trying that first.  But drop
the `vpa` stuff.  And perhaps look at the warnings you're getting from
converting all your constants to symbolic.


best,
Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Colin Macdonald-2
BTW, I filed a bug about the printing problems (extra `--`) in some of
your expressions.  Follow here if you wish:

https://github.com/cbm755/octsympy/issues/458

Also, `vpasolve` only supports scalar equation.  Documentation does not
make that clear!  I filed a bug to either fix that or at least make the
documentation clearer:

https://github.com/cbm755/octsympy/issues/459

best,
Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
In reply to this post by Oliver Heimlich
I see... Thanks Oliver! I'd try the fsolve from the interval package
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
In reply to this post by Colin Macdonald-2
Thanks Colin! Now I understand Octave's vpasolve.. I'd try the @sym/solve function
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Colin Macdonald-2
On 30/05/16 17:53, sam kjm wrote:
> Thanks Colin! Now I understand Octave's vpasolve.. I'd try the @sym/solve
> function

Good luck!  And when working with symbolic, you probably want `kn =
sym(1)/20` instead of `kn = 0.05` which later gets turned into a sym.

best,
Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Oliver Heimlich
In reply to this post by sam kjm
Am 31. Mai 2016 02:46:31 MESZ, schrieb sam kjm <[hidden email]>:

>I see... Thanks Oliver! I'd try the fsolve from the interval package
>
>
>
>--
>View this message in context:
>http://octave.1599824.n4.nabble.com/vpasolve-to-find-all-real-roots-for-multiple-nonlinear-equations-and-multiple-variables-tp4677276p4677284.html
>Sent from the Octave - General mailing list archive at Nabble.com.
>
>_______________________________________________
>Help-octave mailing list
>[hidden email]
>https://lists.gnu.org/mailman/listinfo/help-octave

The interval fsolve function is an excellent option for the problem described here. However, its functionality is intimidating if you haven't used interval arithmetic before.

Let me give more guidance.
1, look at the first fsolve example with parameter estimation in the package documentation.
2, exchange the function with your state function f and solve that for f = 0.
3, The first output argument of fsolve is probably useless in your case. You want to plot the second and third output as can be seen in the later examples. They will give you a guaranteed inner and outer approximation for the solution set.
4, If the approximation isn't accurate enough (e.g. inner approximation is the empty set and outer approximation is the whole search range), further knowledge of interval analysis is required to fine tune the algorithm and state function. You may ping back if you need help with that.

Oliver

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
Thanks Oliver for the guidance! I think I managed  to get some results. However I met some problems along the way again.


I have 2 separate code files:

1) My function file ("steady5.m")

function steadystate = steady5(y, total_prot2)

    ## Fixed parameters
    k0 = 0.1; #uM/min
    kd = 0.05; #/min
    k1 = 0.6; #uM/min
    j1 = 0.1; #uM
    km1 = 0.2; #uM/min
    jm1 = 0.1; #uM
    k2 = 0.4; #/min
    j2 = 0.1; #uM
    km3 = 7.05; #/min
    jm3 = 2; #uM

    ## Unknowns to be solved (prot1, prot2s)
    prot1 = y(1)
    prot2s = y(2)
    prot2 = total_prot2 - prot2s;
 
    ## setting the rate expressions (degradation rate, production rate etc)
    v0 = k0;
    v1 = (k1 * prot2) / (j1 + prot2);      
    vm1 = (km1 * prot2s) / (jm1 + prot2s);        
    v2 = (k2 * prot1 * prot2s) / (j2 + prot2s);        
    vm3 = (km3 * prot1 * prot2s) / (jm3 + prot2s);
 
    ## 2 steady state equations to be solved by fsolve etc...
    steadystate = zeros(2,5);
    ss_prot1 = v0 - v2 - kd*prot1 ;
    ss_prot2s = v1 - vm1 - vm3 ;
 
    steadystate = [ss_prot1; ss_prot2s];
 
end


2) My 2nd file contains the solve function with variables ("call_steady5")

clear;clc;clf;
total_prot2 = 0;

while total_prot2 < 1
    disp(total_prot2);
    y = fsolve(@(y) steady5(y, total_prot2), infsup ([0;0], [5;5]), optimset("display", "off"));
    disp(y);
    total_prot2 = total_prot2 + 0.5;
end

3) I got the results i think. But fsolve displays a lot of iterations before I get the final solution through disp(y). Unless I actually did not get the solutions?

Plus what if I want to get >2 solutions? I have some that should have 3 solutions but I didn't manage to replicate that.  Is it determined by the initial values infsup([], [], []) too?

Below
0 --> this part here is disp(total_protein2)
p53 = [0, 5]
AKTs = [0, 5]
p53 = [0, 2.5]
AKTs = [0, 5]
p53 = [2.5, 5]
AKTs = [0, 5]
p53 = [0, 2.5]
AKTs = [0, 2.5]
p53 = [0, 2.5]
AKTs = [2.5, 5]
p53 = [0, 1.25]
AKTs = [0, 2.5]
p53 = [0, 1.25]
AKTs = [2.5, 5]
p53 = [1.25, 2.5]
AKTs = [0, 2.5]
p53 = [1.25, 2.5]
AKTs = [2.5, 5]
p53 = [0, 1.25]
AKTs = [0, 1.25]
p53 = [0, 1.25]
AKTs = [2.5, 3.75]
p53 = [1.25, 2.5]
AKTs = [0, 1.25]
p53 = [0, 1.25]
AKTs = [1.25, 2.5]
p53 = [0, 1.25]
AKTs = [3.75, 5]
p53 = [1.25, 2.5]
AKTs = [1.25, 2.5]
p53 = [0, 0.625]
AKTs = [0, 1.25]
p53 = [0, 0.625]
AKTs = [2.5, 3.75]
p53 = [1.25, 1.875]
AKTs = [0, 1.25]
p53 = [0, 0.625]
AKTs = [1.25, 2.5]
p53 = [0, 0.625]
AKTs = [3.75, 5]
p53 = [0.625, 1.25]
AKTs = [0, 1.25]
p53 = [0.625, 1.25]
AKTs = [2.5, 3.75]
p53 = [1.875, 2.5]
AKTs = [0, 1.25]
p53 = [0.625, 1.25]
AKTs = [1.25, 2.5]
p53 = [0.625, 1.25]
AKTs = [3.75, 5]
p53 = [0, 0.625]
AKTs = [0, 0.625]
p53 = [0, 0.625]
AKTs = [2.5, 3.125]
p53 = [1.25, 1.875]
AKTs = [0, 0.625]
p53 = [0, 0.625]
AKTs = [1.25, 1.875]
p53 = [0, 0.625]
AKTs = [3.75, 4.375]
p53 = [0.625, 1.25]
AKTs = [0, 0.625]
p53 = [1.875, 2.5]
.
.
.
.
.
AKTs <E2><8A><82> [0.0097656, 0.019532]
p53 <E2><8A><82> [0.24414, 0.25391]
AKTs <E2><8A><82> [0.81054, 0.82032]
p53 <E2><8A><82> [0.40039, 0.41016]
AKTs <E2><8A><82> [0.10742, 0.11719]
p53 <E2><8A><82> [0.36132, 0.3711]
AKTs <E2><8A><82> [0.10742, 0.11719]
p53 <E2><8A><82> [0.24414, 0.25391]
AKTs <E2><8A><82> [0.8496, 0.85938]
p53 <E2><8A><82> [0.24414, 0.25391]
AKTs <E2><8A><82> [0.77148, 0.78125]
p53 <E2><8A><82> [0.34179, 0.35157]
AKTs <E2><8A><82> [0.10742, 0.11719]
p53 <E2><8A><82> [0.41992, 0.42969]
AKTs <E2><8A><82> [0.10742, 0.11719]
p53 <E2><8A><82> [0.38085, 0.39063]
AKTs <E2><8A><82> [0.10742, 0.11719]
   [0.23437, 2.002]
       [0, 0.88868]

etc..

Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Oliver Heimlich
On 01.06.2016 08:38, sam kjm wrote:

> Thanks Oliver for the guidance! I think I managed  to get some results.
> However I met some problems along the way again.
>
>
> I have 2 separate code files:
>
> 1) My function file ("steady5.m")
>
> function steadystate = steady5(y, total_prot2)
>

...

>
>     ## Unknowns to be solved (prot1, prot2s)
>     prot1 = y(1)
>     prot2s = y(2)
>     prot2 = total_prot2 - prot2s;

...

> end
>
>

> 3) I got the results i think. But fsolve displays a lot of iterations before
> I get the final solution through disp(y). Unless I actually did not get the
> solutions?
>
> Plus what if I want to get >2 solutions? I have some that should have 3
> solutions but I didn't manage to replicate that.  Is it determined by the
> initial values infsup([], [], []) too?
>

I have replayed your example. A lot of output comes from the missing
semicolons in steady5. The fsolve function bisects the search range and
calls steady5 a lot of times (brute-force method). That's why you see so
much noise. The final solution should be correct, but it is only an
enclosure of many solutions.

total_protein2 = 0
   [0.23437, 2.002]
       [0, 0.88868]
total_protein2 = 0.50000
   [0.23437, 0.30274]
    [0.26367, 1.0547]

You can get a detailed look on many solutions like this in call_steady5.m:

clear;clc;clf;
total_prot2 = 0;

while total_prot2 < 1
    disp(total_prot2);
    [y, solutions, inner] = fsolve(@(y) steady5(y, total_prot2), infsup
([0;0], [5;5]));

    ## Outer approximation of all solutions
    disp(y);

    clf
    hold on
    ##  Outer approximation of solution set (green)
    plot (solutions(1, :), solutions(2, :))
    ##  Inner approximation of solution set (red)
    plot (solutions(1, inner), solutions(2, inner), [1 0 0])
    xlabel ("prot1")
    ylabel ("prot2s")

    input ("Continue? Press Enter.");

    total_prot2 = total_prot2 + 0.5;
end

As you can see in the plot, there are only small ranges where solutions
might occur. Any white area in the plot is guaranteed to have no
solution. However, the algorithm did not find an inner approximation of
the solution set. That means, you have no guarantee that the green areas
contain any solutions at all. Please keep that in mind!

For example, when you increase the precision & runtime with
optimset("TolX", 0.001, "MaxIter", 25), you will see that the solution
set is actually even smaller. It looks like there were two solutions,
but I might be wrong.

I could reduce the overestimation (and increase the speed) of the
algorithm further by using the following rate expressions in steady5.m.
As a rule of thumb you should try to have each interval variable only
once per expression. Otherwise you'd introduce the so called “dependency
error”, a common problem in interval arithmetic.

    ## setting the rate expressions (degradation rate, production rate etc)
    v0 = k0;
    v1 = k1 / (j1 / prot2 + 1);
    vm1 = km1 / (jm1 / prot2s + 1);
    v2 = (k2 * prot1) / (j2 / prot2s + 1);
    vm3 = (km3 * prot1) / (jm3 / prot2s + 1);

I hope this helps.

Oliver


P.S. In your computations you assume that your model and fixed
parameters are exact. You may also play with inexact parameters and see
what happens. For example, you can use k2 = infsup ("0.4?") to add an
uncertainty of +/- 0.5 decimal ULP to that value.

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
I see! Thanks loads for the jump starters!
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
In reply to this post by Colin Macdonald-2
Hi Colin!

I tried the same problem using symbolic methods this time. I managed to get the solutions I think. But something strange happened in the command window so I can't decipher the solutions. How do i eliminate the chevron identities?

## Constant parameters
k0 = sym(1)/10; #uM/min
kd = sym(1)/20; #/min
k1 = sym(6)/10; #uM/min
j1 = sym(1)/10; #uM
km1 = sym(2)/10; #uM/min
jm1 = sym(1)/10; #uM
k2 = sym(4)/10; #/min
j2 = sym(1)/10;#uM
km3 = sym(141)/20;# /min
jm3 = sym(2); #uM

## Setting the variables
AKTtot = sym(2);
syms p53 AKTs positive;
AKT = AKTtot - AKTs;

##Setting rate expressions
v0 = k0;
v1 = (k1 * AKT) / (j1 + AKT);
vm1 = (km1 * AKTs) / (jm1 + AKTs);
v2 = (k2 * p53 * AKTs) / (j2 + AKTs);
vm3 = (km3 * p53 * AKTs) / (jm3 + AKTs);

## Equations to be solved
ssp53 = v0 - v2 - kd*p53 == 0;
ssAKT = v1 - vm1 - vm3 == 0;
solve(ssp53, ssAKT, p53, AKTs);


Results:
Waiting..................................
ans =
{
  [1,1] =

    scalar structure containing the fields:

AKTs = (sym)


          <E2><95><B1>
         <E2><95><B1>
        <E2><95><B1>
                __________________________________________________________________________________________________________________________       <E2><95><B1>
               <E2><95><B1>                                                                             ____________________________________________           <E2><95><B1>
              <E2><95><B1>  351983                            29755967                                 <E2><95><B1>  844328630599    <E2><88>
<9A>1607355029231483494015<E2><8B><85><E2><85><88>           <E2><95><B1>
             <E2><95><B1>   <E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80> + <E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80> + 2<E2><8B><85>3 <E2><95><B1>  <E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80> + <E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80>          <E2><95><B1>
            <E2><95><B1>    294000                 ____________________________________________     <E2><95><B2><E2><95><B1>   62511750000000        6945750000000               <E2><95><B1>
           <E2><95><B1>                           <E2><95><B1>  844328630599    <E2><88><9A>1607355029231483494015<E2><8B><85><E2><85><88>                                                         <E2><95><B1>
          <E2><95><B1>               248062500<E2><8B><85>3 <E2><95><B1>  <E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80> + <E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>                                          <E2><95><B1>
  551   <E2><95><B2><E2><95><B1>                          <E2><95><B2><E2><95><B1>   62511750000000         6945750000000                                           <E2><95><B2><E2><95><B1>
  <E2><94><80><E2><94><80><E2><94><80> - <E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94>
<80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
<E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80> - <E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2>
<94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80><E2><94><80>
  840                                                                   2

  ...... and many more of the <E80> interspersed with numbers (my solutions i think)
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

Colin Macdonald-2
On 02/06/16 01:54, sam kjm wrote:
> I tried the same problem using symbolic methods this time. I managed to get
> the solutions I think. But something strange happened in the command window
> so I can't decipher the solutions. How do i eliminate the chevron
> identities?

Possible its a unicode problem.  Try `sympref display ascii` or `sympref
display flat`.  Let me know if that helps.

What version of Symbolic?  Might be fixed in 2.4.0 (which is in release
process---if you're using the Windows "bundle" its available now.)

Here's what your code gave me:

````
>> sol = solve(ssp53, ssAKT, p53, AKTs);
>> length(sol)
ans =  4
>> double(sol{1}.p53)
ans = -13.482
>> double(sol{2}.p53)
ans =  0.23102
>> double(sol{3}.p53)
ans =  7.7862e-02 + 1.6941e-21i
>> double(sol{4}.p53)
ans =  0.25735
````

*But* solve took suspiciously long: I'd check those solutions carefully
if I were you!  Particularly the one with small imaginary part: did
SymPy do some numerical solve along the way?  If so, can we trust we
have all answers...?

Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables

sam kjm
Thanks Colin!