indexing - Solving a forced oscillator equation with a time-dependant force in MATLAB -
i solve following problem in matlab
my problem classic forced damped harmonic oscillator, issue force putting oscillator motion time-dependant computed matlab (with pdepe).
therefore, when use ode45 solver, have following error : attempted access param.te(1.00004,10); index must positive integer or logical.
i have skipped issue in matlab odefunction writing
dy(1)=1/param.m.*param.te(floor(t+1),10)-param.nu.*x(1)-param.wo2.*x(2); dy(2)=x(1);
instead of
dy(1)=1/param.m.*param.te(t+1,10)-param.nu.*x(1)-param.wo2.*x(2); dy(2)=x(1);
however, 'dirty' , poor approximation of function, , know if way obtain better range of datas function, perhaps extrapolating values, i'm bit lost here...
thanks :)
ps: it's first post on site, if have forgotten in topic, please me.
Comments
Post a Comment