楼主:
Frobenius (▽.(▽×▽φ)=0)
2014-04-24 20:43:22※ 引述《sweetycool (tina)》之铭言:
: http://ppt.cc/QKcl
: 想问一下这样的分段周期函数,可以用mathmatica算出来吗?
: 谢谢
Clear[f, a0, an, bn]
f[t_] = UnitStep[t] - UnitStep[t - 1];
a0 = f[0]
an = FourierCosCoefficient[f[t], t, n,
FourierParameters -> {-1, \[Pi]}]
bn = FourierSinCoefficient[f[t], t, n,
FourierParameters -> {-1, \[Pi]}]
m = 11;
F[t_] = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(m\)]\(an\ Cos[
n\ \[Pi]\ t]\)\) + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(m\)]\(bn\ Sin[
n\ \[Pi]\ t]\)\)
Plot[{f[t], F[t]}, {t, -2, 3}, AspectRatio -> Automatic]