variable initial condition in matlab

Home Forums Matlab variable initial condition in matlab

This topic contains 0 replies, has 1 voice, and was last updated by  pankaj kumar 9 years, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #535

    pankaj kumar
    Participant

    om=2.64;
    T=10*3.114/om;
    t=0:0.01:T;
    t0=0;
    xzero =-0.01;yzero =.012;
    x=(xzero-(1/(1-om^2))*cos(om*t0))*cos(t-t0);
    y=(-yzero+(1/(1-om^2))*cos(om*t0))*sin(t-t0);

    figure
    plot(t,x)
    figure
    plot(t,y)
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
    In above code ,when x=0, I like to update initial condition xzero, yzero and t0 as follow
    xzero=x; (i.e zero)
    yzero=-0.8*y;(yzero will -0.8 times of instantaneous velocity)
    t0=t; (t is time corresponding to x=0)

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.