Skip to content

16Rohan/interactivesims

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Simulations

This project provides a comprehensive collection of interactive simulations designed to explore fundamental concepts across Physics, Chemistry, Biology, and Mathematics. Each simulation offers a hands-on approach to understanding complex theoretical principles through dynamic visualization and adjustable parameters. The goal is to foster intuitive learning and allow users to experiment with various scientific phenomena.

How to Run the Application

To run this application, you need a Java Development Kit (JDK) compatible with JavaFX. The project is set up to be compiled and run using standard Java commands.

  1. Compile the Source Code: Open your terminal or command prompt in the project's root directory and execute the following command to compile all Java source files:

    javac -d bin --module-path lib --add-modules javafx.controls,javafx.fxml,javafx.graphics -cp "lib/json-20231013.jar;lib/commons-math3-3.6.1.jar" src/app/*.java src/core/*.java src/sims/conway/*.java src/sims/doublependulum/*.java src/sims/gasmolecules/*.java src/sims/gravity/*.java src/sims/population/*.java src/sims/probabilistic/*.java src/sims/quantum/*.java src/sims/radioactivedecay/*.java src/ui/*.java
  2. Run the Application: After successful compilation, run the application using the following command:

    java --module-path lib --add-modules javafx.controls,javafx.fxml,javafx.graphics -cp "bin;lib/json-20231013.jar;lib/commons-math3-3.6.1.jar" app.Main

Simulations Overview

The application features a variety of simulations, each with its unique interactive elements and educational focus.

Conway's Game of Life

  • Description: Conway's Game of Life is a zero-player game, meaning its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
  • Author: Rohan

Concepts Illustrated

  • Emergence: Complex patterns and behaviors (like 'gliders' or 'spaceships') arise from a very simple set of rules. This demonstrates how complexity can emerge from simplicity.
  • Turing Completeness: It has been proven that the Game of Life is Turing complete, meaning it can theoretically compute anything a universal computer can, given a large enough grid and a complex enough starting pattern.

Controls/Parameters

  • Initial State: The starting configuration of live and dead cells. The entire future of the simulation depends solely on this initial pattern.
  • Speed: Controls the rate at which generations are calculated and displayed.

Double Pendulum Simulation

  • Description: A double pendulum demonstrates chaotic motion: a simple system with complex, unpredictable behavior highly sensitive to initial conditions, illustrating chaos theory.
  • Author: Rohan

Concepts Illustrated

  • Chaos Theory: The study of systems where small changes in starting conditions can lead to vastly different outcomes. The double pendulum is deterministic (follows fixed laws) but unpredictable over long periods.
  • Sensitivity to Initial Conditions: Also known as the 'Butterfly Effect'. Even a minuscule change in the starting angle of an arm will result in a completely different trajectory after a short time.
  • Phase Space: A way to visualize the state of the system. A plot of angle vs. angular velocity reveals the complex, non-repeating patterns of the pendulum's motion.

Controls/Parameters

  • Masses (m1, m2): Changing the mass distribution affects the inertia and energy of the system, altering its oscillatory patterns.
  • Lengths (L1, L2): The lengths of the arms are critical to the pendulum's period and stability. Different length ratios can produce dramatically different behaviors.

Gas Molecules Simulation

  • Description: This simulation demonstrates the Kinetic Theory of Gases, which explains the macroscopic properties of a gas (pressure, temperature, volume) as a consequence of the motion of its microscopic molecules.
  • Author: Rohan

Concepts Illustrated

  • Temperature: Temperature is not 'heat', but a measure of the average kinetic energy (½mv²) of the molecules. Higher speed means higher temperature.
  • Pressure: Pressure is the force exerted by the gas on the container walls. It is caused by the constant, collective impact of billions of molecules colliding with the walls.
  • Ideal Gas Law (PV=nRT): Observe the relationships: decreasing volume increases pressure (if temperature is constant). Increasing temperature increases pressure (if volume is constant).

Controls/Parameters

  • Number of Particles: Increasing the number of particles in a fixed volume increases the frequency of wall collisions, thus increasing the pressure.
  • Average Speed: Increasing the speed of particles increases both the frequency and the force of wall collisions, dramatically increasing both temperature and pressure.

Gravity Simulation

  • Description: An n-body simulator that models the gravitational attraction between objects. This simulation allows you to explore the fundamental principles of orbital mechanics that govern everything from planets and stars to entire galaxies.
  • Author: Rohan

Concepts Illustrated

  • Newton's Law of Universal Gravitation: Every particle attracts every other particle with a force proportional to the product of their masses and inversely proportional to the square of the distance between their centers.
  • Orbital Mechanics: Observe how initial velocity is key. Too slow, and a planet crashes into its star. Too fast, and it escapes orbit. Just right, and it forms a stable elliptical or circular orbit.
  • Conservation of Energy/Momentum: In a closed system, the total energy and momentum remain constant. This can be observed as planets speed up when they are closer to a star and slow down when they are farther away.

Controls/Parameters

  • Gravitational Constant (G): This fundamental constant determines the 'strength' of gravity. Increasing it makes orbits tighter and faster.
  • Mass: The primary factor in gravitational attraction. More massive objects exert a stronger pull, and are harder to move.
  • Initial Velocity: The 'sideways' motion that prevents an object from falling directly into another. This is what creates orbits.

Population Simulation

  • Description: This agent-based model simulates population dynamics from the ground up. By defining simple rules for individual organisms, we can observe complex, emergent population-level behaviors like growth, stability, and collapse.
  • Author: Rohan

Concepts Illustrated

  • Exponential Growth: In an environment with unlimited resources, the population will grow exponentially as each organism reproduces. This is visible in the early stages of the simulation.
  • Carrying Capacity: The maximum population size that the environment can sustain indefinitely, given the available resources (food). The population will tend to oscillate around this level.
  • Resource Scarcity: When the population grows too large, it consumes food faster than it spawns. This leads to starvation and a population decline, demonstrating the principle of environmental limits.

Controls/Parameters

  • Reproduction Threshold: A lower threshold means easier reproduction, leading to faster population booms but also a higher risk of resource depletion and collapse.
  • Food Spawn Rate: This directly determines the environment's carrying capacity. A higher rate will support a larger stable population.

Probabilistic Model

  • Description: The normal distribution, also known as the Gaussian distribution, is a probability distribution that is symmetric about the mean, showing that data near the mean are more frequent in occurrence than data far from the mean.
  • Author: Darshit

Concepts Illustrated

  • Mean (μ): The central point of the distribution. It defines the location of the peak of the bell curve.
  • Standard Deviation (σ): A measure of the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the mean, while a high standard deviation indicates that the values are spread out over a wider range.

Controls/Parameters

  • Mean: Set the average value for the distribution.
  • Standard Deviation: Set the spread of the curve. Must be a positive number.
  • Samples: The number of points to calculate along the curve for plotting. Higher values result in a smoother curve.

Quantum Simulation

  • Description: Quantum tunneling is a quantum mechanical phenomenon where a wavefunction can propagate through a potential barrier. It has important applications in nuclear fusion, scanning tunneling microscopes, and flash memory.
  • Author: Deekshita

Concepts Illustrated

  • Wave-Particle Duality: Particles like electrons exhibit wave-like properties. The simulation shows the evolution of the particle's probability wave (wavefunction) over time.
  • Potential Barrier: A region of high potential energy that, in classical mechanics, a particle could not pass if its energy is lower than the barrier's height. In quantum mechanics, there is a non-zero probability for the particle to 'tunnel' through.

Controls/Parameters

  • Barrier Height: Controls the energy level of the potential barrier. Higher barriers are harder to tunnel through.
  • Wave Momentum: Related to the energy of the incoming wave packet. Higher energy packets have a greater probability of tunneling.

Radioactive Decay Simulation

  • Description: A 3D simulation demonstrating the probabilistic nature of radioactive decay, visualizing atoms decaying over time based on their half-life.
  • Author: Ahad

Concepts Illustrated

  • Radioactive Decay: The process by which an unstable atomic nucleus loses energy by emitting radiation. This simulation models the decay as a probabilistic event.
  • Half-Life: The time required for a quantity of a radioactive isotope to fall to half its original value. This simulation allows adjustment of the half-life.
  • Probabilistic Nature: Individual decay events are random, but the overall decay of a large number of atoms follows a predictable exponential curve.

Controls/Parameters

  • Half-Life: Controls the rate at which atoms decay. A shorter half-life means faster decay.
  • Simulation Speed: Adjusts the speed at which the simulation time progresses, affecting how quickly decay events are processed.
  • Randomize Shape: Generates a new random initial configuration of atoms.

Theme Switching

The application supports light and dark themes. You can toggle between themes to observe how each simulation adapts its visual elements and controls to the selected theme.

Dependencies

  • JavaFX: For the graphical user interface.
  • json-20231013.jar: For JSON parsing.
  • commons-math3-3.6.1.jar: For mathematical utilities (used in Probabilistic Simulation).

About

This project project provides the user with a simple, light-weight and user friendly application to explore different concepts in the domains of mathematics, physics, chemistry and biology. This project was a submission to Innovasia 2025, a hackathon hosted by Vasavi College of Engineering. The ".vscode" folder was included for compatibility.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors