More simulations
New simulations added:
- Swinging Atwood Machine
- Ball on Slope
- Simple Pendulum
Temporary deployments can be found at https://rayzchen.github.io/mechsim/
New simulations added:
Temporary deployments can be found at https://rayzchen.github.io/mechsim/
To make adding new simulations easier, I restructured the file layout and added more dynamic code to the shared JS to create the elements required rather than copy pasting everything in every file. Also added labels to the tab title and bottom right corner. Also rewrote the drawing code for the rolling disk to add more details.
Temporary deployments can be found at https://rayzchen.github.io/mechsim/disk/
This system contains a semicircular anulus rocking on a rough plane, with a circular disk inside attached to a compound pendulum, and constrained with three springs. Adjusting the parameters took an awfully long time…
Temporary deployments can be found at https://rayzchen.github.io/mechsim/disk.html
After much headache, two new constraints have been implemented: disk rolling on a plane and disk rolling in a circle. There were also lots of bugs in the LaTeX output, which I just kept encountering one by one, but hopefully they should now all be fixed.
Temporary deployments can be found at https://rayzchen.github.io/mechsim/disk.html
Temporary deployments can be found at https://rayzchen.github.io/mechsim/pend.html
This devlog was supposed to be two separate ones, but Stardance was refusing to calculate logged hours :(
There’s a big list of changes here:
I had to wrestle with PyScript for an incredibly long time, but it’s finally running smoothly!
Two big changes to the code are:
The code for setting up the system gets simpler and simpler each time…
Spent some time reading through the documentation of PyScript (https://pyscript.net/) to see how well the code will run in the browser. Got the double pendulum code to run in the browser, and I will start writing a full demo soon.
I have implemented a class that handles solving, susbtitution and iteration of a system from the lagrangian and tested it with a pendulum-cart setup like the one found at https://www.myphysicslab.com/pendulum/cart-pendulum-en.html.
The solver can now handle sin and cos, as well as expanding brackets! Also added the equation of motion solver to obtain a value for acceleration. Tested with a different rendering tool with a double pendulum setup.
I will eventually create my own simulation using more math and rendering, this window is not part of the project.
TODO: collecting like terms and cancelling down, optimising value substitution
The symbol engine is now capable of performing partial differentiation with respect to any variable, allowing the use of Euler-Lagrange to form differential equations. See https://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation
After a few busy days at work, I’ve finally made progress on AlGOL! A minimap of the current viewing area appears when the map is dragged or zoomed, it can be toggled and adjusts according to wrapping.
Also added zoom hotkeys that zoom precisely on the centre for ease of access.
Temporary deployments can be found at https://rayzchen.github.io/algol/
There is now an option to enable/disable grid wrapping, so cells on the edge of the map will die off. Produces interesting results!
Also added a button to reset the view to the middle of the map in case the user gets lost in the unwrapped grid.
Temporary deployments can be found at https://rayzchen.github.io/algol/
There are three default patterns that can be loaded into the map: glider, glider gun, and breeder1 (a glider gun breeder). The map has been expanded to 2048x2048 which may have terrible performance at faster simulation speeds :(
Color themes have also been added (currently only blue/green or black/white).
Temporary deployments can be found at https://rayzchen.github.io/algol/
Rendering is now disabled when the simulation is paused, which makes moving around really smooth!
The side panel now shows the current zoom level and some keybinds for the buttons.
Temporary deployments can be found at https://rayzchen.github.io/algol/
The slider now has larger segments for more common speeds (1-5 frames per second, 1-5x speed) for better usability, and now there’s a play/pause button and a step button to view individual generations!
https://www.desmos.com/calculator/3ipfxfsmlu contains some of the math for the slider
Temporary deployments can be found at https://rayzchen.github.io/algol/