Breadcrumbs

 

 

 

Download ModelDownload SourceembedLaunch Website ES WebEJS

About

Description

First order differential equation

The simulation calculates solutions of ordinary explicit first order differential equations

y´ = dy/dx = f(y,x)

using the Runge−Kutta algorithm. In the left coordinate system the abscissa represents x, the ordinate y.

When opening the file you see a fat red point at x = 0, representing the initial value y0 at its abscissa x0 . You can change the initial value with the slider, more exactly and unlimited by typing a value into the number field. Two additional number fields are used to define x0 and xmax . Default values are: y0 = 1; x0 = 0; xmax = 3. You can also draw the red point to create new initial conditions.

In the comboBox you can chose between a number of predefined types of functions. Their formula is shown in field y´ = .. . There you can edit formulas or input any arbitrary first order explicit differential equation.

When activating start with the default equation, the differential equation of the exponential function y´= y is evaluated. Calculation stops as x = xmax . At first you see a set of calculated points. You can choose the option trace to get an interpolated smooth curve.

Stop stops the calculation; back leaves already calculated points and sets back to the initial conditions. Changing these now creates an additional curve at start. This way you can generate sets of solutions for different initial conditions (the Trace option would create jumps, which are avoided in the points option). Clear resets and clears traces, but leaves parameters unchanged. Reset leads back to default values.

After back you can change the x-resolution of the calculation by slider step, and look if and how different resolution influence the result.

The smaller window shows the phase space projection

y ´ = y´ ( y )

The green point is the one last calculated.

The phase space diagram very distinctively demonstrates the different character of solutions:  convergence, divergence, periodic oscillation, oscillating divergence, oscillating convergence. It is independent of the initial condition. The order of predefined functions follows these characteristics.

Calculus

Numerical integration of differential equations with EJS

Using EJS it is very easy to solve differential equations. Several algorithms for different methods are programmed and can be chosen at page Evolution with a mouse click. The steps of the variable x are automatically calculated, when the difference dx has been defined. For a first order differential equation one defines:

dy/dt = y´ = f( y, x )

In this simulation with a ComboBox the formula is:

= (formula in field , evaluated for x, and y)

In February 2011 EJS 4.3 presents the following methods: 

  • Euler
  • Euler−Richardson
  • Velocity Verlet
  • Runge− Kutta, 4- steps
  • Bogacki−Shampine 3(2)
  • Cah−Karp 5(4)
  • Fehlberg 8(7)
  • Dormand−Prince 5(4)
  • Dormand−Prince 8(5
  • Radau 5(4)
  • OSS3
Experiments

E 1:  Run exponential function and try the points and the trace option. After back try different step widths (speed). With the exponential you will see no difference within the given range of the slider.

E 2: Go back, and chose a new initial condition. Start creates the solution, which is different from the first one. Try the points and trace options.

E 3:  Create a set of solutions with identical x0 and different y0. Explain what you see.

E 4: Create a set of solutions with identical y0 and different x0. Why do you see curves that are shifted parallel?

E 5: Create sets of solutions including negative initial values y0. Discuss the result as consequence of the differential equation.

E 6:  Choose exponential damping. Compare solutions for positive and negative initial values to those of the exponential.

E 7:  Choose any of the oscillating functions and try to guess the trace before calculation by studying the differential equation.

E 8: Edit the exponential by adding factors g(x), especially periodic ones. Try to understand what you observe.

E 9: Run the exponential once. Choose back. Edit the formula by setting e^x instead of y. In a second run you will see the same result:  The algorithm now performs ordinary Integration (numerical calculation of the antiderivative = indefinite integral). This works for the exponential, because y is not explicit in dy/dx = e^x.

.

E 10: Choose any other function not containing y, e.g. sin(x). For this you get -cos(x) as indefinite integral,with the initial value as integration constant. Compare the phase space diagram of Sine with that of the function type Periodical.

E11:  Choose constant velocity and create a curve set for different factors y, including zero. This again is a simple integration. Edit the differential equation in such a way that an initial starting location (x0) is considered.

E12: Choose constant acceleration and create a curve set for different factors of y, including zero. This again is a simple integration. Edit the differential equation in such a way that an initial velocity is considered.

E 13:  Extend the differential equation by more complicated functions of y and let yourself be surprised by what happens. Try to define and understand interrelated families of differential equations. Are there more classes than convergent, divergent, periodic?

E14:  After back change the step width for different functions and observe the result. Which characteristics define the maximum width below which no deviations are observed?

Authors

This file was created by Dieter Roess in March 2009

This simulation is part

Learning and Teaching Mathematics using Simulations

– Plus 2000 Examples from Physics”

ISBN 978-3-11-025005-3, Walter de Gruyter GmbH & Co. KG

 

Translations

Code Language Translator Run

Credits

Dieter Roess - WEH- Foundation; Tan Wei Chiong; Loo Kang Wee

This document provides a briefing on the JavaScript simulation applet focused on explicit first-order ordinary differential equations (ODEs). The applet, developed using Easy JavaScript Simulations (EJS), is designed as an open educational resource for learning and teaching mathematics, particularly within physics contexts. It allows users to explore the numerical solutions of ODEs of the form y´ = dy/dx = f(y,x) using the Runge-Kutta algorithm and visualize these solutions in different ways.

Main Themes and Important Ideas/Facts:

  1. Simulation of First Order ODEs:
  • The core function of the applet is to calculate and display solutions to explicit first-order ODEs. The general form of these equations is highlighted: "y´ = dy/dx = f(y,x)".
  • The applet employs the Runge-Kutta algorithm for numerical integration, which is a common and relatively accurate method for approximating solutions to ODEs.
  • The simulation operates within a defined range of the independent variable x, from an initial value x0 to a maximum value xmax.
  1. Interactive Exploration of Initial Conditions:
  • Users can interactively set the initial condition (y0 at x0) through a visual red point on the coordinate system. This point can be dragged, and the numerical values for y0, x0, and xmax can be directly input.
  • The ability to easily change initial conditions allows for the exploration of families of solutions for a given differential equation. The description explicitly mentions generating "sets of solutions for different initial conditions".
  1. Predefined and Custom Differential Equations:
  • The applet features a "comboBox" offering a selection of predefined first-order ODEs representing various types of functions (e.g., exponential, exponential damping, periodic).
  • The formulas for these predefined equations are displayed in the "y´ = .." field, which is also editable, enabling users to input and explore "any arbitrary first order explicit differential equation".
  1. Visualization of Solutions:
  • The simulation presents the solution graphically in a left coordinate system where the abscissa is x and the ordinate is y.
  • Users can toggle the display between "points" (discrete calculated points) and "trace" (an interpolated smooth curve connecting the points). The "trace" option aims to provide a more intuitive understanding of the solution's behavior, while the "points" option avoids potential "jumps" when generating multiple solutions with different initial conditions.
  1. Phase Space Diagram:
  • A smaller window displays the phase space projection, plotting against y.
  • The phase space diagram offers a valuable way to understand the qualitative behavior of solutions, illustrating characteristics such as "convergence, divergence, periodic oscillation, oscillating divergence, oscillating convergence". Importantly, the text notes that this diagram "is independent of the initial condition".
  1. Numerical Integration Methods (via EJS):
  • The applet leverages the EJS environment, which provides several built-in numerical integration algorithms. These methods, accessible on the "Evolution" page, include: Euler, Euler−Richardson, Velocity Verlet, Runge−Kutta (4-step), and more advanced methods.
  • The text explains the basic principle: "For a first order differential equation one defines: dy/dt = y´ = f( y, x )" and in the simulation, " = (formula in field , evaluated for x, and y )".
  • The step size dx is automatically calculated based on the defined x range and resolution (controlled by a slider).
  1. Guided Experiments for Learning:
  • The resource includes a section on "Experiments" that suggests specific tasks for users to explore different aspects of first-order ODEs and the simulation's capabilities. Examples include:
  • Observing the effect of initial conditions on exponential growth (E2, E3, E5).
  • Understanding how changes in x0 lead to parallel shifts in solutions (E4).
  • Comparing exponential growth and damping (E6).
  • Predicting the behavior of oscillating functions by examining their differential equations (E7).
  • Exploring the concept of numerical integration by setting y' to a function of x only (E9, E10, E11, E12).
  • Investigating the impact of step width on the accuracy of numerical solutions (E14).
  1. Educational Applications:
  • The applet is explicitly presented as a tool for "Learning and Teaching Mathematics using Simulations".
  • The "For Teachers" section highlights the simulation's utility in visualizing first-order ODEs and the ability to toggle between discrete points and continuous curves.
  • The availability of predefined functions and the option for custom input make it adaptable for various educational levels and topics.
  1. Technical Details and Licensing:
  • The simulation is embedded using an <iframe> tag, facilitating easy integration into web pages.
  • The applet was created by Dieter Roess in March 2009 and is part of a larger collection of educational simulations.
  • The content is licensed under a Creative Commons Attribution-Share Alike 4.0 Singapore License, promoting open access and sharing. Commercial use of the underlying EJS library requires a separate license.
  1. Connection to Other Resources:
  • The document lists numerous other JavaScript simulation applets available on the platform, showcasing a wide range of topics in physics and mathematics. This context suggests a rich ecosystem of interactive learning tools.

Key Quotes:

  • "The simulation calculates solutions of ordinary explicit first order differential equations y´ = dy/dx = f(y,x) using the Runge−Kutta algorithm."
  • "When opening the file you see a fat red point at x = 0 , representing the initial value y0 at its abscissa x0 ."
  • "In the comboBox you can chose between a number of predefined types of functions. Their formula is shown in field y´ = .. . There you can edit formulas or input any arbitrary first order explicit differential equation."
  • "The phase space diagramvery distinctively demonstrates the different character of solutions: convergence, divergence, periodic oscillation, oscillating divergence, oscillating convergence. It is independent of the initial condition."
  • "Using EJS it is very easy to solve differential equations. Several algorithms for different methods are programmed and can be chosen at page Evolution with a mouse click."
  • "Run the exponential once. Choose back . Edit the formula by setting e^x instead of y. In a second run you will see the same result: The algorithm now performs ordinary Integration (numerical calculation of the antiderivative = indefinite integral ) ."

Conclusion:

The Explicit First Order Differential Equations JavaScript Simulation Applet is a valuable open educational resource for visualizing and exploring the solutions of these fundamental mathematical concepts. Its interactive features, including adjustable initial conditions, predefined and custom equations, multiple visualization options (including phase space), and guided experiments, provide a hands-on learning experience for students and a useful tool for educators. The use of the EJS framework allows for flexibility in numerical methods, and the open licensing encourages sharing and adaptation. The applet is part of a larger collection of simulations, indicating a commitment to interactive learning in science and mathematics education.

 

 

Study Guide: First Order Differential Equations Simulation

Quiz

  1. What type of differential equations does this simulation primarily focus on calculating solutions for?
  2. Explain the role of the red point that appears in the left coordinate system when the simulation is opened. How can its properties be altered?
  3. Describe the functionality of the "comboBox" within the simulation. What can users achieve through its use?
  4. What is the purpose of the "start," "stop," "back," "clear," and "reset" buttons in the simulation interface? Briefly explain what each action performs.
  5. Explain what the "trace" and "points" options do when displaying the calculated solutions of a differential equation. What is a key difference between them?
  6. What information is presented in the smaller window showing the phase space projection? What can be learned from observing the phase space diagram?
  7. According to the "Calculus" section, what is automatically calculated when using the EJS framework to solve differential equations, once dx is defined?
  8. Name at least three of the numerical integration methods for differential equations that were available in EJS 4.3, as listed in the text.
  9. In Experiment E9, what happens when the formula is edited from y to e^x after running the exponential function and selecting "back"? Why does this occur?
  10. What does Experiment E10 demonstrate by having the user choose a function not containing y, such as sin(x)? What is the role of the initial value in this scenario?

Quiz Answer Key

  1. The simulation calculates solutions for ordinary explicit first order differential equations, which are expressed in the form y´ = dy/dx = f(y,x).
  2. The red point represents the initial value (y0) of the solution at its initial x-coordinate (x0), which is x=0 by default. Users can change the initial value using a slider or by typing a value into a number field, and they can also drag the point to set new initial conditions.
  3. The "comboBox" allows users to select from a number of predefined types of functions that represent the first order differential equation to be solved. The formula for the selected function is displayed in the "y´ = .." field, where it can also be edited or replaced with any arbitrary first order explicit differential equation.
  4. "Start" initiates the calculation of the differential equation up to xmax. "Stop" halts the ongoing calculation. "Back" retains already computed points and returns to the initial conditions, allowing for the generation of additional solution curves with different starting values. "Clear" resets the displayed traces but keeps the parameters unchanged. "Reset" reverts all settings back to their default values.
  5. The "points" option displays the calculated solution as a set of discrete points. The "trace" option interpolates between these points to create a smooth, continuous curve. The "points" option avoids jumps when generating multiple solutions from different initial conditions after using "back," which can occur with the "trace" option.
  6. The smaller window displays the phase space projection, which graphs the derivative y´ as a function of y (y´ = y´(y)). The phase space diagram visually illustrates the different characteristics of solutions, such as convergence, divergence, periodic oscillation, oscillating divergence, and oscillating convergence, independent of the initial condition.
  7. According to the "Calculus" section, when using EJS to solve a first order differential equation and dx is defined, the steps of the variable x are automatically calculated.
  8. Three numerical integration methods available in EJS 4.3 include Euler, Runge-Kutta (4-steps), and Dormand-Prince 5(4). (Any three from the listed methods are acceptable).
  9. When the formula is changed to e^x, the algorithm performs ordinary integration, numerically calculating the antiderivative (indefinite integral). This yields the same result as the exponential function solution because y is not explicitly present in the differential equation dy/dx = e^x.
  10. Experiment E10 demonstrates that when the differential equation does not contain y, solving it becomes a simple numerical integration to find the antiderivative. The initial value then acts as the integration constant, determining the vertical shift of the resulting curve.

Essay Format Questions

  1. Discuss the role of initial conditions in determining the specific solution of a first order differential equation, referencing the capabilities of the simulation to explore this concept.
  2. Compare and contrast the "points" and "trace" options for visualizing solutions in the simulation. Under what circumstances might one option be preferred over the other?
  3. Explain how the phase space diagram provides insights into the qualitative behavior of solutions to a first order differential equation, and discuss the different types of solution characteristics that can be identified through it.
  4. Describe how the simulation can be used to explore the concept of numerical integration as an approximation method for solving differential equations. Consider the impact of the step width on the accuracy of the solution.
  5. Based on the experiments outlined in the text, discuss how modifying the differential equation and the initial conditions can lead to different families of solutions, and what general classifications can be used to describe the long-term behavior of these solutions.

Glossary of Key Terms

  • Explicit First Order Differential Equation: A differential equation where the derivative of the dependent variable ( or dy/dx) is expressed directly as a function of the independent variable (x) and the dependent variable (y), in the form y´ = f(y,x).
  • Initial Value: The specific value of the dependent variable (y0) at a given initial value of the independent variable (x0). In this simulation, it's the starting point of the solution curve.
  • Runge-Kutta Algorithm: A family of numerical methods used to approximate the solution of ordinary differential equations. The simulation uses a specific Runge-Kutta method for its calculations.
  • Abscissa: The horizontal coordinate (x) in a Cartesian coordinate system.
  • Ordinate: The vertical coordinate (y) in a Cartesian coordinate system.
  • Phase Space Projection: A plot where the derivative of the dependent variable () is graphed against the dependent variable (y). It helps visualize the qualitative behavior of solutions.
  • Convergence: A characteristic of solutions where different solution curves approach a specific value or state as the independent variable progresses.
  • Divergence: A characteristic of solutions where different solution curves move away from each other or grow without bound as the independent variable progresses.
  • Periodic Oscillation: A characteristic of solutions where the dependent variable repeats its values in a regular cycle as the independent variable progresses.
  • Numerical Integration: A method for approximating the value of a definite integral or solving differential equations numerically by dividing the interval of integration or the domain of the independent variable into small steps.
  • Step Width (dx): The size of the increment in the independent variable (x) used in numerical integration. Smaller step widths generally lead to more accurate approximations but require more computation.
  • Antiderivative (Indefinite Integral): A function whose derivative is the given function. Finding the antiderivative is the reverse process of differentiation.
  • Integration Constant: An arbitrary constant that is added to the antiderivative of a function. Its value is determined by initial conditions in the context of differential equations.

Sample Learning Goals

[text]

For Teachers

This simulation provides a visualisation of first-order ordinary differential equations, available from a selection in the combo box provided. A total of 9 different types of equations can be selected and graphed on the plotting panel in the simulation.

The display of the plot can be toggled between Points (discrete points) and Trace (a continuous curve) in the combo box to the right of the formula box.

The initial starting point of y can be toggled with the slider labelled y0.

There are 2 plotting panels. The one on the left represents the graph of y against x, while the one on the right represents the graph of the derivative y' against y.

The available functions along with their associated differential equations are as follows:

- Exponential (y = e^x): y' = y

- Exponential Damping (y = e^(-x)): y' = -y

- Periodic: y' = ysin(x) 

- Oscillation Divergent: y' = y(x/5)sin(x)

- Oscillation Convergent: y' = (y/x)sin(x)

- Oscillation Quadratic: y' = ysin((x-10)^2)

- Sine Exponent: y' = y^sin(x)

- Constant Velocity: y' = 1

- Constant Acceleration: y' = x

 

Research

[text]

Video

[text]

 Version:

Other Resources

[text]

Frequently Asked Questions: First Order Differential Equations Simulation

What is the purpose of this simulation?

This JavaScript simulation is designed to help users understand and explore the solutions of ordinary explicit first-order differential equations of the form y' = dy/dx = f(y,x). It allows for the visualization of these solutions through numerical methods and the examination of how different parameters and initial conditions affect the resulting curves.

How does the simulation calculate the solutions?

The simulation uses the Runge-Kutta algorithm to numerically approximate the solutions of the differential equations. Users can also choose from a variety of other numerical methods available within the Easy JavaScript Simulations (EJS) framework on the "Evolution" page. The simulation calculates the values of y for discrete steps in x, starting from a given initial condition.

What is the significance of the initial value (y0, x0)?

The initial value (y0 at x0) is a crucial starting point for finding a particular solution to a differential equation. Geometrically, it represents a point that the solution curve must pass through. In the simulation, the initial x0 and y0 can be adjusted using number fields, a slider for y0, or by directly dragging the red point on the graph. Different initial values will generally lead to different solution curves.

What can I do with the "comboBox" and the formula field (y' = ...)?

The "comboBox" allows you to select from a list of predefined first-order differential equations, such as exponential growth, exponential damping, and various oscillating functions. The formula for the selected equation is displayed in the field below it. You can edit this formula or input any arbitrary explicit first-order differential equation to explore its solutions.

What is the difference between the "points" and "trace" options?

When the simulation calculates the solution, it initially generates a set of discrete points (x, y). If you select the "points" option, you will see these individual calculated points plotted on the graph. The "trace" option interpolates between these points to create a smooth, continuous curve representing the approximate solution. Using the "points" option when generating multiple solutions from different initial conditions can help avoid visual jumps in the graph.

What does the phase space projection (y' vs. y) show, and why is it useful?

The smaller window displays the phase space projection, which plots the derivative y' against the value of y. This diagram provides insights into the qualitative behavior of the solutions, such as whether they tend to converge, diverge, oscillate, or exhibit combinations of these behaviors. Importantly, the phase space diagram's general characteristics are independent of the specific initial condition.

How can I explore the effect of different initial conditions and parameters?

The simulation offers several ways to investigate these effects:

  • Initial Value (y0): Use the slider or number field to change the starting y-value at a given x0.
  • Initial x-value (x0) and maximum x-value (xmax): Define the range of x for which the solution is calculated.
  • Step width (speed): Adjust the resolution of the calculation to see how it affects the accuracy of the numerical solution.
  • Predefined functions: Select different equations from the "comboBox" to observe a variety of solution behaviors.
  • Custom formulas: Edit the formula field to explore solutions of your own defined differential equations.
  • "back" and multiple "start" clicks: After using "back" to reset to initial conditions, changing these conditions and clicking "start" again allows you to generate and compare multiple solution curves on the same graph.

Can this simulation be used to perform numerical integration?

Yes, the simulation can be used for numerical integration. If you input a differential equation where y' (dy/dx) is a function of x only (i.e., y is not explicitly present in the formula, such as y' = e^x or y' = sin(x)), the simulation effectively calculates the antiderivative (indefinite integral) of that function. The initial value y0 then acts as the constant of integration.

1 1 1 1 1 1 1 1 1 1 Rating 0.00 (0 Votes)