Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Epsilon] = 10^-6;
- solw = NDSolve[{w''[t] + (w[t] + w[t]^2) w'[t] == 1/2 (1 + Tanh[100 t]), w[0] == 0,
- w'[0] == 0}, w, {t, 0, 2 [Pi]}, Method -> "MethodOfLines"];
- wsol[t_] := Evaluate[w[t] /. solw]
- solG[s2_] :=
- NDSolve[{G''[t] + (G[t] + G[t]^2) G'[t] == s2 1/(Sqrt[[Pi]] [Epsilon]) Exp[-(t/[Epsilon])^2], G[0] == 0,
- G'[0] == 0}, G, {t, 0, 2 [Pi]}, Method -> "MethodOfLines"]
- Gsol[t_] := Evaluate[G[t] /. sol[s2]]
- approx[t_] :=
- s1 NIntegrate[Gsol[t - [Tau]] 1/2 (1 + Tanh[100 [Tau]]), {[Tau], 0, t},
- Method -> "DoubleExponential"]
- tab = Table[Abs[wsol[t] - Gsol[t]], {t, 0, 1, 0.01}];
- NMinimize[Max[tab], s1, s2]
Add Comment
Please, Sign In to add comment