2ND-ORDER DIFFERENTIAL EQUATIONS

creator:  Peter Knipp
repo:  github.com/pknipp/calculus

back to math APIs page
back to calculus page
differentiation
integration
root-finding
max-finding
1st order differential equations

This page solves a differential equation of the form d2x/dt2 = function of x, of dx/dt (= 'v'), and of 'time' t, with a specified 'initial condition', ie values of x and of v when the 'time' t = 0. In the url bar after 'https://basic-calculus.herokuapp.com/ode2 type the following:

/<initial value of x>/<initial value of v v>/<final value of t>/<number of time-steps>/<function of x, v, and t>

The function may be any algebraically legal combination of the variable letter(s), numbers, parentheses, and/or binary operations +, -, *, ** (encouraged) or ^ (discouraged), PI and/or the most common unary functions: abs, acos, acosh, acot, acoth, acsc, acsch, asec, asech, asin, asinh, atan, atanh, cbrt, ceil, cos, cot, csc, exp, exp2, exp_m1, floor, fract, ln, ln_1p, log10, log2, sec, signum, sin, sqrt, tan, and trunc. (See docs for more information.) To represent division you must use either div, d, DIV or D because the usual division symbol (/) has special meaning in a url. Implied multiplication is allowed. Spaces are allowed but discouraged.
The construction rules for the values of any variable in the url are the same as those for the function except - of course - it cannot include the letter which represents the variable.
example:To solve the equation d2/dt2 = -2x - v + 3t with the initial conditions that x(0) = 0 and dx/dt = v(0) = 1 over the range 0 < t < 4 using 10 time-steps, type /0/1/4/10/-2x-v+3t after /ode2 in the url above. In this case the final values for x and dx/dt should be 5.31... and 1.57..., respectively.
algorithms: 4th-order Runge-Kutta method
json: Type '/api' in the url bar immediately before 'ode2' if you would like the result in json rather than in html. All data are returned.