Ask Your Question

sam_kjm's profile - activity

2023-07-04 18:21:35 +0200 received badge  Famous Question (source)
2021-08-31 08:29:48 +0200 received badge  Famous Question (source)
2018-09-04 20:15:10 +0200 received badge  Notable Question (source)
2018-09-04 20:15:10 +0200 received badge  Popular Question (source)
2018-03-20 22:05:18 +0200 received badge  Notable Question (source)
2016-09-27 14:41:59 +0200 received badge  Teacher (source)
2016-09-27 14:41:59 +0200 received badge  Self-Learner (source)
2016-08-20 14:54:41 +0200 received badge  Popular Question (source)
2016-07-04 05:55:39 +0200 commented answer numerical computation of roots (maple equivalent of fsolve) of a system of nonlinear equations with multiple variables parameters

Hey thanks!

Is there a way to try out multiple guesses(in an array) for multiple variables? Or any function that can do away with initial guesses or set a boundary of solutions within an interval?

2016-07-03 19:02:15 +0200 asked a question numerical computation of roots (maple equivalent of fsolve) of a system of nonlinear equations with multiple variables parameters

Hi All, the following is my code:

### Begin Code#####

#Parameters:
k0 = 0.1 
kd = 0.05 
k1 = 20 
j1 = 0.1 
km1 = 0.2 
jm1 = 0.1
k2 = 0.055
j2 = 0.1
pPTEN = 0.001
dPTEN = 0.0054
k3 = 0.006
j3 = 2
k4 = 0.15
j4 = 0.1
km4 = 73
jm4 = 0.5
pMdm2 = 0.018
dMdm2 = 0.015
dMdm2s = 0.015
k5 = 0.024
j5 = 1
k6 = 10
j6 = 0.3
km6 = 0.2
jm6 = 0.1
n1 = 3
n2 = 3
PIPtot = 1
AKTtot = 1




#Variables to solve
p53 = var('p53')
AKTs = var('AKTs')
Mdm2 = var('Mdm2')
Mdm2s = var('Mdm2s')
PIP3 = var('PIP3')
PTEN = var('PTEN')

AKT = AKTtot - AKTs
PIP2 = PIPtot - PIP3

#Rate Equations
v0 = k0
v1 = (k1 * PIP3 * AKT) / (j1 + AKT)       
vm1 = (km1 * AKTs) / (jm1 + AKTs)        
v2 = (k2 * Mdm2s * p53) / (j2 + p53)  
v3 = (k3 * ((p53)^n1))/(((j3)^n1) + ((p53)^n1))
v4 = (k4 * PIP2)/(j4 + PIP2)
vm4 = (km4 * PTEN * PIP3)/(jm4 + PIP3)
v5 = (k5 * ((p53)^n2))/(((j5)^n2) + ((p53)^n2))
v6 = (k6 * Mdm2 * AKTs)/(j6 + Mdm2)
vm6 = (km6 * Mdm2s)/(jm6 + Mdm2s)

ss_p53 = v0 - v2 - kd*p53
ss_AKTs = v1 - vm1
ss_PIP3 = v4 - vm4
ss_PTEN = pPTEN + v3 - dPTEN * PTEN
ss_Mdm2s = v6 - vm6 - dMdm2s*Mdm2s
ss_Mdm2 = pMdm2 + v5 - v6 + vm6 - dMdm2*Mdm2

#Equation to Solve
z = solve([ss_p53==0, ss_AKTs==0, ss_PIP3==0, ss_PTEN==0, ss_Mdm2s==0, ss_Mdm2==0],\ [p53, AKTs, PIP3,PTEN, Mdm2s, Mdm2])

End Code

I tried using Sage "solve" to analytically solve the system of equations. I got a "FloatingPointError: Floating point exception"

I thought of ways to get round this exception by 1) using log and exp in my math equations -- I can't work round this 2) I have no idea how to create exceptions for this since I can't access the sub-solutions while the solutions are still underway 3)Then I tried maxima.solve --> no roots could be found

Maybe, this problem can't be solved analytically, so I thought maybe I could do so numerically. Hence my following question,

I can only find functions that tackle univariate equations. Is there a sage equivalent of maple's f-solve which numerically computes all roots of multivariate system of nonlinear equations without the need of initial conditions?

Thanks a lot! I would really appreciate this

Rgds Samantha

2016-06-30 19:37:57 +0200 received badge  Student (source)
2016-06-30 18:02:26 +0200 asked a question why green bar disappears prematurely, my codes have not finished running

Hi guys Above is my question. I have long calculations to do on Sage, however the green bar disappears, while the '/' and '\' still alternates in my webpage tab on mac safari and the solutions(graph) have yet to appear.

Any idea? Thanks!

Samantha

2016-06-30 17:57:42 +0200 answered a question Convert all complex numbers in array/matrix to value 0 or remove these numbers

I did the following to solve this: 1) after solution and appending to lists, I stack lists into matrix 2) convert type from object to 'float64' 3) start a conditional to convert all terms with imag(x) != 0 into nan 4) do a mask to eliminate all rows(axis=1) that contains any term that gives true to isnan()

2016-06-20 03:57:42 +0200 commented question Convert all complex numbers in array/matrix to value 0 or remove these numbers

1)I did a "solve" on 2 nonlinear equations with variables var1 and var2. z = solve 2)I made 2 empty lists : var1_y = [], var2_y = [] then i appended the var 1 and var 2 solutions separately for solution in z: var1_y.append(var1.subs(solution)) var2_y.append(var2.subs(solution)) 3) then I combine them into matrix. How do I delete the rows with complex no? Thx! var1_y2 = matrix(var1_y).transpose() var2_y2 = matrix(var2)y).transpose() A = var1_y2.augment(var2_y2) [ 2 0] [ -1/10 0] [0.5186911103074608 - 0.8859791354693165I 0.1849665371636101 +0.1317620873508901I] [ 2.887006775607812 -0.1147163491731212

2016-06-19 17:17:17 +0200 asked a question Convert all complex numbers in array/matrix to value 0 or remove these numbers

Hi all

I'm new to sagemath, approximately 2 week-old. How do you convert all complex numbers in a nested array to value 0 or NaN? Or to remove these numbers from the array/matrix(which is eventually what I want to achieve in the end)?

Thanks for your help!

Rgds Sam