#27964
Profile photo of Andrew Normand

Javascript would seem to be commonly available, and a runner:

You could have the core of a model like this, which looks more or less intelligible:

 

var force;

var mass;

var acceleration;

var position;

var velocity;

var timeonClock;

var timeInterval;

 

function accumulate(AccumulatorValue,QuantityValue)

{

return QuantityValue = QuantityValue + AccumulatorValue*timeInterval;

}

 

 

// set initial values

 

force = 3;

mass = 5;

timeInterval = 0.01;

position = 0;

velocity = 0;

timeonClock = 0;

WallLocation = 7;

 

 

// find acceleration

 

acceleration = force/mass;

 

// set condition

while (position<=WallLocation){

 

// do the accumulations

timeonClock = accumulate(timeInterval, timeonClock)

velocity = accumulate(acceleration, velocity)

position = accumulate(velocity, position)

 

// store these results

 

PlotThis+= AddPoints(timeonClock,position);

 

}

 

 

 

Log in with your credentials

Forgot your details?