- Home
- Skills
- Frontend & Web Apps
- Computational Physics Ts
More screenshots
Works with the AI Agents you already use
Computational Physics Ts
by Andres Lopez
Build stable, scientifically accurate physics engines in TypeScript that work perfectly in any browser.
$4
What it does
- Architects physics engines in TypeScript that keep math separate from visual code
- Uses real-world SI units to ensure calculations match physical reality
- Prevents particles from spiraling out of control using stable math integrators
- Fixes simulation speed so it runs the same on every monitor and refresh rate
- Provides templates for complex math like magnetic dipoles and spherical flux
- Guards against math errors like dividing by zero or infinite energy gains
Who it's for
Developers building web-based physics simulations
Build accurate, stable physics engines in TypeScript that work perfectly across different screen refresh rates.
Try asking: “Build a magnetic field simulator in TypeScript using the Boris Pusher method.”
Science educators creating interactive lab tools
Create virtual experiments that follow real physics laws without mathematical errors or "magic" energy gains.
Try asking: “Create a simulation of particles moving through an electric field with SI units.”
Engineers prototyping numerical solvers in the browser
Implement high-accuracy math for fields and particles without fighting UI framework bugs.
Try asking: “Write a function to calculate magnetic flux over a disk using Gauss-Legendre quadrature.”
Computational Physics Ts
Example session with this skill installed
Help me build a TypeScript engine for a particle moving in a magnetic field. It needs to be accurate and not fly off the screen.
- Read your context and instructions
- Compiled the computational physics ts
I will help you architect a stable physics engine for magnetic trajectories using
TypeScript and the
Symplectic Boris Pusher method. This approach ensures that the particle's energy stays correct and it doesn't spiral away due to math errors.
1. Project Structure
We will put all physics logic in a src/physics/ folder. This code will be "pure," meaning it won't know anything about React or your HTML Canvas. It will only deal with numbers and vectors.
2. Physical Constants
We will use exact SI units to keep the simulation realistic:
- Vacuum Permeability (MU_0):
1.256637e-6 - Time Step: We will use a fixed step (e.g., 0.001s) to keep it stable.
3. The Boris Pusher Implementation
Instead of the usual "velocity += acceleration" (which is unstable for magnets), I will implement the
Boris Pusher. This method handles the circular rotation of particles in magnetic fields with high precision.
// Example of the stable update step
export function borisStep(particle: Particle, dt: number, field: Vector3D) {
// 1. Half-step electric push
// 2. Magnetic rotation (the Boris rotation)
// 3. Final half-step electric push
// 4. Update position
}
4. Next Steps
- Do you want to define a specific magnetic field shape, like a simple bar magnet?
- Should I write the code to convert your "meters" into "pixels" for your display?
- Would you like the loop that ensures the simulation runs at the same speed on all monitors?
I am ready to generate the Vector3D interfaces and the core solver whenever you are.
Connects securely to your tools. The creator never sees your data.
About this skill
When you build physics simulations for the web, typical coding tricks often break the laws of science. Particles might gain "fake" energy and fly off screen, or the simulation might run at different speeds on different monitors. This skill helps your AI agent architect and write TypeScript code for physics engines that are mathematically accurate and stable.
How it works
- You describe the physical system you want to simulate, like a planet's magnetic field or a particle accelerator.
- The skill guides your AI agent to separate the math from the visuals, ensuring the physics stays "pure" and independent of your UI.
- Your AI agent writes the specific math functions needed, such as solvers that prevent numerical drift or tools for measuring field strength.
- You receive clean TypeScript code that uses real-world units and stays stable over time.
Frameworks & tools
This skill focuses on pure TypeScript and SI units. It provides strategies for integrating with browser APIs like requestAnimationFrame and tools for numerical integration.
Why this beats prompting it yourself
Standard AI prompts often produce "game physics" which looks okay but fails real science tests. This skill forces the use of specific high-accuracy methods like the Boris Pusher or RK4, which stop particles from spiraling out of control. It also ensures the simulation speed is the same on a 60Hz or 144Hz screen by using a fixed-timestep approach.
Use cases
- Building a browser-based lab for electromagnetism or plasma physics.
- Creating an interactive tool to visualize 3D magnetic field lines.
- Developing a simulation of charged particles in a vacuum.
- Calculating complex integrals for surfaces or loops in a web app.
Known limitations
This skill handles the math and logic, not the 3D rendering or GPU shaders. It assumes a basic understanding of vector math.
Implements Symplectic Boris Pusher, Runge-Kutta 4 (RK4), and Gauss-Legendre quadrature in TypeScript. Uses fixed-timestep accumulators to decouple simulation logic from requestAnimationFrame. Enforces strict UI/Physics isolation and SI unit consistency. Includes regularization strategies for 1/r^2 and 1/r^3 singularities.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in Frontend & Web Apps
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.