Computed Solution
Solution Table
Enter Coupled System Inputs
Example Data Table
This sample uses a two-equation oscillator written as a first-order system. It shows how the table is structured after solving.
Example Input Data
| Field | Example value | Meaning |
|---|---|---|
| Method | Euler | First-order explicit stepping |
| y₁′ | y2 | State coupling from y₂ into y₁ |
| y₂′ | -y1 | Restoring relation back into y₂ |
| t₀ | 0 | Initial time |
| tₙ | 0.3 | Final time |
| h | 0.1 | Step increment |
| y₁(0) | 1 | Initial first state |
| y₂(0) | 0 | Initial second state |
Illustrative Output Rows
| Step | t | y₁ | y₂ | Norm |
|---|---|---|---|---|
| 0 | 0.0 | 1.000000 | 0.000000 | 1.000000 |
| 1 | 0.1 | 1.000000 | -0.100000 | 1.004988 |
| 2 | 0.2 | 0.990000 | -0.200000 | 1.010000 |
| 3 | 0.3 | 0.970000 | -0.299000 | 1.015035 |
Formula Used
y′(t) = F(t, y), where y = [y₁, y₂]ᵀ or y = [y₁, y₂, y₃]ᵀ
yn+1 = yn + hF(tn, yn)
k₁ = F(tn, yn)
k₂ = F(tn + h, yn + hk₁)
yn+1 = yn + (h/2)(k₁ + k₂)
k₁ = F(tn, yn)
k₂ = F(tn + h/2, yn + hk₁/2)
k₃ = F(tn + h/2, yn + hk₂/2)
k₄ = F(tn + h, yn + hk₃)
yn+1 = yn + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
‖y‖ = √(y₁² + y₂²) for two equations, or √(y₁² + y₂² + y₃²) for three equations.
This calculator also estimates a refinement error by solving the same system again with half the step size and comparing final values.
How to Use This Calculator
- Choose whether your model has two or three first-order equations.
- Enter each derivative expression using t, y1, y2, y3, and constants c1 to c6.
- Set the start time, end time, step size, and initial values.
- Select Euler, Heun, or RK4 based on your speed and accuracy needs.
- Press Solve System to generate the result table, summary cards, and graphs.
- Use the CSV or PDF buttons to export the computed trajectory.
- If the solution behaves poorly, reduce the step size or switch to RK4.
- For higher-order coupled ODEs, define additional state variables first, then enter the equivalent first-order system.
FAQs
1. What does this calculator solve?
It solves coupled first-order ordinary differential equations with two or three linked state variables. You provide the derivative expressions, initial values, time range, and step size, then the tool approximates the trajectory numerically.
2. Can I solve second-order coupled equations here?
Yes. Rewrite each higher-order equation as several first-order state equations. For example, replace one second-order equation with two first-order equations by introducing a velocity-like variable.
3. Which method should I choose?
Euler is simplest and fastest but least accurate. Heun improves accuracy with moderate cost. RK4 is usually the best default when you want stable, high-quality approximations across many practical systems.
4. Why is step size so important?
Step size controls how far the solver moves each iteration. Smaller steps usually improve accuracy and stability, but they increase computation time and enlarge the output table.
5. Why do some results blow up quickly?
Your system may be unstable, stiff, badly scaled, or solved with a step that is too large. Try reducing the step size, checking signs and constants, or switching to RK4.
6. Which functions are supported in expressions?
You can use common mathematical functions such as sin, cos, tan, exp, sqrt, and log. Built-in constants like pi also work, alongside the custom constants c1 through c6.
7. What does the phase plot show?
The phase plot reveals how one state changes relative to another. It helps identify cycles, spirals, attractors, and qualitative behavior that may not be obvious from time-series curves alone.
8. What is the refinement error estimate?
It compares the final solution from your chosen step size against a second run using half the step size. A smaller difference usually suggests a more reliable numerical result.