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

an EPIC Light Sail Simulation

  • 5 Devlogs
  • 32 Total hours

an EPIC LightSail Simulation. I am using this simulation for a paper. It simulates the behavior of Light sail, with varying properties of the sail, laser, etc.

Open comments for this post

8h 29m 1s logged

DEVLOG - smth im bad at remembering numbers and its been sometime too

WHATS UP LOVELY PEOPLE Another Nyx devlog it is!

You dont know what Nyx is? Its my light sail simulation for a paper im working on!


I did some code refining and yeah lots of boring stuff.

  • Used the Stefan–Boltzmann equilibrium approximation to estimate local surface temperature.
  • Added a temperature mapping system based on absorbed laser intensity (Absolutely obsolete btw ): )
  • Fixed the paraboloid sign issue so it curved in the intended direction.
    -Also tried using other libraries for rendering, but MatPlotLib is the best option right now
  • other miscellaneous stuff I cant remember honestly

(Next devlog will be more detailed trust)

0
1
20
Open comments for this post

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)

6
1
364
Open comments for this post

4h 8m 44s logged

Devlog 3 - NYX HAS FRIED MY BRAN

btw, if you havent seen my older devlogs, you are legally obligated to do so, and if not done, the police shall come for you

so, after my last devlog, added a new sail geometry, fixed A LOT OF BUGS and made the code efficient (not really) and improved the physics calculation, to a more complex force calculation engine (its not an engine, idk why i said that).

also, i realized paraboloids are pretty niffty as with some dingle dangle, we can have a circular sail without even making a new class!


Features i added

Paraboloid geometry, cleaned up the radiation pressure code, quivers for visualization and better force equation.

the force equation is now
F = fmag * (2*cosTheta*normal - beamDih)
(this is embarrassing, but in my code, the beam direction variable is beamDih)

Whats Next?

  • wanna improve the visualization
  • local force vector rendering
  • time evolution
  • moving sail
  • oscillation simulation
  • ability to upload a .obj file as a sail

(The image below is when i broke the code. i accidentally wrote =+ instead of +=)

0
1
99
Open comments for this post

3h 38m 11s logged

Nyx Devlog #2: The Curved Sail Arc

Status: Nyx V2 Complete
Mood: Sleep-deprived aerospace engineer
Bug Count: We don’t talk about the 90° bug.

So… what happened?

This dev cycle started with a simple goal:

“Let’s add some tilt to the sails.”

Several hours later, we somehow ended up with a computational beam-riding lightsail simulator.

Oops.

Gaussian Beams Are Cool

Nyx uses a Gaussian beam to model the laser intensity distribution.

def gaussian(r):
return I0 * np.exp(-2 * r2 / w02)

Basically:

The beam is strongest at the center.
The farther away you go, the weaker it gets.
Nature decided lasers should have exponential decay because apparently linear wasn’t dramatic enough.
Tilting the Sails

The sails can now rotate about the X and Y axes.

def rotateX(vector, angle):
x, y, z = vector

return np.array([
    x,
    y*np.cos(angle) - z*np.sin(angle),
    y*np.sin(angle) + z*np.cos(angle)
])

def rotateY(vector, angle):
x, y, z = vector

return np.array([
    x*np.cos(angle) + z*np.sin(angle),
    y,
    -x*np.sin(angle) + z*np.cos(angle)
])

This worked surprisingly well.

Unlike the visualization.

Introducing: The Hemisphere™

Rectangle sails were getting lonely.

So Nyx gained a new geometry:

class SphereLightSail():

(Yes, it’s technically a hemisphere. Naming things is hard.)

The hemisphere is discretized into tiny patches that each experience radiation pressure from the laser beam.

Science!

Radiation Pressure Time

Every tiny patch gets hit by photons.

The force magnitude is calculated using:

fmag = (2 * I / c) * (cosTheta**2) * dA

where:

I is beam intensity,
c is the speed of light,
cosTheta accounts for sail orientation,
dA is the patch area.

Translation:

Tiny packets of light aggressively boop the sail.

Torque Has Entered The Chat

Turns out forces acting away from the center like to cause problems.

tau = np.cross(position, F)

Nyx now computes total torque acting on the sail.

This means we can begin asking questions like:

Which geometries are stable?

instead of:

Why is Matplotlib gaslighting me?

Visualization!

Nyx can now visualize sail geometries using 3D plots.

scatter = ax.scatter(
self.xPoints,
self.yPoints,
self.zPoints,
c=self.intensities,
cmap=‘plasma’,
s=30
)

With a colorbar:

fig.colorbar(
scatter,
ax=ax,
label=‘Beam Intensity (W/m^2)’
)

And even a force vector:

ax.quiver(
0, 0, 0,
Force[0], Force[1], Force[2],
color=‘red’,
length=2,
normalize=True
)

It looks surprisingly professional.

Until you rotate it to 90°.

The Great 90° Incident

At one point, Nyx decided that rotating things by 90° was optional.

Several debugging sessions later:

“It’s probably fine.”

Nyx is now operating under the internationally recognized engineering principle of:

If the physics works, Future Me can fix the plotting (ik guys, ELITE mindset).

What Nyx V2 Can Do
Nyx V2
├── Gaussian beam model ✓
├── Rectangle sail geometry ✓
├── Hemisphere sail geometry ✓
├── Sail tilting ✓
├── Radiation pressure forces ✓
├── Torque calculations ✓
├── Intensity heatmaps ✓
└── Force vector visualization ✓

What’s Next?

We’re moving beyond random shapes.

Future geometries need to answer one question:

Could someone actually use this as a lightsail?

Possible candidates:

□ Paraboloids
□ Hyperboloids
□ Other beam-riding geometries from literature

Party hats are currently under review.
Final Thoughts

Nyx V2 was the phase where the project stopped feeling like a collection of scripts and started feeling like an actual research tool.

Also, I now know far more about Matplotlib’s quirks than any human

0
0
14
Open comments for this post

2h 49m 56s logged

#Devlog 001 — The Beginning of Nyx (I call the light sails Nyx, because why not)

Started building the computational simulator for my project on passive beam-riding stability of interstellar lightsails.

What I implemented:
-A Gaussian laser beam model to simulate how beam intensity changes from the center outward.
-A rectangular lightsail simulator divided into tiny surface patches.
-Calculations for net force and net torque acting on the sail.
-Support for changing the sail’s position relative to the beam.
-Support for x-axis and y-axis tilts, allowing the sail to change orientation.
-Validation tests showing that centered sails produce near-zero torque and that results converge with increasing resolution.
-The beginnings of a 3D geometry engine, including a hemispherical lightsail generator using spherical coordinates.
-3D visualization of the hemispherical sail to verify that the geometry was generated correctly.

(Am currently working on the the force and torque calculation for the spherical sails)

(The test cases are for tilted says, the first one is not tilted at all and the last one is tilted 90 degrees)

0
1
58

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…