Modeling and visualization of linear superposition of sine waves and resultant interference patterns
- Python 3.11.4
- Matplotlib 3.7.2
- Seaborn 0.12.2
- NumPy 1.25.2
The sine wave equation in one-dimension can be represented as:
where:
The superposition principle states that when two or more waves overlap in space,
the resultant wave is the algebraic sum of their individual waves. When two waves
Interference patterns are the result of the superposition of two or more waves. These patterns can be either constructive or destructive depending on the phase and amplitude of the interacting waves.
These patterns can display areas of both constructive and destructive interference, and they are commonly seen in phenomena like double-slit experiments and sound wave interference.
model_sinewave() function
Parameter | Description | Type |
---|---|---|
x | Positions of the wave ( |
numpy.ndarray |
t | Time of evaluation ( |
float |
A | Amplitude ( |
float |
wavelength | Wavelength ( |
float |
frequency | Frequency ( |
float |
phi | Phase offset ( |
float (optional) |
propagation | Propagation direction (x-axis): 'right' for positive, 'left' for negative | string (optional) |
phase_polarity | Phase polarity (y-axis): 'positive' retains form, 'negative' flips the wave vertically | string (optional) |
These parameters can be used to represent the waves in the model:
plot_wave_superposition() function
Parameter | Description | Type |
---|---|---|
wave_1_params |
|
dictionary |
wave_2_params |
|
dictionary |
dark_theme | Dark Theme: If True, uses a dark background for the plot | bool (optional) |
Parameter | Description | ||
---|---|---|---|
A |
|
5.0 | 5.0 |
frequency |
|
90.0 | 90.0 |
wavelength |
|
10.0 | 10.0 |
phi |
|
0.0 | 0.0 |
propagation | Propagation direction | right | left |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
5.0 | 5.0 |
frequency |
|
10.0 | 20.0 |
wavelength |
|
4.0 | 5.0 |
phi |
|
0.0 | 0.0 |
propagation | Propagation direction | right | right |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
10.0 | 5.0 |
frequency |
|
90.0 | 90.0 |
wavelength |
|
10.0 | 10.0 |
phi |
|
0.0 | 0.0 |
propagation | Propagation direction | right | right |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
10.0 | 5.0 |
frequency |
|
90.0 | 90.0 |
wavelength |
|
10.0 | 10.0 |
phi |
|
0.0 | |
propagation | Propagation direction | right | right |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
10.0 | 10.0 |
frequency |
|
90.0 | 90.0 |
wavelength |
|
10.0 | 10.0 |
phi |
|
0.0 | |
propagation | Propagation direction | right | right |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
5.0 | 2.5 |
frequency |
|
90.0 | 180.0 |
wavelength |
|
4.0 | 2.0 |
phi |
|
0.0 | 0.0 |
propagation | Propagation direction | right | right |
phase_polarity | Phase polarity (y) | positive | positive |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |
Parameter | Description | ||
---|---|---|---|
A |
|
10.0 | 5.0 |
frequency |
|
90.0 | 110.0 |
wavelength |
|
6.0 | 10.0 |
phi |
|
0.0 | 0.0 |
propagation | Propagation direction | right | left |
phase_polarity | Phase polarity (y) | positive | negative |
Parameter | Description | Value |
---|---|---|
dark_theme | Dark Theme | True |