## Archive of posts with tag “hamiltonian”

### Simulating a mechanical system using rpg_core.js

Continuing my last work of simulating a mechanical system using RGSS3, I made a new version using rpg_core.js, the game scripting system shipped with RPG Maker MV. This version is live on web!

- Categories: physics
- Tags: javascript, rgss, hamiltonian, calculus, ode

### Simulating a mechanical system using RGSS3

Hamiltonian mechanics gives us a good way to simulate mechanical systems as long as we can get its Hamiltonian and its initial conditions. I implemented this simulation in RGSS3, the game scripting system shipped with RPG Maker VX Ace.

### Use complex numbers as canonical variables

In this article, I try exploring an idea: using complex numbers to combine pairs of canonical variables into complex variables: $\mathbf c:=\alpha\mathbf q+\mathrm i\beta\mathbf p$. It turns out that we can write canonical equations $\frac{\mathrm d\mathbf c}{\mathrm dt}=-2\mathrm i\alpha\beta\frac{\partial\mathcal H}{\partial\mathbf c^*}$, Poisson brackets $\left\{f,g\right\}=-2\mathrm i\alpha\beta \left(\frac{\partial f}{\partial\mathbf c}\cdot \frac{\partial g}{\partial\mathbf c^*}- \frac{\partial f}{\partial\mathbf c^*}\cdot \frac{\partial g}{\partial\mathbf c}\right)$, and canonical transformations $\frac{\partial\mathbf c^*}{\partial\mathbf c’^*}= \frac{\partial\mathbf c’}{\partial\mathbf c}, \frac{\partial\mathbf c}{\partial\mathbf c’^*}= -\frac{\partial\mathbf c’}{\partial\mathbf c^*}$ in these complex numbers. Finally, I show two examples of using them in real problems: a free particle, and a harmonic oscillator.

- Categories: physics
- Tags: classical mechanics, canonical transformation, hamiltonian, complex, long paper