Chaos Tamed a new era of energy generation earth Gravity with simulated controller power usage
Creators: name: Adam, McEvoy
name: Dana, Wilcox
Publisher: name: Zenodo
Year: 2025
Subjects: chaos
energy
freedom
physics
life

description: Mathematical Description of the Predictive Energy Controller for a Double Pendulum

This simulation implements a double pendulum system with a predictive energy controller that maintains the system's energy at a specified level (typically 200% of the initial energy). Here's a mathematical explanation of the key components:

Double Pendulum Dynamics

The equations of motion for a double pendulum are derived from Lagrangian mechanics. For two pendulum arms with masses M1M_1 M1 and M2M_2 M2, lengths L1L_1 L1 and L2L_2 L2, and angles θ1\theta_1 θ1 and θ2\theta_2 θ2, the equations are:

For the first pendulum:

(M1+M2)L1θ¨1+M2L1L2θ¨2cos⁡(θ1−θ2)+M2L1L2θ˙22sin⁡(θ1−θ2)+(M1+M2)gL1sin⁡(θ1)=τ1(M_1 + M_2)L_1\ddot{\theta}_1 + M_2L_1L_2\ddot{\theta}_2\cos(\theta_1 - \theta_2) + M_2L_1L_2\dot{\theta}_2^2\sin(\theta_1-\theta_2) + (M_1+M_2)gL_1\sin(\theta_1) = \tau_1(M1+M2)L1θ¨1+M2L1L2θ¨2cos(θ1−θ2)+M2L1L2θ˙22sin(θ1−θ2)+(M1+M2)gL1sin(θ1)=τ1

For the second pendulum:

M2L2θ¨2+M2L1L2θ¨1cos⁡(θ1−θ2)−M2L1L2θ˙12sin⁡(θ1−θ2)+M2gL2sin⁡(θ2)=τ2M_2L_2\ddot{\theta}_2 + M_2L_1L_2\ddot{\theta}_1\cos(\theta_1-\theta_2) - M_2L_1L_2\dot{\theta}_1^2\sin(\theta_1-\theta_2) + M_2gL_2\sin(\theta_2) = \tau_2M2L2θ¨2+M2L1L2θ¨1cos(θ1−θ2)−M2L1L2θ˙12sin(θ1−θ2)+M2gL2sin(θ2)=τ2

Where:



θ˙\dot{\theta} θ˙ represents angular velocity

θ¨\ddot{\theta} θ¨ represents angular acceleration

gg g is gravitational acceleration

τ1\tau_1 τ1 and τ2\tau_2 τ2 are applied torques from the controller


Energy Calculation

The total energy of the system is the sum of kinetic and potential energies:

Kinetic Energy:

T1=12M1L12θ˙12T_1 = \frac{1}{2}M_1L_1^2\dot{\theta}_1^2T1=21M1L12θ˙12

T2=12M2(L12θ˙12+L22θ˙22+2L1L2θ˙1θ˙2cos⁡(θ1−θ2))T_2 = \frac{1}{2}M_2(L_1^2\dot{\theta}_1^2 + L_2^2\dot{\theta}_2^2 + 2L_1L_2\dot{\theta}_1\dot{\theta}_2\cos(\theta_1-\theta_2))T2=21M2(L12θ˙12+L22θ˙22+2L1L2θ˙1θ˙2cos(θ1−θ2))

Potential Energy:

V1=M1gL1(1−cos⁡(θ1))V_1 = M_1gL_1(1-\cos(\theta_1))V1=M1gL1(1−cos(θ1))

V2=M2g(L1(1−cos⁡(θ1))+L2(1−cos⁡(θ2)))V_2 = M_2g(L_1(1-\cos(\theta_1)) + L_2(1-\cos(\theta_2)))V2=M2g(L1(1−cos(θ1))+L2(1−cos(θ2)))

Total Energy:

E=T1+T2+V1+V2E = T_1 + T_2 + V_1 + V_2E=T1+T2+V1+V2

Predictive Control Algorithm

The controller uses a combination of prediction and energy-based control:



Future State Prediction:



At time tt t, predict the system state at time t+Δtt + \Delta t t+Δt using numerical integration

Calculate predicted energy EpredE_{pred} Epred at that future state



Control Force Calculation:



Calculate energy error: Eerr=Etarget−EcurrentE_{err} = E_{target} - E_{current} Eerr=Etarget−Ecurrent

Calculate future energy error: Eerr,fut=Etarget−EpredE_{err,fut} = E_{target} - E_{pred} Eerr,fut=Etarget−Epred



Asymmetric Control:



When below target energy (Eerr>0E_{err} > 0 Eerr>0):



Apply force in direction of motion: Fi=K⋅∣Eerr∣⋅sign(θ˙i)F_i = K \cdot |E_{err}| \cdot \text{sign}(\dot{\theta}_i) Fi=K⋅∣Eerr∣⋅sign(θ˙i)

Use higher gain for adding energy (K⋅1.5K \cdot 1.5 K⋅1.5 or K⋅2.0K \cdot 2.0 K⋅2.0)



When above target energy (Eerr<0E_{err} < 0 Eerr<0):



Apply force against motion: Fi=−K⋅∣Eerr∣⋅sign(θ˙i)F_i = -K \cdot |E_{err}| \cdot \text{sign}(\dot{\theta}_i) Fi=−K⋅∣Eerr∣⋅sign(θ˙i)

Use lower gain for removing energy (K⋅0.5K \cdot 0.5 K⋅0.5)





Pre-emptive Correction:



If future error is predicted to grow (∣Eerr,fut∣>∣Eerr∣|E_{err,fut}| > |E_{err}| ∣Eerr,fut∣>∣Eerr∣):



Apply additional correction factor: Fi⋅(1+0.5⋅Eerr,fut−Eerr∣Eerr∣)F_i \cdot (1 + 0.5 \cdot \frac{E_{err,fut} - E_{err}}{|E_{err}|}) Fi⋅(1+0.5⋅∣Eerr∣Eerr,fut−Eerr)






Numerical Solution

The system is solved using the Runge-Kutta 4(5) method with adaptive step size:



The state vector consists of: [θ1,θ2,θ˙1,θ˙2][\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2] [θ1,θ2,θ˙1,θ˙2]

At each time step, the derivatives are calculated:



dθ1dt=θ˙1\frac{d\theta_1}{dt} = \dot{\theta}_1 dtdθ1=θ˙1

dθ2dt=θ˙2\frac{d\theta_2}{dt} = \dot{\theta}_2 dtdθ2=θ˙2

dθ˙1dt=f1(θ1,θ2,θ˙1,θ˙2,τ1)\frac{d\dot{\theta}_1}{dt} = f_1(\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2, \tau_1) dtdθ˙1=f1(θ1,θ2,θ˙1,θ˙2,τ1)

dθ˙2dt=f2(θ1,θ2,θ˙1,θ˙2,τ2)\frac{d\dot{\theta}_2}{dt} = f_2(\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2, \tau_2) dtdθ˙2=f2(θ1,θ2,θ˙1,θ˙2,τ2)



These derivatives are used by the RK45 solver to advance the simulation in time while maintaining specified error tolerances.


The result is a double pendulum system that maintains an elevated energy level through intelligent, predictive application of control forces at the optimal moments in the pendulum's motion cycle.