Pade Approximation

Takuichi Hirano (Tokyo Institute of Technology), November 5, 2008.
Mathematica 6

関数

f[x_]:=(1/(((x-1))^2))

g1=Plot[f[x],{x,0,2}]

離散化

n=20

xsamp=Table[0+(2-0)*Random[],{i,1,n}]

ylis=f[xsamp]

fdisc=Table[{xsamp[[i]],ylis[[i]]},{i,1,Length[xsamp]}]

g2=ListPlot[fdisc,PlotStyle->{Red,PointSize[Large]}];
Show[g1,g2,PlotRange->All]

Pade近似
μ: 分子次数
ν: 分母次数

ν=2;
μ=n-ν-1;
q[0]=1;

sol=Solve[
Table[Sum[p[j]*(x^j),{j,0,μ}]-ylis[[i]]*Sum[q[j]*(x^j),{j,0,ν}]==0 /. {x->xsamp[[i]]},{i,1,n}]
,Join[Table[p[j],{j,0,μ}],Table[q[j],{j,1,ν}]]]

g[x_]:=((Sum[p[j]*(x^j),{j,0,μ}])/(Sum[q[j]*(x^j),{j,0,ν}])) /. sol[[1]]

g3=Plot[{f[x],g[x]},{x,-1,2}];
Show[g3,g2,PlotRange->All]