This application provides an interactive demonstration of conservative versus non-conservative forces by simulating a particle moving between the same two endpoints, ( $r_0, 0$ ) and ( $0, r_0$ ), along two distinct paths: a quarter-circle (Path A) and a straight line (Path B). The user can toggle between a rotational, non-conservative force $F=k(-y \hat{i}+x \hat{j})$, which results in path-dependent work ( $W_A \approx 1767.15 J$ versus $W_B=1125.00 J$ ), and a conservative spring-like force $F=-k(x \hat{i}+y \hat{j})$. The simulation confirms the principles of conservative fields by showing that for the spring force, the work done is 0 J along both paths, as it only depends on the negative change in potential energy, which is zero since the particle starts and ends at the same radial distance $r_0$.
In a non-conservative system, work is path-dependent, meaning the total energy dissipated depends on the entire distance traveled rather than the final displacement. Unlike conservative forces like gravity, where a round trip results in zero work, non-conservative forces like friction continuously "drain" energy from the system, causing the work accumulation value to grow regardless of the path's shape. Consequently, a circular path results in a high accumulation of work—representing heat or sound—while a straight path minimizes this loss; this makes the accumulation panel function like an odometer that tracks the total "cost" of the journey's entire history.
This Python simulation visualizes the relationship between potential surfaces and path-independent work by modeling a parabolic "hill" and its associated force field. It compares a direct straight-line path (which cuts across elevation contours) with a circular arc path (which follows a constant elevation) as they move between two points of equal potential. By calculating the line integral $W=\int F \cdot d r$ in real-time, the demo provides a dual 3D and 2D perspective that proves the field is conservative: despite the differing trajectories and varying instantaneous forces, the total work for both paths remains identical (zero), demonstrating that work in such a field depends solely on the start and end points.
The state diagram illustrates the purposeful transitions between the two examples and four demos described in the sources, moving from identifying non-conservative forces to visualizing path-independent potential surfaces.
stateDiagram-v2
state "Demo 1: Fundamental Comparison" as D1
state "Example 1: Mathematical Correction" as E1
state "Demo 2: Field Visualization" as D2
state "Demo 3: Enhanced Data Observation" as D3
state "Example 2: Potential Surface Concept" as E2
state "Demo 4: 3D Gradient Study" as D4
[*] --> D1 : Observe path-dependence
D1 --> E1 : Seek a path-independent 'twin'
E1 --> D2 : Visualize Vortex vs. Radial fields
D2 --> D3 : Improve UI for work accumulation clarity
D3 --> E2 : Conceptualize fields as topographic 'Hills'
E2 --> D4 : Demonstrate 3D path independence
D4 --> [*]
‣