Mathematik für Ingenieure II, 3. Juli 2009

Fourierreihe der Rechteckwelle und der Sägenfunktion

>    Periodisch:=proc(g) x->g(2*Pi*(x/(2*Pi)-floor(x/(2*Pi)))); end;

Periodisch := proc (g) x -> g(2*Pi*(1/2*x/Pi-floor(1/2*x/Pi))) end proc

>    id:=x->x;

id := x -> x

>    fb:=x->piecewise(x<=Pi,1,-1);

fb := x -> piecewise(x <= Pi,1,-1)

>    f:=Periodisch(fb);

f := x -> fb(2*Pi*(1/2*x/Pi-floor(1/2*x/Pi)))

>    plot(f,-4*Pi..4*Pi,scaling=constrained);

[Maple Plot]

>    NullShift:=x->piecewise(x<=Pi,x,x-2*Pi);

NullShift := x -> piecewise(x <= Pi,x,x-2*Pi)

>    Periodischz:=proc(g) global Periodisch; Periodisch(g@NullShift); end;

Periodischz := proc (g) global Periodisch; Periodisch(`@`(g,NullShift)) end proc

>    S:=Periodischz(id);

S := x -> (`@`(id,NullShift))(2*Pi*(1/2*x/Pi-floor(1/2*x/Pi)))

>    plot(S,-4*Pi..4*Pi,scaling=constrained);

[Maple Plot]

>    n:='n';int(sin(n*x),x=0..Pi) assuming n::integer;

n := 'n'

-(-1+(-1)^n)/n

>    b:=unapply(2*%/Pi,n);

b := n -> -2*(-1+(-1)^n)/n/Pi

>    F:=Sum(b(k)*sin(k*x),k=1..n);

F := Sum(-2*(-1+(-1)^k)/k/Pi*sin(k*x),k = 1 .. n)

>    n:=5;plot(F,x=0..2*Pi);

n := 5

[Maple Plot]

>    n:=10;plot(F,x=0..2*Pi);

n := 10

[Maple Plot]

>    n:=20;plot(F,x=0..2*Pi);

n := 20

[Maple Plot]

>    n:=50;plot(F,x=0..2*Pi);

n := 50

[Maple Plot]

Die Wellengleichung, Beispiel 1

>    plot(x*sin(x),x=0..Pi);

[Maple Plot]

>    n:='n';N:='N';uN:=Pi*sin(x)*sin(t)/2-(8/Pi)*Sum(sin(2*n*x)*sin(2*n*t)/(4*n^2-1)^2,n=1..N);

n := 'n'

N := 'N'

uN := 1/2*Pi*sin(x)*sin(t)-8/Pi*Sum(sin(2*n*x)*sin(2*n*t)/(4*n^2-1)^2,n = 1 .. N)

>    N:=20;with(plots):animate(plot, [uN, x=0..Pi], t=0..2*Pi, frames=100);

N := 20

[Maple Plot]

>    plot3d(uN, x=0..Pi,t=0..2*Pi,axes=framed);

[Maple Plot]

Die Wellengleichung, Beispiel 2

>    p:=a*x^4+b*x^3+c*x^2+d*x+e;

p := a*x^4+b*x^3+c*x^2+d*x+e

>    solve({eval(p,x=0)=1,eval(p,x=-1)=0,eval(p,x=1)=0,eval(diff(p,x),x=-1)=0,eval(diff(p,x),x=1)=0},{a,b,c,d,e});

{d = 0, b = 0, a = 1, c = -2, e = 1}

>    eval(p,%);

x^4+1-2*x^2

>    pp:=unapply(%,x);

pp := x -> x^4+1-2*x^2

>    q:=x->piecewise(x<=-1,0,x<=1,pp(x),0);

q := x -> piecewise(x <= -1,0,x <= 1,pp(x),0)

>    q(x);

PIECEWISE([0, x <= -1],[x^4+1-2*x^2, x <= 1],[0, otherwise])

>    plot(q,-2..2);

[Maple Plot]

>    phi:=x->-q(4*(x-Pi/2)/Pi);

phi := x -> -q(4*(x-1/2*Pi)/Pi)

>    plot(phi,0..Pi);

[Maple Plot]

>    2*int(phi(x)*sin(n*x),x=0..Pi)/Pi;

256*(-48*cos(1/4*Pi*n)+12*n*sin(1/4*Pi*n)*Pi+n^2*cos(1/4*Pi*n)*Pi^2+48*cos(3/4*Pi*n)+12*n*sin(3/4*Pi*n)*Pi-n^2*cos(3/4*Pi*n)*Pi^2)/Pi^5/n^5

>    simplify(%) assuming n::integer;

-256*(48*cos(1/4*Pi*n)-12*n*sin(1/4*Pi*n)*Pi-n^2*cos(1/4*Pi*n)*Pi^2-48*cos(3/4*Pi*n)-12*n*sin(3/4*Pi*n)*Pi+n^2*cos(3/4*Pi*n)*Pi^2)/Pi^5/n^5

>    b:=unapply(%,n);

b := n -> -256*(48*cos(1/4*Pi*n)-12*n*sin(1/4*Pi*n)*Pi-n^2*cos(1/4*Pi*n)*Pi^2-48*cos(3/4*Pi*n)-12*n*sin(3/4*Pi*n)*Pi+n^2*cos(3/4*Pi*n)*Pi^2)/Pi^5/n^5

>    u:=sin(n*x)*(B*sin(n*t)+A*cos(n*t));

u := sin(n*x)*(B*sin(n*t)+A*cos(n*t))

>    N:='N';uN:=Sum(subs({A=b(n),B=0},u),n=1..N);

N := 'N'

uN := Sum(-256*sin(n*x)*(48*cos(1/4*Pi*n)-12*n*sin(1/4*Pi*n)*Pi-n^2*cos(1/4*Pi*n)*Pi^2-48*cos(3/4*Pi*n)-12*n*sin(3/4*Pi*n)*Pi+n^2*cos(3/4*Pi*n)*Pi^2)/Pi^5/n^5*cos(n*t),n = 1 .. N)
uN := Sum(-256*sin(n*x)*(48*cos(1/4*Pi*n)-12*n*sin(1/4*Pi*n)*Pi-n^2*cos(1/4*Pi*n)*Pi^2-48*cos(3/4*Pi*n)-12*n*sin(3/4*Pi*n)*Pi+n^2*cos(3/4*Pi*n)*Pi^2)/Pi^5/n^5*cos(n*t),n = 1 .. N)

>    with(plots):N:=20:animate(plot, [uN, x=0..Pi], t=0..4*Pi, frames=100);

[Maple Plot]

>    plot3d(uN,x=0..Pi,t=0..2*Pi,axes=framed);

[Maple Plot]

Die Wellengleichung, Beispiel 3

>    N:='N';psi:=x->x*sin(x)+q(8*(x-3*Pi/4)/Pi);

N := 'N'

psi := x -> x*sin(x)+q(8*(x-3/4*Pi)/Pi)

>    plot(psi, 0..Pi);

[Maple Plot]

>    2*int(psi(x)*sin(n*x),x=0..Pi)/(n*Pi) assuming n::integer;

2*(-1/8*(5*n^3*Pi*cos(5/8*Pi*n)*sin(3/8*Pi)+5*n^2*Pi*sin(5/8*Pi*n)*cos(3/8*Pi)-8*n^2*sin(5/8*Pi*n)*sin(3/8*Pi)+16*n-5*Pi*n*cos(5/8*Pi*n)*sin(3/8*Pi)+16*n*cos(5/8*Pi*n)*cos(3/8*Pi)-8*sin(5/8*Pi*n)*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::integer;

-4/(n^4-2*n^2+1)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+6144*n^5*si...
-4/(n^4-2*n^2+1)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+6144*n^5*si...
-4/(n^4-2*n^2+1)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+6144*n^5*si...
-4/(n^4-2*n^2+1)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+6144*n^5*si...

>    cc:=unapply(%,n);

cc := n -> -4/(n^4+1-2*n^2)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+...
cc := n -> -4/(n^4+1-2*n^2)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+...
cc := n -> -4/(n^4+1-2*n^2)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+...
cc := n -> -4/(n^4+1-2*n^2)*(Pi^4*n^6+98304*n^2*cos(5/8*Pi*n)-49152*n^4*cos(5/8*Pi*n)-98304*n^2*cos(7/8*Pi*n)+49152*n^4*cos(7/8*Pi*n)-49152*cos(5/8*Pi*n)+49152*cos(7/8*Pi*n)+256*n^2*cos(5/8*Pi*n)*Pi^2+...

>    2*int(psi(x)*sin(x),x=0..Pi)/Pi;

2*(5/32*Pi^2+1/4-1/8*Pi*cos(3/8*Pi)*sin(3/8*Pi)-1/2*cos(3/8*Pi)^2+1/32*(-393216*cos(1/8*Pi)*Pi-3145728*sin(1/8*Pi)-16*Pi^4*cos(1/8*Pi)^2+4*Pi^5*sin(1/8*Pi)*cos(1/8*Pi)+3*Pi^6+16384*sin(1/8*Pi)*Pi^2-393...
2*(5/32*Pi^2+1/4-1/8*Pi*cos(3/8*Pi)*sin(3/8*Pi)-1/2*cos(3/8*Pi)^2+1/32*(-393216*cos(1/8*Pi)*Pi-3145728*sin(1/8*Pi)-16*Pi^4*cos(1/8*Pi)^2+4*Pi^5*sin(1/8*Pi)*cos(1/8*Pi)+3*Pi^6+16384*sin(1/8*Pi)*Pi^2-393...

>    simplify(%);

1/4*(2*Pi^6+4*Pi^4-Pi^5*cos(3/8*Pi)*sin(3/8*Pi)-4*cos(3/8*Pi)^2*Pi^4-98304*cos(1/8*Pi)*Pi-786432*sin(1/8*Pi)-4*Pi^4*cos(1/8*Pi)^2+Pi^5*sin(1/8*Pi)*cos(1/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Pi)^2+Pi^5*sin(1/8*Pi)*cos(1/8*Pi)+4096*sin(1/...

>    N:=20;animate(plot, [uN, x=0..Pi], t=0..4*Pi, frames=100);

N := 20

[Maple Plot]

>    plot3d(uN, x=0..Pi, t=0..2*Pi, axes=framed);

[Maple Plot]

>