Einführung in Mathematica XIII

Pade-Approximation

© Jürgen Schnack, 2010/05/08

Fiktive Daten

Winkel=Table[1.0*n,{n,1,3}]
data=Table[{Winkel[[m]],Cot[Winkel[[m]]*Pi/180]},{m,1,Length[Winkel]}]

LP1=ListPlot[data,PlotStyle->{Hue[0],PointSize[0.02]},
PlotRange->{{0,4},{0,150}},
BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Koeffizienten des Polynoms

a=Table[0.0,{n,1,Length[data]}]

Werden im weitern berechnet.

Polynom nullten Grades

x0=data[[1,1]]
f0=data[[1,2]]
a[[1]]=f0;
P0[x_]=a[[1]];

PlotP0=Plot[P0[x],{x,0,4},
PlotStyle->{Black,Thick},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Show[LP1,PlotP0]

Polynom ersten Grades

x1=data[[2,1]]
f1=data[[2,2]]
f01=((f1-f0)/(x1-x0));
a[[2]]=f01;
P1[x_]=a[[1]]+a[[2]]*(x-x0);

PlotP1=Plot[P1[x],{x,0,4},
PlotStyle->{Green,Thick},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Show[LP1,PlotP1]

Polynom zweiten Grades

x2=data[[3,1]]
f2=data[[3,2]]
f12=((f2-f1)/(x2-x1));
f012=((f12-f01)/(x2-x0));
a[[3]]=f012;
P2[x_]=a[[1]]+a[[2]]*(x-x0)+a[[3]]*(x-x0)*(x-x1);

PlotP2=Plot[P2[x],{x,0,4},
PlotStyle->{Blue,Thick},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Show[LP1,PlotP2]

Und jetzt Pade

R0[x_]=f0;
R1[x_]=f1;
R2[x_]=f2;

R01[x_]=R1[x]+((R1[x]-R0[x] )/( ((x-x0)/(x-x1))*(1-((R1[x]-R0[x])/(R1[x]-0)))-1))
R12[x_]=R2[x]+((R2[x]-R1[x] )/( ((x-x1)/(x-x2))*(1-((R2[x]-R1[x])/(R2[x]-0)))-1))
R012[x_]=R12[x]+((R12[x]-R01[x] )/( ((x-x0)/(x-x2))*(1-((R12[x]-R01[x])/(R12[x]-R1[x])))-1))

PlotPade01=Plot[{R01[x]},{x,0,4},
PlotRange->{{0,4},{0,150}},
PlotStyle->{Red},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

PlotPade12=Plot[{R12[x]},{x,0,4},
PlotRange->{{0,4},{0,150}},
PlotStyle->{Green},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

PlotPade012=Plot[{R01[x],R12[x],R012[x]},{x,0,4},
PlotRange->{{0,4},{0,150}},
PlotStyle->{Red,Green,Blue},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Vergleich

Show[PlotPade012,PlotP2,LP1]

PlotCot=Plot[Cot[x*Pi/180],{x,0,4},
PlotRange->{{0,4},{0,150}},
PlotStyle->{Black,Thick},BaseStyle->{FontFamily->Helvetica,FontSize->18}]

Show[PlotPade012,PlotP2,PlotCot,LP1]