简体   繁体   中英

Sympy unable to solve Equation

SYmpy worked for various aspects before, but I am surprised if there is a solution for this or not. I left it to run over the night and Python did not give me a solution yet. Is there a way to speed up this process or, what am I missing here.

from sympy import *
import numpy as np
import math

rho_l = 1352;
rho_g= 1.225;
sigma = 0.029;
nu = 0.02;
Q = rho_g/ rho_l;
u = 99.67;
h = 1.6e-5; # Half sheet thickness

# Actual Dispersion Equation for viscous sheets
k = Symbol('k', real=True)
t = tanh(k*h);
w1 = -2 * nu * k**2 * t ;
w2 = 4* nu**2 * k**4 * t**2;
w3 = - Q**2 * u**2 * k**2;
w4 = -(t + Q)
w5 = (- Q* u**2 * k**2  +  (sigma*k**3/ rho_l));
w6 = -w4;

w = ( w1 + sqrt(w2 + w3 + w4*w5))/w6;

print (w)
wprime = w.diff(k)
print (wprime)

ko = solve(wprime, k) # solve fprime = 0 with respect to x
ko = ko[0]
print (ko)

Try nsolve for such situations:

>>> nsolve(wprime, 400)
416.221161431339

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM