m10.mws

4.5.5   Sturm-Liouville Problem for equation :    X''- mu X=0,   case 2)    -X'(0)+HX(0)=0,  X(L)=0    (Robin-Dirichlet)

>    restart;

>    L:=2;H:=3;

L := 2

H := 3

Characteristic equation:

>    w(x):=x*cos(x*L)+H*sin(x*L);

w(x) := x*cos(2*x)+3*sin(2*x)

>    plot(w(x),x=0..20);

[Maple Plot]

Eigenvalues:

>    lambda:=array(1..100);

lambda := array(1 .. 100,[])

>    n:=1: for m from 1 to 100 do z:=fsolve(w(x)=0,x=m*1..(m+1)*1): if type(z,float) then lambda[n]:=z: n:=n+1 fi od:

>    for i to n-1 do lambda[i] od;

1.358229874

2.768911636

4.235147453

5.738636645

7.264403196

8.803594038

10.35122220

11.90440606

13.46140677

15.02112763

16.58284846

18.14607924

19.71047613

21.27579132

22.84184197

24.40849042

25.97563111

27.54318182

29.11107757

30.67926638

32.24770614

33.81636243

35.38520682

36.95421563

38.52336898

40.09265008

41.66204462

43.23154034

44.80112671

46.37079457

47.94053598

49.51034400

51.08021251

52.65013613

54.22011011

55.79013021

57.36019266

58.93029410

60.50043150

62.07060215

63.64080358

65.21103360

66.78129018

68.35157150

69.92187591

71.49220188

73.06254802

74.63291308

76.20329588

77.77369535

79.34411050

80.91454042

82.48498427

84.05544128

85.62591071

87.19639190

88.76688423

90.33738711

91.90790001

93.47842242

95.04895388

96.61949393

98.19004217

99.76059822

>    N:=n-1;

N := 64

>    n:='n':i:='i':

Eigenfunctions:

>    X[n]:=sin(lambda[n]*(x-L));

X[n] := sin(lambda[n]*(x-2))

Squared norm:

>    NX[n]:=int(X[n]^2,x=0..L);

NX[n] := -1/2*(cos(2*lambda[n])*sin(2*lambda[n])-2*lambda[n])/lambda[n]

GENERALIZED FOURIER SERIES

Function:

>    f(x):=exp(x/2);

f(x) := exp(1/2*x)

Fourier coefficients:

>    a[n]:=int(f(x)*X[n],x=0..L)/NX[n];

a[n] := 4*(2*exp(1)*lambda[n]-2*lambda[n]*cos(2*lambda[n])-sin(2*lambda[n]))/(1+4*lambda[n]^2)/(cos(2*lambda[n])*sin(2*lambda[n])-2*lambda[n])*lambda[n]

Generalized Fourier series:

>    u(x):=sum(a[n]*X[n],n=1..5):

>    plot({f(x),u(x)},x=0..L,axes=boxed);

[Maple Plot]

>    u(x):=sum(a[n]*X[n],n=1..20):

>    plot({f(x),u(x)},x=0..L,axes=boxed);

[Maple Plot]

>    u(x):=sum(a[n]*X[n],n=1..N):

>    plot({f(x),u(x)},x=0..L,axes=boxed);

[Maple Plot]

>   

>   

>   

>   

>   

>   

>   

>   

>   

>