0
Scilab - Ballistic problem

function func = F(t,Y)

func (1)= Y(1);

func (2)= Y(2);

func (3)= Cx * p * S * sqrt(Y(3) ^ 2 + Y(4) ^ 2) / 2 * m * Y(3);

func (4)= Cx * p * S * sqrt(Y(3) ^ 2 + Y(4) ^ 2) / 2 * m * Y(4) - g;

endfunction

m = 10; //weight

g = 9.80665; // gravity

p = 1.17; // air density

Cx = 2.30; // aerodynamic coefficient of resistance

S = 1.5 ^ 2; // body projection surface in a plane perpendicular to the body velocity vector

// Speed

Vx = 10;

Vy = 10;

// Coords

x = 0;

y = 0;

Y0=[x;y;Vx;Vy]; // the initial value of the condition vector

t0 = 0; // start time

tk = 10; // end time

t = linspace(t0, 10, 20);

Y = ode(Y0, t0, t, F);

plot(F(t, Y));

and Scilab return me this error: lsoda-- repeated calls with istate = 1 and tout = t (=r1) where r1 is : 0.0000000000000D+00 lsoda-- infinite loop? and should, if is good, should be draw on a bullet flight in plot.


Scilab 05-06-18, 12:34 a.m. Yetem

Log-in to answer to this question.