DEBUG key: /en/osp_introduction
DEBUG locale: sr
DEBUG target: /en/en/osp_introduction
🇬🇧 EnglishOpen-Source Physics (OSP) is a community-driven project, originally supported by the National Science Foundation and the American Association of Physics Teachers, whose goal is to provide free, open-source curricular materials and software tools for teaching and learning physics through computational modeling. compadre.org
Its flagship resources include:
OSP has grown from a simple Java simulation framework into a comprehensive, web-accessible ecosystem of tools for learning and researching physics. Its history mirrors the evolution of educational technology: from desktop Java applications to modern JavaScript cloud-based solutions.
You can create physical-phenomenon simulations as desktop applications in Java, using Swing and AWT for the graphical interface;
this capability has been significantly extended by additional libraries in org.opensourcephysics
.
org.opensourcephysics.display
What it does: Stores and displays a series of points (x, y).
Usage: Use it to “feed” data into a plot and have it automatically drawn on a drawing panel (e.g. PlottingPanel
).
Key methods/features:
add(x, y)
— adds a new data point.clear()
— clears all data.AbstractTableModel
, so the data can be displayed in a Swing table.What it does: A panel for drawing Cartesian plots with axes, title, and multiple datasets.
Usage: The main class for creating 2D plots. Instantiate with axis labels and title, call addDrawable(dataset)
, then render()
or enable automatic refreshing.
Key methods/features:
setPreferredMinMax(xmin, xmax, ymin, ymax)
— manually set axis ranges.createPolarType1(...)
— static constructors for special panel types (polar plot, alternative axis styles).What it does: A general panel for 2D drawing of any Drawable
objects (lines, circles, text, datasets, etc.).
Usage: If you don’t want the full plot frame, you can draw shapes directly by adding Drawable
objects with addDrawable(...)
.
Key methods:
addDrawable(Drawable d)
setPreferredMinMax(...)
clearDrawables()
What it does: A specialized Drawable
that draws the trajectory of a point through a series of steps.
Usage: Ideal for motion simulations where you want to display the path of an object over time.
What it does: A Dataset
that computes values by evaluating a function f(x).
Usage: Use it to plot an analytic function rather than discrete data points.
What it does: A tool for serializing and loading objects to and from XML.
Usage: Enables saving simulation settings, model parameters, or even complete Dataset
/PlottingPanel
instances in human-readable XML files.
What they do: Base classes for solving ordinary differential equations (ODEs).
Usage: In dynamics simulations (e.g., the planetary system or harmonic oscillator) use implementations like RK4
or EulerSolver
, which require you to implement the ODE
interface with getState()
and getRate()
methods.
org.opensourcephysics.numerics.ODE
or a simpler numerical method.Dataset
(or Trail
) objects and add them to a PlottingPanel
.XMLControl
to save/load parameters, connect GUI controls (sliders, buttons) to model variables, and call panel.render()
on each simulation step.Recent Updates:
Community Engagement:
Broader Ecosystem:
Conclusion: OSP remains highly relevant in 2025 as a leading repository for computational physics education. Its tools are actively maintained and evolving (with JS-based versions for modern browsers), thousands of educators worldwide rely on its simulations and video-analysis software, and the community continually contributes new materials and support.
Main Tools & Platforms:
Documentation & Tutorials:
Ready-Made Simulations & Curriculum Units:
Communities & Forums:
Most of today’s new OSP simulations use JavaScript (Web EJS) instead of the legacy Java platform, for several reasons:
org.opensourcephysics
) remain powerful, but development has largely shifted to JS (EJSS, p5.js + ports).Conclusion: Although OSP’s Java libraries are not deprecated, modern simulation development is predominantly in JavaScript. For maximum accessibility and long-term sustainability, focusing on Web EJS/JS solutions is best.