Math on the Cloud
FacebookTwitterInstagram

First-Order Ordinary Differential Equation(ODE)--Generic Form(version 1.4)

This page/program provides numerical solution of a 1st-order ODE:
dy/dt=f(y,t), at t=t0, y(t)=y(t0).

In math equation style:
`dy/dt=f(y,t), ` `at` `t=t_0, y(t)=y(t_0)`

It is an initial value problem(IVP) of a generic form ODE.
Generic means f(y,t) can be any non-linear and time-variant function(of y and t).

When you open this page, the solution/simulation of a default/pre-defined example ODE is ready to run.
  1. Click "Solve" button to display the solution for the ODE over a time period: [t0, t0+T], where T=N*dT.
  2. A set of ODE examples are provided, use the selection menu to select one of the pre-defined example functions, and then click "Solve" button to run the new example.
  3. A brief description of the ODE examples is at the end of this page.

To define your own ODE system, just input or re-define the ODE function and parameters:
  1. Function: f(y,t).
  2. Initial values: y(t0).
  3. dT--Integration/sampling step size, N--Number of data to display in the graph plotter.
    Then, click "Solve" button to start and display your own ODE solution.

A more detailed usage of this ODE solver/tool is at the end of this page.
For definition of the functions f(y,t), see "Supported Operators and Functions".
Restart/Reload This Web Page

Selected Variable=y(t):
Push "Solve" Button to Run the Predefined Example
Set Time Step Size dT(sec), Number of Data to Display N, Initial Time t0, and Initial Value y(t0):
dT:N:t0:y(t0):


Input Your Own Function f(y,t) or Use the Pre-defined or Selected Example:
f(y,t):

Saved Projects:

How to save your projects for later use:
Click "Save Project" to save the current project to your device. All necessary function(s) and parameters will be saved.
Click "Load Project" to load a saved project and run it.
Click "Delete Project" to remove the selected project from your device.
Note: Your projects will remain saved to your device unless you delete them or you clear the site data of your browser.

Sharing your projects:
To create a URL link for the current project, click the "Share Function" button below the graph(s).
This will copy a link containing the current project to your clipboard that you can share with others.
You can also save a PNG image of the current graph by clicking the "Save Graph as Image" button.

Disclaimer: No data saved with these tools are kept by or sent to mathonthecloud.com. Everything is saved locally to your device only.

Example list of the ODE Tool:

This program provide a set of ODE examples to demo the function f(y,t) formula syntax. Use the "Menu to Select,,," to view and select one of the example functions, and then click "Solve" button to run the selected example.
  • Example default: a linear system driven by a sine time function.
  • Example 1, 2, 3 : three different non-linear or time-varying systems.
  • Example 4: f(y,t)=f(t) is a Gaussian function and y(t) becomes integral of the Gaussian function. The ODE becomes a pure time function integrator.

More Usage Information for the ODE Tool:

  • This program provides numerical ODE solution over a definite time period [t0, t0+T], where T=N*dT.
  • If f(y,t)=f(t), that is, the function depends only on t, the output y(t) will become an integral of f(t).
  • If f(y,t)=f(y), that is, the function depends only on y, the ODE will become autonomous(or time-invariant) system.
  • The classic explicit fourth-order Runge-Kutta method(RK4) is used as numerical integration method in this program.

  • Usually the value of N can be set between 1000 to 20000. A bigger N will display more data in the graph plotter, but will also cost more memory or even cause a stack overflow problem, and hence stop the program.
  • Currently, the ODE solver/tool employs a 'fixed step size' integration method and the step size dT must be set by the user. Theoretically, a proper value of step size dT can be determined according to the ODE's maximum state changing rate, time-constant, and/or the so-called stiffness.
  • As a practical approach, you can begin with a small dT and use the "Solve" button, to get an initial y(t) display, and then use the y(t) display to obtain a rough estimate of the ODE time-constant.
  • Usually dT can be set between 1/20 to 1/5 of the time-constant for most non-stiff ODEs. A smaller dT will lead to higher accuracy, but will cause longer computation time as well.
  • You can try different combinations of dT and N values, to get a stable and accurate ODE solution, and also nice graph displays, at the same time.
  • A special tool for exploring relationship between the step size and accuracy of the ODE solution will be developed and added to our website.
  • In the future, the so-called 'adaptive step size' algorithms may be added to our ODE solvers/tools. Then, the step size will be variable during the integration process according to the dynamical characteristics of the ODE. That is, the step size dT will be automatically determined by the ODE solver itself, and the user just need to set error tolerance parameters optionally.

  • If you change any input parameter and/or function, you need to click "Solve" button again to let the new parameter and/or function be read and used in the solution.
  • In case an error occurs, the program will display a notice and may indicate the cause of the error. After the error is corrected, click "Solve" button to re-start a new solution process.

Math on the Cloud/ode1/ode1generic
©Math on the Cloud 2022-2024. Read our Privacy Policy and Terms & Conditions