Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here goes a solution.</p> <pre><code>m = 10; c = 2; k = 5; F = 12; NumberOfDiscrit$f = 20;(* Number of points you want to divide 0&lt;=f&lt;=5*) NumberOfDiscrit$t = 100;(* Number of points you want to divide 0&lt;=t&lt;=30 *) fValues = Range[0., 5., 5./(NumberOfDiscrit$f - 1)]; tValues = Range[0., 30., 30./(NumberOfDiscrit$t - 1)]; res = Map[(x /. First@First@ NDSolve[{m*x''[t] + c*x'[t] + (k*Sin[2*Pi*#*t])*x[t] == F*Sin[2*Pi*#*t], x[0] == 0, x'[0] == 0}, x, {t, 0, 30}]) &amp;, fValues]; AllDat = Map[(#@tValues) &amp;, res]; InterpolationDat = Flatten[Table[ Transpose@{tValues, Table[fValues[[j]], {i, 1, NumberOfDiscrit$t}], AllDat[[j]]}, {j, 1, NumberOfDiscrit$f}], 1]; Final3DFunction = Interpolation[InterpolationDat]; Plot3D[Final3DFunction[t, f], {t, 0, 30}, {f, 0, 5}, PlotRange -&gt; All, PlotPoints -&gt; 60, MaxRecursion -&gt; 3, Mesh -&gt; None] </code></pre> <p><img src="https://i.stack.imgur.com/wrkK8.png" alt="enter image description here"></p> <p>You can use <code>Manipulate</code> to dynamically change some of the parameters. By the way the above 3D picture may be misleading if one takes <code>f</code> as a continuous variable in <code>u(t,f)</code>. You should note that the numerical solution seems to blow up for asymptotic values of <code>t&gt;&gt;30</code>. See the picture below. </p> <p><img src="https://i.stack.imgur.com/pv9km.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/Oo6pU.png" alt="enter image description here"></p> <p>Hope this helps you out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload