1ST-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
2nd order differential equations

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

/<initial value of x>/<final value of t>/<number of time-steps>/<function of x 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 dx/dt = 2x - t - 2 from t = 0 to t = 2 using 10 time steps and the initial condition that x(0) = 1, type /1/2/10/2x-t-2 after /ode in the url above. The final result should be that x(2) = -11.39..
algorithms: 4th-order Runge-Kutta method
json: Type '/api' in the url bar immediately before 'ode' if you would like the result in json rather than in html. All of the data are returned.