All Labs

Differential Equations Modeling Lab

Visualize slope fields, step through Euler's method, and explore real-world differential equation models. Draw solution curves, compare Euler and Heun approximations with exact solutions, and analyze population growth, predator-prey dynamics, and cooling processes.

Guided Experiment: Euler's Method Convergence

If you decrease the step size h in Euler's method, what do you predict will happen to the approximation error?

Write your hypothesis in the Lab Report panel, then click Next.

Controls

Click on the graph to draw a solution curve through that point

Differential Equation

dydx=y\frac{dy}{dx} = y

The slope field shows the direction of the solution at each grid point. Each small segment has slope f(x, y) at that location.

Click anywhere on the graph to draw a solution curve passing through that point. The curve is computed using the RK4 numerical method.

Slope Field

Data Table

(0 rows)
#TrialModelParametersInitial ConditionStep SizeMethodFinal ValueExact ValueError
0 / 500
0 / 500
0 / 500

Reference Guide

Slope Fields

A slope field (direction field) visualizes the derivative dy/dx = f(x, y) across the xy-plane. At each grid point, a small line segment shows the slope of the solution passing through that point.

dydx=f(x,y)\frac{dy}{dx} = f(x, y)

Clicking on the field draws a solution curve using fourth-order Runge-Kutta integration. Multiple curves show the family of solutions, each determined by its initial condition.

Euler's Method

Euler's method approximates the solution by stepping along the tangent line at each point. Starting from (x₀, y₀), each step computes the next value using the slope.

yn+1=yn+hf(xn,yn)y_{n+1} = y_n + h \cdot f(x_n, y_n)

Smaller step sizes h give better accuracy but require more steps. Heun's method (improved Euler) averages the slopes at the start and end of each interval for second-order accuracy.

Logistic Growth Model

The logistic equation models population growth with a carrying capacity K. Growth slows as the population approaches K, producing the characteristic S-shaped (sigmoid) curve.

dPdt=kP(1PK)\frac{dP}{dt} = kP\left(1 - \frac{P}{K}\right)

Equilibria exist at P = 0 (unstable) and P = K (stable). The maximum growth rate occurs at P = K/2.

Predator-Prey (Lotka-Volterra)

The Lotka-Volterra system models two interacting species: prey x and predators y. The populations oscillate cyclically around an equilibrium point.

dxdt=αxβxy,dydt=δxyγy\frac{dx}{dt} = \alpha x - \beta xy, \quad \frac{dy}{dt} = \delta xy - \gamma y

The phase portrait shows closed orbits around the interior equilibrium at (γ/δ, α/β). Prey peaks are followed by predator peaks with a time lag.