syms T t0 D V Sv Sy y0 v0 Lamday LamdavT tT = t0 + D/V; % We Define T as the final time at wich two objects will have the same distance
MatrixA = [Sv+T T*(Sv*T/2); -T^2/2 Sy-T^3/6];DeterminantA = (Sy + T^3/3)*(Sv + T) - T^4/4initials =[y0; v0];Lamda = [Lamday; LamdavT]; Lamda = (MatrixA * initials)/DeterminantAvt = v0 - t*(LamdavT + T*Lamday) + (T.^2)/2 * Lamday % we define v(t) as the velocity at any time t
yt = y0 + t*v0 - (t.^2)/2 *(LamdavT + T*Lamday) + (t.^3)/6 * LamdayLamdavT = Sv*vt;Lamday = Sy*yt;t = 1:9;y0=0; v0=0; t0=0; D =3; V = 2; y1 = y0 + t*v0 -(t.^2)/2 *(1.5 + T * 0.5) + (t.^3)/6 * 0.5;plot(t,y1)
MATLAB: Error using plot Conversion to double from sym is not possible.
doubleerrorsymbolic
Best Answer