Hi there
I have the following code:
tf = 1;t = linspace(0,3);Ft = zeros(length(t),1);% Here I generate the force values at different time intervals.
for i = 1:length(t) if t(i) <= tf Ft(i) = Fo*sin(2*pi*t(i)/tf); elseif t(i) > tf Ft(i) = 0; endendic = [0, 0]; % Initial conditions
dXdt = @(t, x) [x(2); Ft * 1/(m1+m2)]; [t, x] = ode23(dXdt, [0, 3], ic);
I'm struggling to incorportate this time varying force F(t) into the ode23 function.
Any help as to how I can maybe get this done?
Thanks in advance!
Best Answer