Guest User

Untitled

a guest
Mar 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. [Epsilon] = 10^-6;
  2.  
  3. solw = NDSolve[{w''[t] + (w[t] + w[t]^2) w'[t] == 1/2 (1 + Tanh[100 t]), w[0] == 0,
  4. w'[0] == 0}, w, {t, 0, 2 [Pi]}, Method -> "MethodOfLines"];
  5. wsol[t_] := Evaluate[w[t] /. solw]
  6.  
  7. solG[s2_] :=
  8. NDSolve[{G''[t] + (G[t] + G[t]^2) G'[t] == s2 1/(Sqrt[[Pi]] [Epsilon]) Exp[-(t/[Epsilon])^2], G[0] == 0,
  9. G'[0] == 0}, G, {t, 0, 2 [Pi]}, Method -> "MethodOfLines"]
  10. Gsol[t_] := Evaluate[G[t] /. sol[s2]]
  11. approx[t_] :=
  12. s1 NIntegrate[Gsol[t - [Tau]] 1/2 (1 + Tanh[100 [Tau]]), {[Tau], 0, t},
  13. Method -> "DoubleExponential"]
  14.  
  15. tab = Table[Abs[wsol[t] - Gsol[t]], {t, 0, 1, 0.01}];
  16. NMinimize[Max[tab], s1, s2]
Add Comment
Please, Sign In to add comment