I'm trying to numerically solve this kind of differential equation:
NDSolve[{x''[t] == f[x[t]], x[0] == 0, x'[0] == 1}, x, {t, 0, 1}]
where f[x[t]] is defined as gaussian with a time dependent amplitude
Amp[t_] := Piecewise[{{-500 t + 5, t <= 0.01}, {0.001, t > 0.01}}]
f[x_[t_]] := Amp[t] E^(-((x - \[Mu])^2/(2 \[Sigma]^2))) /. {\[Mu] ->
0, \[Sigma] -> 0.01}
but Mathematica gives me the error
NDSolve::dvnoarg: The function x appears with no arguments. >>
What is wrong?
f[x_] = Amp[t] E^(-((x - \[Mu])^2/(2 \[Sigma]^2))) /. {\[Mu] -> 0, \[Sigma] -> 0.01}. – b.gatessucks Jan 4 at 14:29