feat(ClassicalMechanics): Newtonian point-particle systems - #1612
feat(ClassicalMechanics): Newtonian point-particle systems#1612RaunakChhatwal wants to merge 2 commits into
Conversation
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
jstoobysmith
left a comment
There was a problem hiding this comment.
Gave some high level comments to start. I think you should look at the other classical mechanics files to see how they have been done.
| variable {d : ℕ} {frame : ReferenceFrame d} | ||
|
|
||
| /-- Positive real numbers. -/ | ||
| notation "ℝ+" => {x : ℝ // 0 < x} |
There was a problem hiding this comment.
We should check, but I think we might already have PosReals defined somewhere
There was a problem hiding this comment.
I don't think there is one. For instance, Positive/Ring.lean uses {x : R // 0 < x} directly. I did narrow the SMul instance for R+ to frame.Vector to minimize redundancy.
| ⟨particle.pos_twice_differentiable h.out |>.left⟩ | ||
|
|
||
| /-- The particle's velocity. -/ | ||
| def vel [_h : Fact (Differentiable ℝ particle.pos)] : Time → frame.Vector := |
There was a problem hiding this comment.
Done, also renamed acc. Though I would like to keep pos abbreviated
| -/ | ||
|
|
||
| /-- A point particle in `frame`. -/ | ||
| structure Particle (frame : ReferenceFrame d) where |
There was a problem hiding this comment.
Would copy the structure of QuantumHarmonicOscillator here. Let Particle contain only the mass (definning the system). Then define ConfigurationSpace for the particles position. Then trajectories are maps from Time to ConfigurationSpace.
There was a problem hiding this comment.
Particle is supposed to represent the properties (i.e. mass and position over time) of an actual particle. It is not a dynamical system by itself, and especially not the unconstrained one-particle lagrangian system. It's meant to constitute Newtonian particle systems in NewtonianSystem/Defs.lean, and I don't think configuration spaces should be involved in a foundation for newtonian mechanics
| -/ | ||
|
|
||
| /-- A finite system of point particles satisfying Newton's laws. -/ | ||
| structure System (d : ℕ) where |
There was a problem hiding this comment.
Would rename this ManyPointParticles or similar, and give it its own directory.
There was a problem hiding this comment.
I would not include "PointParticle" in the name, since that is already the namespace. PointParticle.System should therefore be read as "point-particle system". I moved it to PointParticle/NewtonianSystem/Defs.lean, which is a subfolder of PointParticle because this formalization only applies to point particles and not rigid bodies, continuums, etc.
I mostly see disjoint examples in ClassicalMechanics and not many composable APIs. This PR introduces core data types like particles, forces, and newtonian systems. This will enable models and constraints to be expressed in terms of particles and forces (like in Pendulum/Defs.lean and Pendulum.lean), rather than having to start from a lagrangian derived in comments. -awaiting-author |
|
Sorry, have been a bit busy. Have reached out to others to see if they can review this. But it will likely be Monday before I can return to this. General comment: I think we could expand some of the module doc-string to include the justification behind the definitions in those files. |
Summary
This PR introduces basic definitions for forces and Newtonian point-particle systems in classical mechanics.
Forces
Adds
Force, representing a time-dependent force acting on an object, together with:InternalForce, which additionally records the source of a forceInternalForce.reverse, representing the equal-and-opposite force with source and target exchangednetForce, which sums the internal and external forces acting on a given objectPoint particles
Adds
Particle, consisting of:and defines the associated:
Particles and forces are indexed by the reference frame in which they are described. This makes the frame dependence explicit in the types and prevents accidentally combining positions, velocities, accelerations, or forces expressed in different frames.
Point-particle systems
Adds
PointParticle.System, representing a finite collection of particles in an inertial reference frame, together with internal and external forces.Newton's laws are encoded as properties of a system:
The PR also introduces convenient system-level definitions for:
Finally, the new
ForceandPointParticle.Defsmodules are exported fromPhyslib.lean.