Begin by putting in the function, if you have it. (a function of x)
For the Euler/Runge-Kutta simulation techniques, you only need to know the derivative of the function, dy/dx. (a function of x and y)
You need to know the initial x value, and y value , to the final x value .
In order to adjust the accuracy of the function estimation, you specificy a "step size" .
Sometimes you might like to use a very small step size, but only print the results every two steps, for example. Set the interval:
Expressions are only groupable in parenthesis; math functions are from JavaScript; roots cannot be negative; exponents are carried out with a function. This is impossible to understand, so in other words:
Since you can't take negative roots, (even to odd powers), you must do something like this: instead of writing -11/3 = Math.pow(-1, 1/3), you write -Math.pow(-(-1), 1/3) = -Math.pow(1, 1/3). For variables you could do this:
if (x < 0) ans = -Math.pow(-x, 1/3); else ans = Math.pow(x, 1/3);