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

12h 46m 19s logged

Devlog - 4

YO PEOPLE, i am BACK (ts so cringe. literally nobody cares). This devlog is about how almost lost my minds migrating my simulation’s rotation calculations into Quaternions, integrating RK4 and as always solving bugs, because Nyx is filled with bugs

(Oh, you dont know what Nyx is? well it is my passive beam riding light sail simulation, for a research paper im working on)


Euler Angles Started Tweaking

Ok so before this, Nyx used normal Euler angle rotations using thetaX and thetaY for orientation. At first it worked fine, but after longer simulations stuff started tweaking hard The sphere and paraboloid would randomly start flattening into weird pancake/disc things (which i lowkey think might be cuz matplotlib library hates me idk), rotations started looking cursed, and the orientation slowly became unstable over time. At first I thought matplotlib was just being goofy again, but nah, the actual orientation system itself was kinda cooked (most likely). The problem was that Euler angles are not really built for stable continuous 3D rotational dynamics. Rotations started interfering with each other and the geometry would slowly drift into nonphysical states during longer simulations.Basically Nyx had reached the point where the old orientation system just wasn’t enough anymore :(.

Quaternion Migration (The Pain of ’26 )
So yeah, this devlog was basically the “quaternion suffering” update I replaced the entire orientation system with quaternions. Instead of storing orientation as separate thetaX and thetaY values, Nyx now stores orientation as a quaternion state directly integrated through RK4.This was honestly one of the biggest upgrades to the simulator so far because now orientation itself is physically simulated instead of just being fake angle accumulation and stuff. The migration was WAY more painful than expected At first literally everything exploded: infinitiesNaNsbroken, normals-cursed, and sphere geometry intensity overflows. At one point the simulator straight up started generating inf values and the sphere looked like it got compressed by a hydraulic press .The biggest issue ended up being invalid normal vectors inside the sphere mesh generation. A single broken normal could completely destroy the intensity calculations and then infect the entire simulation state with NaNs.After fixing all that, Nyx now has stable quaternion orientation. quaternion vector rotation, quaternion RK4 integration, much more stable rotational dynamics, no more gimbal-lock-type weird ahh stuff .
This was really hard for me to add lol

now what ?

so thats what took more than 10 hours. I think my boi Nyx is doing pretty good and will help me in great magnitude for my research paper. For now at least, i wanna make a sort of UI and replace ‘matplotlib’ with smth better cuz’ I am lowkey fed up. I would also like to add a feature of mass data collection, so that there is much data to study.


that’s it for me today, I hope YOU have a great day!

(BTW, i have no idea why the markdown on this devlog is so weird, i can not seem to fix it lowkey)

1
357

Comments 6

@Samriddhi

godd!! i lovee nerds

@Niamh

This is actually so awesome

@YodaheWondimu

Switching from Euler to RK4 integration is ELITE ball knowledge

@dan

Very interesting project! Will be following.

@f

peak bro keep going!!

@water

cool project twin!!! keep it going!