繁体   English   中英

数值解决python或Matlab中的超越方程

[英]Numeric solve transcendental equation in python or Matlab

我有一个Euler-Bernoulli方程我试图解决其中:

q(x) = a*x + b + w(x)

Euler-Bernoulli方程:

E * I * diff(w(x), x, x, x, x) = q(x) 

我真的不知道这是否是超验,但我有E,I,a,b并且也知道我的积分限制(0到H)。 我有E,I,a,b和H的数字。

如何从0到H获得w(x),x变化x的点?

如果你想象征性地解决它,你可以,例如同情

from __future__ import division
from sympy import *
x = symbols('x')
w = symbols('w', cls=Function)
a,b,E,J =  symbols('a b E J')
equ = E*J*diff(w(x),x,4) - a*x -b - w(x)
dsolve(equ, w(x))
# This generates a function that is too generic and too big to copy-paste
# Let's make some assumptions
J = Symbol('J', real=True, positive=True)
E = Symbol('E', real=True, positive=True)
equ = E*J*diff(w(x),x,4) - a*x -b - w(x)
dsolve(equ, w(x))

这导致:

               -x                 x                                                           
           ───────────       ───────────                                                      
           4 ___ 4 ___       4 ___ 4 ___                                                      
           ╲╱ E ⋅╲╱ J        ╲╱ E ⋅╲╱ J          ⎛     x     ⎞         ⎛     x     ⎞          
w(x) = C₁⋅ℯ            + C₂⋅ℯ            + C₃⋅sin⎜───────────⎟ + C₄⋅cos⎜───────────⎟ - a⋅x - b
                                                 ⎜4 ___ 4 ___⎟         ⎜4 ___ 4 ___⎟          
                                                 ⎝╲╱ E ⋅╲╱ J ⎠         ⎝╲╱ E ⋅╲╱ J ⎠          

鉴于有关边界条件的额外信息,您甚至可以进一步简化。 在任何情况下你都需要它们,因为你仍然有4个未知系数。

让我在Matlab中使用Symbolic工具箱添加一个解决方案:

syms q x w(x) a b E I
q = a*x+b+w(x);
sol = dsolve(E*I*diff(diff(diff(diff(w)))) == q)
sol_part = subs(sol,[E I],[2e5 100]) % etc.

您可以将边界条件作为单独的公式添加到dsolve命令,从而形成方程组。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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