Zurück zum Inhaltsverzeichnis

Kapitel 18

Symbolisches Lösen von Differentialgleichungen

Ohne Anfangsbedingungen

> restart:

Formulierung mit dem D-Operator

> dsolve(D(y)(x) + y(x) = 1, y(x));

y(x) = 1+exp(-x)*_C1

oder mit diff

> dsolve( diff(y(x), x) + y(x) = 1, y(x));

y(x) = 1+exp(-x)*_C1

Mit Anfangsbedingung für die Funktion

> de := diff(y(x),x) * y(x) * (1+x^2) = x;

de := diff(y(x),x)*y(x)*(1+x^2) = x

> dsolve( { de, y(0)=0 }, y(x));

y(x) = sqrt(ln(1+x^2)), y(x) = -sqrt(ln(1+x^2))

Probe

> subs(%[1], de);

diff(sqrt(ln(1+x^2)),x)*sqrt(ln(1+x^2))*(1+x^2) = x...

> simplify(%);

x = x

>

Mit Anfangsbedingung für die Ableitung

> dsolve( { de, D(y)(1)=1 }, y(x));

y(x) = sqrt(ln(1+x^2)-ln(2)+1/4)

>

Implizite Lösung

> dsolve( (y(x)^2 - x)*D(y)(x) + x^2-y(x) = 0, y(x) ,implicit);

1/3*x^3-y(x)*x+1/3*y(x)^3+_C1 = 0

Explizite Lösung (default)

> dsolve( (y(x)^2 - x)*D(y)(x) + x^2-y(x)=0, y(x), explicit );

y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...
y(x) = 1/2*(-4*x^3-12*_C1+4*sqrt(-4*x^3+x^6+6*x^3*_...

>

>

Lösungsbasis und partikuläre Lösung

> de:=diff(y(x), x$4) + 5*diff(y(x),x$2) - 36*y(x)=sin(x);

de := diff(y(x),`$`(x,4))+5*diff(y(x),`$`(x,2))-36*...

>

> simplify(dsolve( de, y(x)));

y(x) = -1/40*sin(x)+_C1*sin(3*x)+_C2*cos(3*x)+_C3*e...

>

>

> simplify(dsolve( de, y(x), output=basis));

[[sin(3*x), cos(3*x), exp(-2*x), exp(2*x)], -1/40*s...

>

>

>

Lösungen weiterverwenden

Beispiel1: Freier Fall

> restart:

> sol:=dsolve({ m*D(D(z))(t) = -m*g, z(0)=10, D(z)(0)=0 }, z(t));

sol := z(t) = -1/2*g*t^2+10

Übernahme der Lösung mit assign(). (Nur einmal möglich: restart.)

> assign(sol);

>

> z(t);

-1/2*g*t^2+10

Es wird nur z(t) zugewiesen:

> z(x);

z(x)

>

Neue Funktion

> funcz:=unapply(rhs(sol), t);

funcz := proc (t) options operator, arrow; -1/2*g*t...

> funcz(x);

-1/2*g*x^2+10

>

Werte

> g:=9.81;

g := 9.81

> solve( funcz(t)=0, t);

-1.427843123, 1.427843123

> t0:=max(%);

t0 := 1.427843123

> #plot( {funcz(t), diff(funcz(t),t)}, t=0..t0);

>

Beispiel 2: Federpendel mit Dämpfung

> restart;

> m:=1: c:=1/3: k:=1:

> dsolve( {m*D(D(y))(t) + c*D(y)(t) + k*y(t)=0, y(0)=1, D(y)(0)=0}, y(t));

y(t) = 1/35*sqrt(35)*exp(-1/6*t)*sin(1/6*sqrt(35)*t...

> funcy:=rhs(%);

funcy := 1/35*sqrt(35)*exp(-1/6*t)*sin(1/6*sqrt(35)...

> plot(funcy, t=0..18);

[Maple Plot]

>

Platzhalter für Lösungen: DESol

Diese DGL ist nicht geschlossen lösbar (Fadenpendel):

> restart:

> dgl:=diff(x(t),t$2) = -g/l*sin(x(t));

dgl := diff(x(t),`$`(t,2)) = -g*sin(x(t))/l

>

dsolve({dgl, x(0)=0, D(x)(0)=v0}, x(t));

Warning, computation interrupted

>

Reihenentwicklung

> #Order:=10:

> reihe:=dsolve({dgl, x(0)=x0, D(x)(0)=v0}, x(t),series);

reihe := x(t) = series(x0+v0*t+(-1/2*g*sin(x0)/l)*t...
reihe := x(t) = series(x0+v0*t+(-1/2*g*sin(x0)/l)*t...

>

> dgsol:=DESol( dgl, x(t), {x(0)=x0, D(x)(0)=v0} );

dgsol := DESol({diff(x(t),`$`(t,2))+g*sin(x(t))/l},...

>

> intdg:=int(dgsol,t);

intdg := DESol({diff(w(t),`$`(t,3))+g*sin(diff(w(t)...

> diff(intdg,t,t,t)+g/l*sin(diff(intdg,t));

0

>

> intreihe:=int(rhs(reihe),t);

intreihe := series(x0*t+1/2*v0*t^2+(-1/6*g*sin(x0)/...
intreihe := series(x0*t+1/2*v0*t^2+(-1/6*g*sin(x0)/...
intreihe := series(x0*t+1/2*v0*t^2+(-1/6*g*sin(x0)/...

> diff(intreihe,t,t,t)+g/l*sin(diff(intreihe,t));

(series((-g*sin(x0)/l)+(-g*cos(x0)*v0/l)*t+1/10*g*(...
(series((-g*sin(x0)/l)+(-g*cos(x0)*v0/l)*t+1/10*g*(...
(series((-g*sin(x0)/l)+(-g*cos(x0)*v0/l)*t+1/10*g*(...
(series((-g*sin(x0)/l)+(-g*cos(x0)*v0/l)*t+1/10*g*(...

> fehler:=convert(%,polynom);

fehler := -g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*s...
fehler := -g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*s...
fehler := -g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*s...
fehler := -g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*s...

> collect(%,x0);

-g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*sin(x0)*g*c...
-g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*sin(x0)*g*c...
-g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*sin(x0)*g*c...
-g*sin(x0)/l-g*cos(x0)*v0*t/l+1/10*g*(5*sin(x0)*g*c...

>

> g,l,x0,v0:='g','l','x0','v0';

g, l, x0, v0 := 'g, l, x0, v0'

> g,l,x0,v0:=1,1,0.1,0;

g, l, x0, v0 := 1, 1, .1, 0

> fehler;

-.9983341665e-1+.4966733270e-1*t^2+sin(.1-.49916708...

> plot(fehler,t=-10..10);

[Maple Plot]

>

>

Systeme von Differentialgleichungen

Ein typisches System wie es z.B. beim Radioaktiven Zerfall vorkommt, zunächst allgemein formuliert:

> restart:

> sys:=D(x)(t)=a11*x(t)+a12*y(t),D(y)(t)=a21*x(t)+a22*y(t);

>

sys := D(x)(t) = a11*x(t)+a12*y(t), D(y)(t) = a21*x...

> dsolve( {sys}, {x(t), y(t)} );

{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...
{y(t) = 1/2*(-_C1*exp((1/2*a11+1/2*a22-1/2*sqrt(a11...

>

Mit spezieller Wahl der Koeffizienten und Anfangsbedingungen

> a11,a12,a21,a22:=-1,0,1,-0.4;

a11, a12, a21, a22 := -1, 0, 1, -.4

> sol:=dsolve( {sys, x(0)=1, y(0)=0}, {x(t), y(t)} );

sol := {x(t) = exp(-t), y(t) = -5/3*exp(-t)+5/3*exp...

> funcx:=subs(sol, x(t));

funcx := exp(-t)

> funcy:=subs(sol, y(t));

funcy := -5/3*exp(-t)+5/3*exp(-2/5*t)

> plot( [funcx, funcy], t=0..6);

[Maple Plot]

>

Oder im Phasendiagramm

> plot( [funcx, funcy, t=0..4]);

[Maple Plot]

>

Lösung durch Laplace-Transformation

Sprungantwort

> restart:

> alias(sigma=Heaviside):

> u:=sigma(t-1)- sigma(t-5):

> de:=diff(y(t), t) + y(t) = u:

> dsolve( {de}, y(t));

y(t) = sigma(t-1)-sigma(t-1)*exp(-t+1)-sigma(t-5)+s...

> dsolve( {de}, y(t), method=laplace);

y(t) = sigma(t-1)*(1-exp(-t+1))+(-1+exp(-t+5))*sigm...

>

> sol1 := rhs(%);

> simplify( subs(y(t)=sol1, de) );

sol1 := sigma(t-1)*(1-exp(-t+1))+(-1+exp(-t+5))*sig...

sigma(t-1)-sigma(t-5) = sigma(t-1)-sigma(t-5)

> lhs(%)-rhs(%);

0

> y(0):=0:

> plot( {u, sol1}, t=0..10);

[Maple Plot]

>

Näherungslösung durch Reihenentwicklung

> restart:

> Order:=10:

> de:=diff(y(x), x$2) + diff(y(x),x) + y(x) = x+sin(x);

de := diff(y(x),`$`(x,2))+diff(y(x),x)+y(x) = x+sin...

> sol1:=dsolve( {de, y(0)=0, D(y)(0)=0}, y(x), series);

sol1 := y(x) = series(1/3*x^3-1/12*x^4-1/120*x^5+1/...

> f1:=convert( rhs(sol1), polynom);

f1 := 1/3*x^3-1/12*x^4-1/120*x^5+1/240*x^6-1/5040*x...

> sol2:=dsolve( {de, y(0)=0, D(y)(0)=0}, y(x));

sol2 := y(x) = -1+x+2*exp(-1/2*x)*cos(1/2*sqrt(3)*x...

> f2:=rhs(sol2):

> plot( {f1,f2}, x=0..2*Pi, 0..8);

[Maple Plot]

>

Informationen zur Lösung

Mit infolevel die Lösungsmethoden anzeigen:

> restart:

> infolevel[dsolve]:=3:

> dsolve( 3*D(y)(x) + y(x)* (1 + (2*x-1)*y(x)^3) = 0, y(x));

Methods for first order ODEs:

Trying to isolate the derivative dy/dx...

Successful isolation of dy/dx

-> Trying classification methods

trying a quadrature

trying 1st order linear

trying Bernoulli

Bernoulli successful

y(x) = 1/((-2*x-1+exp(x)*_C1)^(1/3)), y(x) = -1/2*1...
y(x) = 1/((-2*x-1+exp(x)*_C1)^(1/3)), y(x) = -1/2*1...

>

>

>

Höhere Ordnung

> alias(y=y(x)):

> dsolve( diff(y, x$4) + 5*diff(y,x$2) - 36*y=0, y);

Methods for high order ODEs:

Trying to isolate the derivative d^4y/dx^4...

Successful isolation of d^4y/dx^4

-> Trying classification methods

trying a quadrature

trying high order exact linear fully integrable

trying linear constant coefficient

linear constant coefficient successful

y = _C1*exp(-2*x)+_C2*sin(3*x)+_C3*cos(3*x)+_C4*exp...

> infolevel[dsolve]:=1:

>

Numerische Lösung von Differentialgleichungen

Beispiel 1

Zum Vergleich die wird zunächst die symbolische Lösung bereitgestellt (gedämpfte Schwingung):

> restart:

> de:=m*diff( y(t), t$2) +c*diff(y(t),t)+k*y(t)=0;

de := m*diff(y(t),`$`(t,2))+c*diff(y(t),t)+k*y(t) =...

> sol1:=dsolve( {de, y(0)=1, D(y)(0)=0}, y(t) ):

> funcy1:=unapply(rhs(sol1),t):

> m:=1: c:=1: k:=1:

Numerische Auswertung

> evalf(funcy1(3));

-.1243547676+0.*I

>

Numerische Lösung

> funcy2:=dsolve( {de, y(0)=1, D(y)(0)=0}, y(t), numeric );

funcy2 := proc (rkf45_x) local i, rkf45_s, outpoint...

> funcy2(3);

[t = 3, y(t) = -.124354763489716635, diff(y(t),t) =...

> subs( funcy2(3), y(t));

-.124354763489716635

Wertetabelle

> seq( [ t=n*0.2, y=subs( funcy2(n*0.2), y(t)) ], n=0..10 ):

> array( [%] );

matrix([[t = 0., y = 1.], [t = .2, y = .98133075511...

> Digits;

10

> with(plots):

Warning, the name changecoords has been redefined

> odeplot( funcy2, [t,y(t)], 0..10);

[Maple Plot]

> plot( funcy1(x)-'subs(funcy2(x),y(t))',x=0..10);

[Maple Plot]

>

Beispiel 2

Proton im Magnetfeld

> restart: with(linalg): with(plots):

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name changecoords has been redefined

Daten

> m:= 1.6e-27: # Masse [kg]

> q:= 1.6e-19: # Ladung [Coulomb]

> bz:= 1: # Magnetfeld in z-Richtung [Tesla]

> r:= [x(t), y(t), z(t)]: # Ortsvektor

> v:= map(diff, r, t): # Geschwindigkeitsvektor

> a:= map(diff, v, t): # Beschleunigungsvektor

> b:= vector( [0,0,bz] ): # Feldvektor

> sys := evalm( m*a - q*crossprod(v,b));

sys := vector([.16e-26*diff(x(t),`$`(t,2))-.16e-18*...
sys := vector([.16e-26*diff(x(t),`$`(t,2))-.16e-18*...

> de:=seq( sys[i]=0, i=1..3);

de := .16e-26*diff(x(t),`$`(t,2))-.16e-18*diff(y(t)...
de := .16e-26*diff(x(t),`$`(t,2))-.16e-18*diff(y(t)...

>

Für glatte Kurven sollte die Rechengenauigkeit vor dem Aufruf von dsolve erhöht werden (insbesondere bei dem gewählten Beispiel mit hohen Zehnerpotenzen).

> Digits:=11:

> conditions:= x(0)=0, y(0)=0, z(0)=0, D(x)(0)=1e8, D(y)(0)=0, D(z)(0)=1e6:

Es gibt in Maple zwei Arten der Ausgabe der erzeugten Prozeduren:

procedurelist erzeugt eine Prozedur, die die Lösung als liste ausgibt (default):

> sol:=dsolve( {de, conditions}, convert(r,set), numeric);

sol := proc (rkf45_x) local i, rkf45_s, outpoint, r...

Mit den auskommentierten Befehlen wird die Prozedur angezeigt.

> #interface(verboseproc=3):

> #print(sol); interface(verboseproc=1):

> solp:=dsolve( {de, conditions}, convert(r,set), numeric,output=procedurelist);

solp := proc (rkf45_x) local i, rkf45_s, outpoint, ...

> solp(1e-8);

[t = .1e-7, x(t) = .841470984960688173, diff(x(t),t...
[t = .1e-7, x(t) = .841470984960688173, diff(x(t),t...
[t = .1e-7, x(t) = .841470984960688173, diff(x(t),t...

>

listprocedure erzeugt eine Liste von Prozeduren:

> soll:=dsolve( {de, conditions}, convert(r,set), numeric,output=listprocedure);

soll := [t = proc (t) option `Copyright (c) 1993 by...
soll := [t = proc (t) option `Copyright (c) 1993 by...
soll := [t = proc (t) option `Copyright (c) 1993 by...

> soll(1e-8);

[t(.1e-7) = .1e-7, x(t)(.1e-7) = .84147098496068817...
[t(.1e-7) = .1e-7, x(t)(.1e-7) = .84147098496068817...
[t(.1e-7) = .1e-7, x(t)(.1e-7) = .84147098496068817...
[t(.1e-7) = .1e-7, x(t)(.1e-7) = .84147098496068817...

>

Die Liste der Prozeduren in den Ortsvektor einsetzen:

> rs:=subs(soll, r);

rs := [proc (t) local rkf45_s, outpoint, r1, r2; gl...

> rs(1e-8); # Test

[.841470984960688173, -.459697694025368752, .100000...

>

Zeichnen

> spacecurve( [ 'rs[1](t)','rs[2](t)','rs[3](t)' ],

> t=0..3e-7,numpoints=500,axes=framed,color=black);

[Maple Plot]

>

Die Komponenten des Ortsvektors müssen unausgewertet übergeben werden:

> eval(rs[1](t),t=1e-7);

Error, (in rs[1]) cannot evaluate boolean: abs(t)-abs(-.299398796030000024e-6+t) < 0

>

>

Grafische Darstellung von Differentialgleichungen

odeplot

Numerische Lösungen mit odeplot darstellen

> restart: with(plots):

Warning, the name changecoords has been redefined

> sol:=dsolve( { diff(y(t),t)+3*y(t)=sin(t)^2, y(0)=0 }, y(t), numeric):

>

Mit der Option numpoints bekommt man glatte Kurven.

> odeplot( sol, [t, y(t)], 0..10,numpoints=500);

[Maple Plot]

>

System von Gifferentialgleichungen.

> sol:=dsolve(

> { diff(y(t),t)=x(t)+sin(t), diff(x(t),t)=-y(t), x(0)=0, y(0)=0 },

> { x(t), y(t) }, numeric);

sol := proc (rkf45_x) local i, rkf45_s, outpoint, r...

>

> odeplot( sol, [t, x(t)], 0..20,numpoints=500);

[Maple Plot]

> odeplot( sol, [t, y(t)], 0..20,numpoints=500);

[Maple Plot]

>

>

2D-Phasendiagramm

> odeplot( sol, [x(t), y(t)], 0..20,

> view=[-10..10, -10..10],

> numpoints=500,

> scaling=constrained);

[Maple Plot]

3D-Phasendiagramm

> odeplot( sol, [t, x(t), y(t)], 0..20, shading=none, axes=boxed, numpoints=500);

[Maple Plot]

>

DEtools

Richtungsfelder mit dfieldplot

> restart: with(DEtools):

> dfieldplot( diff(y(t),t)=sin(y(t)), [y(t)], t=-1..5, y=-1..4);

[Maple Plot]

> dfieldplot( [diff(x(t),t)=sin(x(t))+y(t), diff(y(t),t)=sin(y(t))-x(t)],
[x(t),y(t)], t=0..1, x=-1..1, y=-1..1);

[Maple Plot]

Richtungsfelder und Lösungskurven zu gegebenen Anfangsbedingungen mit phaseportrait:

> phaseportrait( diff(y(t),t)=sin(y(t)), [y(t)],
t=-1..10, [[y(4)=1], [y(4)=2], [y(4)=-1], [y(4)=-2]],linecolor=black);

[Maple Plot]

>

Ohne Richtungsfeld

> start:=seq( [0,0,n*0.1], n=0..10);

start := [0, 0, 0.], [0, 0, .1], [0, 0, .2], [0, 0,...
start := [0, 0, 0.], [0, 0, .1], [0, 0, .2], [0, 0,...

> phaseportrait( [diff(x(t),t)=sin(x(t))+y(t), diff(y(t),t)=sin(y(t))-x(t)],

> [x(t),y(t)], t=0..10, {start}, stepsize=0.1, arrows=NONE, linecolor=black);

[Maple Plot]

>

Richtungsfeld mit DEplot

> alias(x=x(t), y=y(t)):

> DEplot( diff(x,t)=1+x-x^2, [x], t=0..3,

> {seq([0,n/2], n=-3..5)}, x=-1..3,

> dirgrid=[10,10], arrows=LARGE);

[Maple Plot]

>

Gleichungssystem

> DEplot( [diff(x,t)=-y, diff(y,t)=x-y], [x,y], -1..1, { [0,0,1] },linecolor=black );

[Maple Plot]

>

3D-Phasendiagramm

> DEplot3d( [diff(x,t)=sin(y)-x/10, diff(y,t)=x], [x,y], 0..40, {[0,1,1]},

> stepsize=0.1, linecolor=black );

[Maple Plot]

> alias(x=x,y=y):

> de := diff(y(x), x$4) + diff(y(x), x) = sin(x);

de := diff(y(x),`$`(x,4))+diff(y(x),x) = sin(x)

>

Schar von Lösungskurven

> DEplot(de, [y(x)], x=0..2,
[seq( [ y(1)=1, D(y)(1)=-1, (D@@2)(y)(1)=1, (D@@3)(y)(1)=n ], n=-5..5)],
linecolor=black );

[Maple Plot]

>

Partielle Differentialgleichungen

Erster Ordnung

> restart:
alias(f=f(x,y)):

x*f[x]+y*f[y] = f

> pde:= x*diff(f,x) + y*diff(f,y)=f;

pde := x*diff(f,x)+y*diff(f,y) = f

> sol:= pdsolve( pde, f);

sol := f = _F1(y/x)*x

> subs(sol, pde);

x*diff(_F1(y/x)*x,x)+y*diff(_F1(y/x)*x,y) = _F1(y/x...

> simplify(lhs(%)-rhs(%));

0

>

f[x]+f[y] = 2*(x+y)*f

> pde:=diff(f,x)+diff(f,y)=2*(x+y)*f;

pde := diff(f,x)+diff(f,y) = 2*(x+y)*f

> sol:= pdsolve( pde, f);

sol := f = _F1(y-x)*exp(x^2)^2*exp((y-x)*x)^2

> subs(sol, pde);

diff(_F1(y-x)*exp(x^2)^2*exp((y-x)*x)^2,x)+diff(_F1...
diff(_F1(y-x)*exp(x^2)^2*exp((y-x)*x)^2,x)+diff(_F1...

> simplify(lhs(%)-rhs(%));

0

>

x^4*f[x]^2+y^2*f[x]^2 = f

Mit RootOf

> pde:=x^4*diff(f,x)^2 + y^2*diff(f,x)^2=f;

pde := x^4*diff(f,x)^2+y^2*diff(f,x)^2 = f

> sol:=pdsolve( pde, f);

sol := f = RootOf(2*sqrt(_Z)+Int(sqrt(_Z*x^4+_Z*y^2...

> subs(sol, pde);

x^4*diff(RootOf(2*sqrt(_Z)+Int(sqrt(_Z*x^4+_Z*y^2)/...
x^4*diff(RootOf(2*sqrt(_Z)+Int(sqrt(_Z*x^4+_Z*y^2)/...
x^4*diff(RootOf(2*sqrt(_Z)+Int(sqrt(_Z*x^4+_Z*y^2)/...

> simplify(lhs(%)-rhs(%));

0

>

Zweiter Ordnung

> restart:
alias(u=u(t,x)):

Wellengleichung u[tt] = a^2*u[xx]

> pde:=diff(u,t$2)=a^2*diff(u,x$2);

pde := diff(u,`$`(t,2)) = a^2*diff(u,`$`(x,2))

> sol:=pdsolve(pde,u);

sol := u = _F1(x+a*t)+_F2(x-a*t)

> subs(sol,pde): simplify(lhs(%)-rhs(%));

0

> pde:=diff(u,t$2)=a^2*diff(u,x$2)+sin(t);

pde := diff(u,`$`(t,2)) = a^2*diff(u,`$`(x,2))+sin(...

> sol:=pdsolve(pde,u);

sol := u = _F1(x+a*t)+_F2(x-a*t)-sin(t)

> subs(sol,pde): simplify(lhs(%)-rhs(%));

0

>

Wärmeleitung u[xx]-u[t] = 0 :

> pde:=diff(u,x$2)-diff(u,t)=0;

pde := diff(u,`$`(x,2))-diff(u,t) = 0

Nur ein Vorschlag

> sol:=pdsolve(pde,u);

sol := `&where`(u = _F1(t)*_F2(x),[{diff(_F1(t),t) ...

Vergleiche Worksheet zu Integraltransformationen.

>

> restart:
alias(u=u(t,x,y)):

2D Wellengleichung u[tt] = a^2*(u[xx]+u[yy])

> pde:=diff(u,t$2) = a^2 * (diff(u,x$2)+diff(u,y$2));

pde := diff(u,`$`(t,2)) = a^2*(diff(u,`$`(x,2))+dif...

> sol:=pdsolve(pde,u);

sol := `&where`(u = _F1(t)*_F2(x)*_F3(y),[{diff(_F2...
sol := `&where`(u = _F1(t)*_F2(x)*_F3(y),[{diff(_F2...

>

Laplace Gleichung u[xx]+u[yy] = 0 : ok

> pde:=diff(u,x$2)+diff(u,y$2)=0;

pde := diff(u,`$`(x,2))+diff(u,`$`(y,2)) = 0

> pdsolve(pde, u);

u = _F1(t,y+I*x)+_F2(t,y-I*x)

>

Höhere Ordnung

f[y]+f*f[x]+f[xxx] = 0

> restart:

> alias(f=f(x,y));

f

Keine Lösung

> #infolevel[all]:=0:

> #infolevel[all]:=9: # Vorsicht: langer Ausdruck
pdsolve( diff(f,y) + f*diff(f,x)+diff(f,x$3)=0, f );

>

>

>

Partielle DGln, grafische Darstellung

Aus dem reichhaltigen Angebot von PDEplot ein paar Beispiele

> restart: with(PDEtools);

[PDEplot, build, casesplit, charstrip, dchange, dco...
[PDEplot, build, casesplit, charstrip, dchange, dco...

>

> pd:=2*diff(z(x,y),x)-z(x,y)*diff(z(x,y),y)=1/10;

pd := 2*diff(z(x,y),x)-z(x,y)*diff(z(x,y),y) = 1/10...

Parameterdarstellung [cos(s),sin(s),s]

> PDEplot( pd , z(x,y),[cos(s),sin(s),s], [s=-6..6], axes=framed,lightmodel='light4',numchar=60,color=yellow,orientation=[50,80],x=-4..4,y=-4..4);

[Maple Plot]

>

Mit Charakteristiken (basechar=true)

> PDEplot( pd, z(x,y),[cos(s),sin(s),s], [s=-12..12], axes=framed,lightmodel='light4',color=yellow,numchar=60,orientation=[8,60],numsteps=[-20,40], stepsize=0.05,basechar=true);

>

Animation

> PDEplot( pd, z(x,y),[cos(s),sin(s),s],[s=-12..12],axes=framed,lightmodel='light4',color=yellow,numchar=60,orientation=[40,85],animate=true);

>

>

>

Zurück zum Inhaltsverzeichnis