ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 03 Jul 2016 12:02:15 -0500numerical computation of roots (maple equivalent of fsolve) of a system of nonlinear equations with multiple variables parametershttp://ask.sagemath.org/question/34002/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
sam_kjmSun, 03 Jul 2016 12:02:15 -0500http://ask.sagemath.org/question/34002/Basis of invariant polynomial systemhttp://ask.sagemath.org/question/8509/basis-of-invariant-polynomial-system/I've been trying to compute a Grobner basis for a specific invariant polynomial system. It has 6 variables, 6 constants and 6 equations and is invariant to a group of cardinality 2. Various algorithms have been ran on it, including FGb/Gb through Maple and Singular through SAGE system. In both cases, the invariance was ignored and the computation of the Grobner basis failed to finish after hours (sometime days) of computation, while occupying all the memory available. Please note, I do not know what exactly the underlying algorithm was (Buchberger/F4/F5...).
It is an engineering application and in practice, I would only need the first few polynomials of the Grobner basis, that is the ones with as low degree as possible. I'm an engineer not a mathematician, so my knowledge of the topic is very limited. I did however understood, that in case of invariant systems, a SAGBI basis (or invariant Grobner basis) can be computed much more efficiently. More important, the invariant Grobner basis can be computed "up to a given degree", which is exactly what I probably need.
I got a hint that such algorithm might exist in SAGE. I've been searching through the SAGE documentation, but it seems I don't know what to search for and the system is huge.
If anyone can point me to right direction it would be great!
The problem:
X0 + Y0 - S0 = 0
X0 X1 + Y0 Y1 - S1 = 0
X0 ( X1^2 + 2 X2 )+ Y0 ( Y1^2 + 2 Y2 )- 2 S2 = 0
X0 ( X1^3 + 6 X2 X1 )+ Y0 ( Y1^3 + 6 Y2 Y1 ) - 6 S3 = 0
X0 ( X1^4 + 12 X2 X1^2 + 12 X2^2 )+ Y0 ( Y1^4 + 12 Y2 Y1^2 + 12 Y2^2 )- 24 S4 = 0
X0 ( X1^5 + 20 X2 X1^3 + 60 X2^2 X1 ) + Y0 ( Y1^5 + 20 Y2 Y1^3 + 60 Y2^2 Y1 ) - 120 S5 = 0
Where X0,X1,X2,Y0,Y1,Y2 are variables S0...S5 are constants, all are complex numbers.musevicThu, 24 Nov 2011 06:20:32 -0600http://ask.sagemath.org/question/8509/