最好的方法解决非线性方程?

6视图(30天)
HVdB
HVdB 2022年11月26日
评论道: HVdB2022年11月28日
我有一组方程需要解决,第一个方程(不是所示)是一个通过pdepe PDE解决(),但对于下列方程的形式我不确定哪种方法来解决这个问题:
我已经尝试解决它象征性地通过解决()和dsolve(),但这并不工作,解决()返回一个空信谊和dsolve返回以下:
信谊a (t) c (x) d (x)
b = 2 * 10 ^ (7);
eqn = diff (t) = = - b * (diff (c、x) * diff ((d / c), x) + rho_a * diff ((d / c) 2 x));
索尔= dsolve (eqn);
错误使用mupadengine / feval_internal
没有发现微分方程。指定微分方程利用符号函数。
错误dsolve > mupadDsolve(第334行)
T = feval_internal (symengine symobj:: dsolve, sys, x,选项);
错误dsolve(第203行)
索尔= mupadDsolve (args,选项);
错误odetest(第6行)
索尔= dsolve (eqn);

答案(1)

约翰D 'Errico
约翰D 'Errico 2022年11月26日
编辑:约翰D 'Errico 2022年11月26日
dsolve不是用来解决PDE。它只适用于一个颂歌或常微分方程的一个系统。
帮助dsolve
DSOLVE象征性的常微分方程的解决方案。DSOLVE不会接受方程作为字符串在未来版本。使用符号表达式或符号对象。例如,使用对称y (t);dsolve (diff (y) = = y)而不是dsolve (Dy = y)。DSOLVE (eqn1 eqn2,…)接受符号方程代表常微分方程和初始条件。默认情况下,自变量是“t”。独立变量可能改变从“t”到其他一些符号变量,包括变量作为输入参数。DIFF函数构造衍生品的符号函数(见信谊/ symfun)。初始条件涉及衍生品必须使用一个中间变量。 For example, syms x(t) Dx = diff(x); dsolve(diff(Dx) == -x, Dx(0) == 1) If the number of initial conditions given is less than the number of dependent variables, the resulting solutions will obtain arbitrary constants, C1, C2, etc. Three different types of output are possible. For one equation and one output, the resulting solution is returned, with multiple solutions to a nonlinear equation in a symbolic vector. For several equations and an equal number of outputs, the results are sorted in lexicographic order and assigned to the outputs. For several equations and a single output, a structure containing the solutions is returned. If no closed-form (explicit) solution is found, then a warning is given and the empty sym is returned. DSOLVE(...,'IgnoreAnalyticConstraints',VAL) controls the level of mathematical rigor to use on the analytical constraints of the solution (branch cuts, division by zero, etc). The options for VAL are TRUE or FALSE. Specify FALSE to use the highest level of mathematical rigor in finding any solutions. The default is TRUE. DSOLVE(...,'MaxDegree',n) controls the maximum degree of polynomials for which explicit formulas will be used in SOLVE calls during the computation. n must be a positive integer smaller than 5. The default is 2. DSOLVE(...,'Implicit',true) returns the solution as a vector of equations, relating the dependent and the independent variable. This option is not allowed for systems of differential equations. DSOLVE(...,'ExpansionPoint',a) returns the solution as a series around the expansion point a. DSOLVE(...,'Order',n) returns the solution as a series with order n-1. Examples: % Example 1 syms x(t) a dsolve(diff(x) == -a*x) returns ans = C1/exp(a*t) % Example 2: changing the independent variable x = dsolve(diff(x) == -a*x, x(0) == 1, 's') returns x = 1/exp(a*s) syms x(s) a x = dsolve(diff(x) == -a*x, x(0) == 1) returns x = 1/exp(a*s) % Example 3: solving systems of ODEs syms f(t) g(t) S = dsolve(diff(f) == f + g, diff(g) == -f + g,f(0) == 1,g(0) == 2) returns a structure S with fields S.f = (i + 1/2)/exp(t*(i - 1)) - exp(t*(i + 1))*(i - 1/2) S.g = exp(t*(i + 1))*(i/2 + 1) - (i/2 - 1)/exp(t*(i - 1)) syms f(t) g(t) v = [f;g]; A = [1 1; -1 1]; S = dsolve(diff(v) == A*v, v(0) == [1;2]) returns a structure S with fields S.f = exp(t)*cos(t) + 2*exp(t)*sin(t) S.g = 2*exp(t)*cos(t) - exp(t)*sin(t) % Example 3: using options syms y(t) dsolve(sqrt(diff(y))==y) returns ans = 0 syms y(t) dsolve(sqrt(diff(y))==y, 'IgnoreAnalyticConstraints', false) warns Warning: The solutions are subject to the following conditions: (C67 + t)*(1/(C67 + t)^2)^(1/2) = -1 and returns ans = -1/(C67 + t) % Example 4: Higher order systems syms y(t) a Dy = diff(y); D2y = diff(y,2); dsolve(D2y == -a^2*y, y(0) == 1, Dy(pi/a) == 0) syms w(t) Dw = diff(w); D2w = diff(w,2); w = dsolve(diff(D2w) == -w, w(0)==1, Dw(0)==0, D2w(0)==0) See also SOLVE, SUBS, SYM/DIFF, odeToVectorfield. Documentation for dsolve doc dsolve
没有符号动力学MATLAB应用于PDE。对不起。在某些(比较罕见,通常是很简单的)情况下,可以找到一个解析解。例如,有时候,分离变量可以用来获得一个解决方案。
虽然,你要求解决PDE的最佳方式。这是通过使用PDEPE(你声称已经完成)或类似的工具。或者你可以编写自己的代码,使用各种PDE的数值解的方法。
5个评论
HVdB
HVdB 2022年11月28日
谢谢你!那听上去是个好方法!

登录置评。

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!