Advertisement
AdrianMadajewski

Untitled

Mar 23rd, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. Clear[x]
  2. indeks = 145406
  3. f = 1
  4. \[Omega]0 = indeks + 1
  5. b = 1/4 * \[Omega]0
  6. \[Omega]1 =(\[Omega]0 ^2 - 1/2 * b^2)^(1/2)
  7. \[Omega]2 = 3/4 * (\[Omega]0^2 - 1/2 * b^2)^(1/2)
  8. \[Omega]3 = 5/4 * (\[Omega]0^2 - 1/2 * b^2)^(1/2)
  9. s[\[Omega]_] := NDSolve[{x''[t] + b x'[t] + \[Omega]0^2 x[t] == f Sin[\[Omega] t], x[0] == 0, x'[0] == 0}, x[t], {t, 0, 2*Pi/ \[Omega]0}]
  10. x[t_, \[Omega]_] := s[\[Omega]][[1, 1, 2]]
  11. x[t, \[Omega]1]
  12.  
  13. Plot[Evaluate[{x[t, \[Omega]1]}], {t, 0, 2*Pi/ \[Omega]0}, PlotRange -> Automatic,PlotStyle ->Automatic, AxesLabel -> {"t", "x[t]"}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement