dydx

Ordinary Differential Equations

Your Progress in this Chapter

0%

0 / 21 units completed

Chapter Overview

Implicit Differential Equations

Section 8.5 of 722 min4 code examples

Implicit differential equations (IDEs) are a fascinating, if slightly rebellious, branch of calculus. While most standard differential equations are "explicit"—meaning you can neatly isolate the derivative on one side—IDEs keep things tangled.

Think of it like the difference between a recipe that says "Add 2 cups of flour"(explicit) and one that says "The amount of flour plus the amount of sugar must equal 5 cups" (implicit). You know the relationship, but you have to do some work to find the specific values.

What Makes an Equation Implicit?

In a standard explicit first-order ODE, we write:

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

In an implicit differential equation, the derivative is embedded within a function where it cannot be (or simply isn't) isolated:

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

Why Use Them?

  • Physics & Constraints: Many physical systems are governed by constraints (like a bead sliding on a wire) where the relationship between position and velocity is fixed by the geometry, not a direct formula.
  • Singularities: IDEs can describe behaviors where the derivative might become undefined or "multi-valued"(where one point has multiple possible slopes).
  • Differential-Algebraic Equations(DAEs): These are a subset of IDEs often used in electrical circuit simulation and multi-body dynamics.

Solving Strategies

Because you can't always "solve for y'," the approach changes:

  1. Implicit Differentiation: If you have an equation like, x^2 + y^2 = 1, you differentiate every term with respect to, treating as a function of: 2x + 2y \cfrac{dy}{dx} = 0

Then, you isolate \cfrac{dy}{dx} if possible.

  1. Direction Fields: You can still visualize these equations! For any point, you solve the algebraic equation F(x,y,y') = 0 for y'. If there are multiple solutions for y', the slope field might have overlapping segments.
  1. Numerical Solvers: For complex IDEs or DAEs, standard solvers like Runge-Kutta might struggle.Specialized algorithms(like the Backward Differentiation Formula, or Diagonally implicit rungekutta) are used to handle the "stiffness" of these equations.

A Classic Example: Clairaut's Equation

One of the most famous IDEs is Clairaut's Equation: y = x \cfrac{dy}{dx} + f\left(\cfrac{dy}{dx}\right). This equation is unique because it often yields two types of solutions: a family of straight lines(the general solution) and a "singular solution" that acts as an envelope to those lines.

Numerical Solution

SepalSolver's Ode45i can handle implicit equations, but you need to provide the function in the form F(x, y, y') = 0. Here's a simple example of how to set up and solve an implicit equation using SepalSolver: To solve the clairaut's equation, we can rearrange it to fit the form F(x, y, y') = 0: ie , F(x, y, y') = y - x y' - f(y').

.. Admonition:: Example 1 : Solving Clairaut's Equation y = x y' + \left(y'\right)^2

F(x,y,y)=yxy(y)2,y(0)=1F(x, y, y') = y - x y' - \left(y'\right)^2, \quad y(0) = 1

First we need to compute the y'(0) from the initial condition using decic. And then we can use the computed y'(0) to solve the equation using Ode45i.

Example 1C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Code is ready to run
OutputFrom the book
Clairaut.png

.. Admonition:: Example 2 : Solve Weissinger implicit ODE y = x^n f(y') + g(y')

While Clairaut's equation is a textbook classic, Weissinger’s Implicit Differential Equation takes things a step further into the realm of higher-degree implicit equations. It is specifically a first-order equation where the derivative is raised to a power, but it maintains a structure that allows for a clever substitution method. The general form of a Weissinger equation is: y = x^n f(y') + g(y')

In many contexts, particularly in the study of aerodynamics(where Weissinger’s name is prominent due to his work on lifting-line theory), you might see specialized versions of this.However, in pure mathematics, it is often treated as a generalization of d'Alembert’s equation.

1. Structure and Characteristics

Unlike a standard ODE, the Weissinger equation is nonlinear in the derivative.

  • Relationship to Clairaut: If you set n = 1 and f(y') = y', you essentially return to the Clairaut form.
  • The Power of x: The x^n term dictates how the geometry of the solution curves scales as you move away from the origin.

2. The Solution Strategy: Parameterization

To solve a Weissinger equation, we rarely try to isolate algebraically.Instead, we use a parameter, where: p = y' = \cfrac{dy}{dx} substituting p into the equation gives: y = x^n f(p) + g(p) To find the relationship between x and p, we differentiate the entire equation with respect to x:

dydx=nxn1f(p)+xnf(p)dpdx+g(p)dpdx\cfrac{dy}{dx} = nx^{n-1} f(p) + x^n f'(p) \cfrac{dp}{dx} + g'(p) \cfrac{dp}{dx}

Since \cfrac{dy}{dx} = p , we get a linear differential equation for in terms of p:

p=nxn1f(p)+[xnf(p)+g(p)]dpdxp = nx^{n-1} f(p) + \left[x^n f'(p) + g'(p) \right] \cfrac{dp}{dx}

This transformation is powerful because it turns a difficult implicit equation into a linear one(usually of the Bernoulli type or similar), which we can solve to get x(p). Once you have x(p) and y(fp), you have a parametric solution to the original ODE.

3. Why Weissinger Equations Matter

Weissinger's work is most famous in fluid dynamics, specifically the Weissinger Area Rule and his "L-method" for calculating lift distribution on swept wings. In these engineering contexts, implicit equations arise because the induced downwash(the change in airflow direction) depends on the lift, but the lift itself is a function of that downwash.

Applications include:

  • Aerodynamics: Modeling the circulation around wings with non-rectangular shapes.
  • Classical Mechanics: Describing trajectories where the velocity constraint is non-linear.
  • Singularities: Just like Clairaut equations, Weissinger equations often have "envelope" solutions where the uniqueness of the solution breaks down.

Using user defined derivative

We can also specify the derivative of the function with respect to y and y'. TO demonstrate this,

Consider F(t, y, y') = ty^2(y')^3 - y^3(y')^2 + t(t^2 + 1)y' - t^2y = 0

Fy=2ty(y)33y2(y)2t2\frac{\partial F}{\partial y} = 2ty(y')^3 - 3y^2(y')^2 - t^2
Fy=3ty2(y)22y3y+t(t2+1)\frac{\partial F}{\partial y'} = 3ty^2(y')^2 - 2y^3y' + t(t^2 + 1)

In this case, fix the initial value y(t_0) = \sqrt{\cfrac{3}{2}} and let decic compute a consistent initial value for the derivative y'(t_0), starting from an initial guess of y'(t_0) = 0.

Example 2C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Code is ready to run
OutputFrom the book
Weissinger_With_Jacobian.png

.. Admonition:: Example 3 : Robertson differential equation in implicit form

Here we reformulate the robertson ode as a pully implicit system of differential algebraic equations

y1=0.04y1+104y2y3y2=0.04y1104y2y3(3×107)y22y3=(3×107)y22\begin{array}{rcl} y'_1 &=& -0.04y_1 + 10^4 y_2 y_3 \\ y'_2 &=& 0.04y_1 - 10^4 y_2 y_3 -(3 \times 10^7) y_2^2 \\ y'_3 &=& (3 \times 10^7) y_2^2 \end{array}

We previously solved this system of ODEs to steady state with the initial conditions y_1 = 1, y_2 = 0, and y_3 = 0.

But the equations also satisfy a linear conservation law,

y1+y2+y3=0y'_1 + y'_2 + y'_3 = 0

In terms of the solution and initial conditions, the conservation law is

y1+y2+y3=1.0y_1 + y_2 + y_3 = 1.0

The problem can be rewritten as a system of DAEs by using the conservation law to determine the state of y_3. This reformulates the problem as the implicit DAE system

0=y1+0.04y1104y2y30=y20.04y1+104y2y3+(3×107)y220=y1+y2+y31.\begin{array}{rcl} 0 &=& y'_1 + 0.04y_1 - 10^4 y_2y_3 \\ 0 &=& y'_2 - 0.04y_1 + 10^4 y_2y_3 + (3 \times 10^7)y_2^2\\ 0 &=& y_1 + y_2 + y_3 - 1. \end{array}

Example 3C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Code is ready to run
OutputFrom the book
Summary of statistics by Ode45i
        85 successful steps
        10 failed attempts
        2745 function evaluations
        95 partial derivatives
        356 LU decompositions
        1722 solutions of linear systems
Implicit-Robertson-ODE-Ode45i.png

Using the user defined jacobian reduces the number of function calls made during the computation.

Fy=[0.04104y3104y20.04104y3+(6×107)y2104y2111]\frac{\partial F}{\partial y} = \begin{bmatrix} 0.04 & - 10^4 y_3 & - 10^4 y_2 \\ -0.04 & 10^4 y_3 + (6 \times 10^7)y_2 & 10^4 y_2 \\ 1 & 1 & 1 \end{bmatrix}
Fy=[100010000]\frac{\partial F}{\partial y'} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{bmatrix}

Example 4C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Code is ready to run
OutputFrom the book
Summary of statistics by Ode45i
        85 successful steps
        10 failed attempts
        2069 function evaluations
Implicit-Robertson-ODE-Ode45i_With_jacobian.png

As an exercise, the reader is encouraged to solve this same problem but using this constraint

y1+y2+y3=0y'_1 + y'_2 + y'_3 = 0

that is:

0=y1+0.04y1104y2y30=y20.04y1+104y2y3+(3×107)y220=y1+y2+y3.\begin{array}{rcl} 0 &=& y'_1 + 0.04y_1 - 10^4 y_2y_3 \\ 0 &=& y'_2 - 0.04y_1 + 10^4 y_2y_3 + (3 \times 10^7)y_2^2\\ 0 &=& y'_1 + y'_2 + y'_3. \end{array}