Note that there are some explanatory texts on larger screens.

plurals
  1. POEquation of motion by Runge-Kutta continuation method in Matlab
    text
    copied!<ul> <li>Equation of motion is given by:</li> </ul> <p><img src="https://i.stack.imgur.com/GhLU3.png" alt="equation"> ,where m, b are stationary values of mass and damping. The time varying term f(t) is excitation power and q(t) is generalized displacement.</p> <ul> <li>I solved that:</li> </ul> <p><img src="https://i.stack.imgur.com/NwV1n.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/k5ZLy.png" alt="enter image description here"></p> <ul> <li>And I should to solve in MatLab via [t,x]=ode23('rightside',tspan,x0).</li> <li>f(t) and k(t) I solved in complex numbers via Fourier series like that in Matlab:</li> </ul> <p><i> % complex fourier series for f(t)</p> <pre><code>ft=zeros(size(t)); for j=1:2*N+1 n= j-(N+1); if n==0 f(j)=f0/2; else f(j)=f0*( (exp(-i*n*2*pi)*(i*2*pi*n+1)-1)/(4*pi^2*n^2)); end ft=ft+f(j)*exp(i*n*om*t); end </code></pre> <p></i></p> <p><i> % complex fourier series for k(t)</p> <pre><code>kt=k0*ones(size(t)); for s=1:2*N+1 n= s-(N+1); if n==0 c(s)=k0; else c(s)=i*(k0+ktyl)/n/pi*(1-cos(n*pi)); end kt=kt+c(s)*exp(i*n*om*t); end </code></pre> <p></i></p> <ul> <li>And we know:</li> </ul> <p><i></p> <pre><code>T=30; dt=0.01; t=0:0.01:5*T; k0=1e6; om=2*pi/T; ktyl=0.5e6; N=10; m=1; ks=1e4; D=0.01; OMG=sqrt(ks/m); b=2*D*OMG*m; f0=100; </code></pre> <p></i></p> <p>Thank you.</p> <ul> <li><strong>It should be similar princip like that:</strong></li> </ul> <p></p> <pre><code>function v=prst1(t,y) global m b k Om D F omeg v(1)=....; v(2)=y(1); v=v(:); </code></pre> <ul> <li><strong>and:</strong></li> </ul> <p></p> <pre><code>global m b k Om D F omeg m=1; b=10; k=1000; F=10; Om=sqrt(k/m); omeg=1*Om; D=b/(2*Om*m); x0=[0;0]; [t,x]=ode23('prst1',0:0.01:10,x0); plot(t,x) </code></pre> <ul> <li><strong>BUT I don't how to get there f(t) and k(t).</strong></li> </ul>
 

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