[code]

vx = v0*Math.cos(theta);

vy = v0*Math.sin(theta)-g*t;

[/code]

1. EJS first process "variables" page to allocate memory for variables and set initial value according to your definition.

2. EJS then do commands in "Initialize" page.

3. EJS modified variables in "Evolution" page

4. EJS process commands in "Fixed relations" page.

Then it go to step 3 , and it become a loop when simulation is in play mode.

All the variables need to be initialized before evolution page. So you should put

[code]

vx = v0*Math.cos(theta);

vy = v0*Math.sin(theta); // -g*t is removed because it is correspond to t=0

[/code]

in initialize page.

If you put the above two line in "fixed relation" page, then vx and vy values will never be changed.

The relation "d(vy)/dt=-g" in evolution page will calculate vy(t)=vy(0)-g*t automatically at each time step.

Two more traces are added in the view.

The modified page is attached.