ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 23 Dec 2020 01:22:04 +0100A Simple Exponential Equationhttps://ask.sagemath.org/question/54862/a-simple-exponential-equation/Sage can solve the equation $8^t =37$ for $t$:
solve( (8)^t ==37, t )
But strangely, cannot solve $\left(\frac 89\right)^t =37$
solve( (8/9)^t ==37, t )
Any ideas?KapcakWed, 23 Dec 2020 01:22:04 +0100https://ask.sagemath.org/question/54862/How to solve nonlinear equation having floating values?https://ask.sagemath.org/question/52139/how-to-solve-nonlinear-equation-having-floating-values/I'm trying to solve equation which simplifies to this form:
`a^x = b`
eg.
`solve([(123)^y==(234234)],y)`
which returns `[y == log(234234)/log(123)]`
but `solve([(123.123)^y==(234234.123)],y)` (having floating point constants)
returns
[123123^y == 234234123*1000^(y - 1)]
How do I get it to return the answer in terms of log.recoderMon, 22 Jun 2020 04:02:26 +0200https://ask.sagemath.org/question/52139/Problems and errors in solve an equationhttps://ask.sagemath.org/question/46842/problems-and-errors-in-solve-an-equation/ Hi everybody, I want to solve this non linear equation: omega_nf_eq = 0.
m,J_d,J_p,y,Y,omega,Omega,phi,Phi,z,Z,theta,Theta,k_yy,k_zz,k_phiphi,k_yphi,k_ztheta,k_thetatheta,plane_xy1,plane_xy2,plane_xz1,plane_xz2 = var('m J_d J_p y Y omega Omega phi Phi z Z theta Theta k_yy k_zz k_phiphi k_yphi k_ztheta k_thetatheta plane_xy1 plane_xy2 plane_xz1 plane_xz2')
t = var('t')
omega_nf_eq = -J_d^2*k_yy*k_zz*omega^4 + 0.382*J_d^2*k_yy*omega^6 + 0.382*J_d^2*k_zz*omega^6 - 0.145924*J_d^2*omega^8 + J_d*k_phiphi*k_yy*k_zz*omega^2 - 0.382*J_d*k_phiphi*k_yy*omega^4 - 0.382*J_d*k_phiphi*k_zz*omega^4 + 0.145924*J_d*k_phiphi*omega^6 + J_d*k_thetatheta*k_yy*k_zz*omega^2 - 0.382*J_d*k_thetatheta*k_yy*omega^4 - 0.382*J_d*k_thetatheta*k_zz*omega^4 + 0.145924*J_d*k_thetatheta*omega^6 - J_d*k_yphi^2*k_zz*omega^2 + 0.382*J_d*k_yphi^2*omega^4 - J_d*k_yy*k_ztheta^2*omega^2 + 0.382*J_d*k_ztheta^2*omega^4 + J_p^2*Omega^2*k_yy*k_zz*omega^2 - 0.382*J_p^2*Omega^2*k_yy*omega^4 - 0.382*J_p^2*Omega^2*k_zz*omega^4 + 0.145924*J_p^2*Omega^2*omega^6 - k_phiphi*k_thetatheta*k_yy*k_zz + 0.382*k_phiphi*k_thetatheta*k_yy*omega^2 + 0.382*k_phiphi*k_thetatheta*k_zz*omega^2 - 0.145924*k_phiphi*k_thetatheta*omega^4 + k_phiphi*k_yy*k_ztheta^2 - 0.382*k_phiphi*k_ztheta^2*omega^2 + k_thetatheta*k_yphi^2*k_zz - 0.382*k_thetatheta*k_yphi^2*omega^2 - k_yphi^2*k_ztheta^2 == 0
solve(omega_nf_eq, omega)
But the Sage is unable to find the solution, damn it.
I get this error message:
TypeError: ECL says: Memory limit reached. Please jump to an outer pointer, quit program and enlarge the memory limits before executing the program again.
I know the equation is big but i didn't expected such many problems.
I've already tried sympy but nothing.
Is there another way?
pull_over93Fri, 07 Jun 2019 00:38:46 +0200https://ask.sagemath.org/question/46842/solve system of non-linear implicit equations numericallyhttps://ask.sagemath.org/question/10269/solve-system-of-non-linear-implicit-equations-numerically/I am attempting to solve for a solution of a system of two non-linear implicit equations using the following code:
x = var('x')
y = var('y')
P = [(-1,-5), (1,-5), (-5,0), (5,5)]
# Defining the function
d = sum([sqrt( (x-p[0])^2 + (y-p[1])^2 ) for p in P])
show(d)
# Differentiate with respect to x and y
eqx = d.diff(x)
eqy = d.diff(y)
# Plot both implicit curves
g1 = implicit_plot( eqx==0, (x,-10,10), (y,-10,10), color="blue" )
g2 = implicit_plot( eqy==0, (x,-10,10), (y,-10,10), color="red" )
show(g1 + g2) # note that you can clearly see an intersection of the two curves
# Solve for the solution
print("Solving...")
sol = solve([eqx==0, eqy==0], x, y) # this gets stuck or takes a long time
show(sol)
Everything runs, up to the point of the solve function, which continues to run for what appears to be indefinitely. The code show(g1 + g2) shows a graph that clearly shows there exists an intersection for both curves. I tried to use to_poly_solve=True without success. I do not mind an approximate solution, however I was unable to find a numeric solver for a system such as this (find_root afaik only works on one variable) that will work.
Does there exist a numeric solver which is capable of solving a system of this form? What other alternatives are there?
Thanks,
menturimenturi628Fri, 21 Jun 2013 18:06:50 +0200https://ask.sagemath.org/question/10269/Solve a simple system of non-linear equationshttps://ask.sagemath.org/question/8557/solve-a-simple-system-of-non-linear-equations/Maple can solve a system of equations such as $\sin x + y =0, \sin x - y =0$. However,
var('x y')
solve([sin(x) + y ==0, sin(x) - y==0], [x, y])
produces no useful answer.
Is there any other way to proceed?jllbThu, 15 Dec 2011 09:30:18 +0100https://ask.sagemath.org/question/8557/Finding numerical solution to a nonlinear equationhttps://ask.sagemath.org/question/23677/finding-numerical-solution-to-a-nonlinear-equation/I'm trying to find a solution for a nonlinear equation using cloud.sagemath but I have been unsuccessful. The command "solve" could not find a result, and I haven't been able to input the range over which the solution should be looked. Here is my code:
phi = var('phi')
a = .25
beta = 1
g = .2
ce = .5
alpha = .1
gamma = 2
V = .5
rho = .8
sigma = 4
sigmaeps = 1
K = 2
R = 2
K2 = 2
avginv = K+R+K2
Sinv = phi*avginv
Swinv = K2+R-Sinv
psinv = (-1+(1+4*rho^(-2)*sigma^(-2)*K)^(1/2))/(2*rho^(-2)*sigma^(-2))
phipriv = K/avginv
phipub = Swinv/avginv
prob = a-a*e^(-Swinv)
kappa = gamma*prob*(1-prob)*g^2
N = beta^(-1)*(1+alpha)*phi - beta^(-1)*alpha
L = beta^(-2)*(V+(1-phipriv)*avginv^(-1)+sigmaeps - 2*sigmaeps*phi + rho^2*sigma^2*psinv^(-2)*phipriv^2)
q = (beta*ce^(-1)-alpha*kappa^(-1)*N)*(gamma*L + ce^(-1)+kappa^(-1)*N^2)
y = q*N
phi1 = alpha/(1-alpha)
eq = beta*ce^(-1)-alpha*kappa^(-1)*N == 0
phi2 = solve(eq,phi)
print phi2
I get
[
phi == -1/11*e^(12*phi - 8) - 2/11*e^(6*phi - 4) + 4/11
]
Can someone help? And how can I ask for a solution on $[0,1]$?JorgeSun, 03 Aug 2014 06:39:57 +0200https://ask.sagemath.org/question/23677/Solve non linear symbolic equationhttps://ask.sagemath.org/question/8734/solve-non-linear-symbolic-equation/Hi,
I want to solve a an expression (quiet long one involving trigonometric functions) which has a lot of symbolic parameters (8 to be exact) for x. It takes a lot of time (I didn't get an output after 45 mins). Is there any way for me to speed up things. I am sure my way is inefficient.
RejeeshThu, 23 Feb 2012 06:09:06 +0100https://ask.sagemath.org/question/8734/