You are browsing as a guest. Sign up (or log in) to start making projects!

rayzchen

@rayzchen

Joined June 19th, 2026

  • 27Devlogs
  • 3Projects
  • 0Ships
  • 0Votes
Open comments for this post

48m 27s logged

Website structure rewrite

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/

0
0
3
Open comments for this post

5h 26m 43s logged

Circular Disks

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

0
0
7
Open comments for this post

5h 24m 56s logged

LaTeX and more simplification

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:

  • Added a label to show kinetic and potential energies (and demonstrating conservation of energy!)
  • Finally implemented combining like terms (3x + 2x = 5x) and like powers (sin(x) * sin(x) = sin^2(x)), which provides a huge speed increase since the equations of motion are now simpler
  • Fixed a BUNCH of bugs that were cropping up under MicroPython (annoyingly CPython’s dict keys in order of assignment is an implementation detail that isn’t in MicroPython, and the hashing function in MicroPython is completely unreliable)
  • Added LaTeX mode for converting expressions into strings, which automatically handles subscripts and symbols
  • Added labels to the diagram also with LaTeX, tweaked for visibility
0
0
38
Open comments for this post

3h 26m 46s logged

Officially brought to web!

I had to wrestle with PyScript for an incredibly long time, but it’s finally running smoothly!

Two big changes to the code are:

  1. micropython support, which runs and loads SO much faster than Pyodide (but meant I had to rewrite itertools.product and np.linalg.solve)
  2. helper classes to create a mechanical system and create energy formulae, which abstracts the math away into much more of an intuitive system!

The code for setting up the system gets simpler and simpler each time…

0
0
11
Open comments for this post

53m 1s logged

PyScript testing

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.

0
0
15
Open comments for this post

1h 33m 40s logged

Better syntax and other tests

The expressions can now be written in a much simpler syntax, making it easier to read! Below is also a test run simulating the angle of a rocking semicircle.

0
0
7
Open comments for this post

46m 47s logged

Optimisations

The old code used to substitute values and perform thousands of simplifications when they weren’t even necessary. Now the values are directly calculated, resulting in much better execution times.

0
0
17
Open comments for this post
Reposted by @rayzchen

25m 34s logged

Basic expression manipulation

The goal of this project is to write a library that can perform symbolic differentiation and solve for an “equation of motion” which can be used to run a simulation.

The code for substituting variables is now complete. Here is a sample of how the substitution works.

0
1
24
Open comments for this post

1h 47m 14s logged

More complicated math

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

0
0
19
Open comments for this post

25m 34s logged

Basic expression manipulation

The goal of this project is to write a library that can perform symbolic differentiation and solve for an “equation of motion” which can be used to run a simulation.

The code for substituting variables is now complete. Here is a sample of how the substitution works.

0
1
24
Open comments for this post

2h 13m 46s logged

Minimap and QoL

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/

0
0
38
Open comments for this post

1h 20m 12s logged

Wrapping

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/

0
0
18
Open comments for this post

2h 51m 20s logged

RLE PATTERN LOADING!

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/

0
0
10
Open comments for this post

32m 56s logged

Performance and UI improvements

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/

0
0
6
Open comments for this post

2h 6m 32s logged

Better controls

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/

0
0
4
Loading more…

Followers

Loading…