help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: sam kjm
Subject: Re: vpasolve to find all real roots for multiple nonlinear equations and multiple variables
Date: Tue, 31 May 2016 23:38:07 -0700 (PDT)

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..





--
View this message in context: 
http://octave.1599824.n4.nabble.com/vpasolve-to-find-all-real-roots-for-multiple-nonlinear-equations-and-multiple-variables-tp4677276p4677346.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]