Skip to content

Commit ce64df7

Browse files
committed
Fixed some bugs and features
1 parent 54afc3b commit ce64df7

9 files changed

Lines changed: 389 additions & 140 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "symulacja_fali"
3-
version = "1.2.0-beta"
3+
version = "1.2.1-beta"
44
edition = "2024"
55

66
[dependencies]

instructions/doppler_en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"id": "doppler_effect",
33
"name": "🚗 Doppler Effect & Mach Cones",
44
"lang": "en",
5-
"intro": "Explore how wave frequency changes when the source (or medium) is in motion. This lab covers the Doppler shift and supersonic shockwaves (Mach cones).",
6-
"theory": "The Doppler Effect is the change in frequency of a wave in relation to an observer who is moving relative to the wave source.\n\n>> THE MECHANISM:\nIn this simulation, we simulate a 'moving medium' (Flow Velocity). This is physically equivalent to the source moving through a stationary fluid.\n\n1. IN FRONT (Approaching):\nWaves get compressed. The wavefronts bunch up.\nResult: Shorter Wavelength (λ') -> Higher Pitch/Frequency.\n\n2. BEHIND (Receding):\nWaves get stretched out.\nResult: Longer Wavelength (λ') -> Lower Pitch/Frequency.\n\n>> SUPERSONIC (Mach Cones):\nWhen the source moves faster than the waves (v_flow > v_wave), the wavefronts pile up to form a conical shockwave. This is the 'Sonic Boom'.",
5+
"intro": "This experiment demonstrates the Doppler Effect and supersonic flow effects. You will see how moving sources create frequency shifts and Mach cones in the supersonic regime.",
6+
"theory": "The Doppler Effect is the change in frequency and wavelength of waves when the source or observer moves relative to the medium. This is one of the most important phenomena in physics, affecting sound, light, radar, medical imaging, and astronomy.\n\n>> FUNDAMENTAL PRINCIPLE:\nWaves propagate at a constant speed (v) through their medium. The frequency observed depends on the relative motion between source and observer.\n\nKey relationship: v = f × λ. If v is constant but the source moves, then f and λ must change.\n\n>> DETAILED MECHANISM - THREE REGIONS:\n\n[1] IN FRONT OF MOVING SOURCE (Compression Side):\n• The source chases its own wavefronts\n• Wavefronts get compressed together\n• Distance between crests decreases: λ' < λ\n• Observer measures higher frequency: f' > f\n• Formula: f_observed = f × [v / (v - v_source)]\n• Example: ambulance siren sounds higher-pitched approaching\n\n[2] BEHIND THE SOURCE (Stretching Side):\n• Source moves away from previous wavefronts\n• Wavefronts get pulled apart\n• Distance between crests increases: λ' > λ\n• Observer measures lower frequency: f' < f\n• Formula: f_observed = f × [v / (v + v_source)]\n• Example: ambulance siren sounds lower-pitched receding\n\n[3] PERPENDICULAR MOTION:\n• At points to the side, motion is purely tangential\n• Minimal frequency shift compared to front/back\n• Creates characteristic 'drop' as vehicle passes\n\n>> ENERGY REDISTRIBUTION:\n• Front: Waves compressed, amplitude increases\n• Back: Waves stretched, amplitude decreases\n• Total energy increases (source does work against wavefronts)\n\n>> MACH REGIMES:\n\n[SUBSONIC] (v_source < v_wave, Mach < 1):\n• Source slower than waves\n• Wavefronts spread ahead of source\n• Normal Doppler effect\n• Observer has warning before source arrives\n\n[TRANSONIC] (v_source = v_wave, Mach = 1):\n• Source exactly matches wave speed\n• Wavefronts cannot escape ahead\n• Massive amplitude buildup at source (Sound Barrier)\n\n[SUPERSONIC] (v_source > v_wave, Mach > 1):\n• Source outruns its own disturbances\n• Forms conical shock wave behind (Mach cone)\n• Cone angle: sin(θ) = 1 / Mach_number\n• Concentrated energy creates sonic boom\n• Zone of silence outside cone (waves haven't arrived)\n\n>> MACH CONE GEOMETRY:\nCone half-angle θ determined by:\n• M = 1.0 -> θ = 90° (flat shock, sound barrier)\n• M = 2.0 -> θ = 30°\n• M = 3.0 -> θ = 19.5°\n• Higher speed = narrower cone\n• Energy concentrated on cone surface\n\n>> REAL-WORLD APPLICATIONS:\n\n1. ASTRONOMY: Redshift/Blueshift of distant galaxies (cosmic expansion)\n2. MEDICAL IMAGING: Doppler ultrasound measures blood velocity\n3. RADAR: Police speed guns use Doppler shift of radio waves\n4. WEATHER: Doppler radar detects storm motion and wind velocity\n5. MUSIC: Moving sources affect pitch; Doppler used in electronic music\n6. PARTICLE PHYSICS: Relativistic particles create frequency shifts\n\n>> DEEP INSIGHTS:\nDoppler effect is consequence of finite wave speed. Different media (air vs water vs vacuum) show different shifts. For light at relativistic speeds, special relativity required for accurate calculations. Asymmetric frequency shift between approaching/receding at extreme velocities.\n",
77
"equations": "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ DOPPLER SHIFT FORMULAS ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ Source Speed: vs (Flow Velocity) ┃\n┃ Wave Speed: v (10.0 default) ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ WAVELENGTH CHANGE ┃\n┃ Front: λ' = (v - vs) / f ┃\n┃ Back: λ' = (v + vs) / f ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ FREQUENCY CHANGE (Observed) ┃\n┃ Front: f' = f * [v / (v - vs)] ┃\n┃ Back: f' = f * [v / (v + vs)] ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ SUPERSONIC (vs > v) ┃\n┃ Mach Number: M = vs / v ┃\n┃ Cone Angle: sin(θ) = 1 / M ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛",
88
"parameters": [
99
{
@@ -22,7 +22,7 @@
2222
"steps": [
2323
{
2424
"title": "=== STEP 1: INITIAL SETUP ===",
25-
"detail": "1. Reset the simulation.\n2. Set Standard Parameters:\n Wave Speed: 10.0\n Damping: 0.1 (Low damping helps see the cone)\n Frequency: 2.0 Hz\n\n3. Place a single source in the CENTER of the screen."
25+
"detail": "1. Reset the simulation.\n2. Set Standard Parameters:\n Wave Speed: 10.0\n Damping: 0.1 (Low damping helps see the cone)\n Frequency: 1.5 Hz (gives stable wavelength = 6.7 px)\n\n3. Place a single source in the CENTER of the screen."
2626
},
2727
{
2828
"title": "=== STEP 2: SUBSONIC MOTION (Half Speed) ===",

instructions/doppler_pl.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"id": "doppler_effect",
33
"name": "🚗 Efekt Dopplera i Stożki Macha",
44
"lang": "pl",
5-
"intro": "Zbadaj, jak zmienia się częstotliwość fali, gdy źródło (lub ośrodek) jest w ruchu. To ćwiczenie obejmuje przesunięcie Dopplera i naddźwiękowe fale uderzeniowe (stożki Macha).",
6-
"theory": "Efekt Dopplera to zmiana częstotliwości fali w stosunku do obserwatora, który porusza się względem źródła fali.\n\n>> MECHANIZM:\nW tej symulacji symulujemy 'ruchomy ośrodek' (Prędkość Przepływu). Jest to fizycznie równoważne poruszaniu się źródła przez nieruchomy płyn (np. powietrze).\n\n1. Z PRZODU (Zbliżanie):\nFale są ściskane. Czoła fal gromadzą się blisko siebie.\nWynik: Krótsza Długość Fali (λ') -> Wyższy Ton/Częstotliwość.\n\n2. Z TYŁU (Oddalanie):\nFale są rozciągane.\nWynik: Dłuższa Długość Fali (λ') -> Niższy Ton/Częstotliwość.\n\n>> NADDŹWIĘKOWE (Stożki Macha):\nGdy źródło porusza się szybciej niż fale (v_przepływu > v_fali), czoła fal nakładają się na siebie, tworząc stożkową falę uderzeniową. To jest 'Grom Dźwiękowy' (Sonic Boom).",
5+
"intro": "Ten eksperyment demonstruje Efekt Dopplera i efekty przepływu naddźwiękowego. Zobaczysz, jak poruszające się źródła tworzą przesunięcia częstotliwości i stożki Macha w reżimie naddźwiękowym.",
6+
"theory": "Efekt Dopplera to zmiana częstotliwości i długości fali, gdy źródło lub obserwator porusza się względem ośrodka. To zjawisko wpływa na dźwięk, światło, radar, medycynę i astronomię.\n\n>> ZASADA FUNDAMENTALNA:\nFale rozchodzą się ze stałą prędkością v. Związek v = f × λ musi być zachowany, więc ruch źródła zmienia f i λ.\n\n>> MECHANIZM - TRZY REGIONY:\n\n[1] PRZED ŹRÓDŁEM (Ściskanie):\n• Źródło goni własne czoła fali\n• Czoła kompresują się\n• λ' < λ, f' > f\n\n[2] ZA ŹRÓDŁEM (Rozciąganie):\n• Źródło oddala się od czół fali\n• Czoła rozciągają się\n• λ' > λ, f' < f\n\n[3] RUCH PROSTOPADŁY:\n• Efekt najmniejszy\n• Powoduje charakterystyczny skok tonu przy przejeździe\n\n>> ENERGIA:\n• Przód: większa amplituda (kompresja)\n• Tył: mniejsza amplituda (rozciąganie)\n\n>> LICZBA MACHA I STOŻEK MACHA:\n\n[PODDŹWIĘKOWE] Mach < 1: normalny efekt Dopplera\n[PRZEZZWIĘKOWE] Mach = 1: bariera dźwięku\n[NADDŹWIĘKOWE] Mach > 1: stożek Macha, grom dźwiękowy\n\nKąt stożka: sin(θ) = 1 / M\n• M = 2 -> θ = 30°\n• M = 3 -> θ ≈ 19,5°\n\n>> ZASTOSOWANIA PRAKTYCZNE:\n1. Astronomia: przesunięcia ku czerwieni i fioletowi\n2. Medycyna: USG Dopplera (prędkość krwi)\n3. Radar: pomiar prędkości\n4. Meteorologia: prędkości wiatru w burzach\n5. Muzyka: zmiana tonu źródeł w ruchu\n\n>> GŁĘBSZE WNIOSKI:\nEfekt Dopplera wynika ze skończonej prędkości fali. Dla światła przy dużych prędkościach konieczna jest szczególna teoria względności.",
77
"equations": "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ WZORY NA PRZESUNIĘCIE DOPPLERA ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ Prędkość źródła: vs (Prędkość Przepływu) ┃\n┃ Prędkość fali: v (domyślnie 10.0) ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ ZMIANA DŁUGOŚCI FALI ┃\n┃ Przód: λ' = (v - vs) / f ┃\n┃ Tył: λ' = (v + vs) / f ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ ZMIANA CZĘSTOTLIWOŚCI (Obserwowana) ┃\n┃ Przód: f' = f * [v / (v - vs)] ┃\n┃ Tył: f' = f * [v / (v + vs)] ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ NADDŹWIĘKOWE (vs > v) ┃\n┃ Liczba Macha: M = vs / v ┃\n┃ Kąt Stożka: sin(θ) = 1 / M ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛",
88
"parameters": [
99
{
@@ -22,11 +22,11 @@
2222
"steps": [
2323
{
2424
"title": "=== KROK 1: POCZĄTKOWA KONFIGURACJA ===",
25-
"detail": "1. Zresetuj symulację.\n2. Ustaw Standardowe Parametry:\n Prędkość Fali: 10.0\n Tłumienie: 0.1 (Niskie tłumienie pomaga zobaczyć stożek)\n Częstotliwość: 2.0 Hz\n\n3. Umieść pojedyncze źródło na ŚRODKU ekranu."
25+
"detail": "1. Zresetuj symulację.\n2. Ustaw Standardowe Parametry:\n Prędkość Fali: 10.0\n Tłumienie: 0.1 (Niskie tłumienie pomaga zobaczyć stożek)\n Częstotliwość: 1.5 Hz (λ = 6.7 px - stabilnie!)\n\n3. Umieść pojedyncze źródło na ŚRODKU ekranu."
2626
},
2727
{
2828
"title": "=== KROK 2: RUCH PODDŹWIĘKOWY (Połowa Prędkości) ===",
29-
"detail": "1. Otwórz menu 'Przepływ Ośrodka (Stożki Macha)'.\n2. Ustaw Prędkość Przepływu X na 5.0.\n (To 50% prędkości fali, Mach 0.5)\n\nOBSERWUJ:\nSpójrz na długość fali (odległość między pierścieniami).\n* Prawa strona (Pod prąd): Fale są ściśnięte (λ = 2.5px)\n* Lewa strona (Z prądem): Fale są rozciągnięte (λ = 7.5px)\n\nTa asymetria to klasyczny Efekt Dopplera."
29+
"detail": "1. Otwórz menu 'Przepływ Ośrodka (Stożki Macha)'.\n2. Ustaw Prędkość Przepływu X na 5.0.\n (To 50% prędkości fali, Mach 0.5)\n\nOBSERWUJ:\nSpójrz na długość fali (odległość między pierścieniami).\n* Prawa strona (Pod prąd): Fale są ściśnięte (λ = 3.35px)\n* Lewa strona (Z prądem): Fale są rozciągnięte (λ = 10.0px)\n\nTa asymetria to klasyczny Efekt Dopplera."
3030
},
3131
{
3232
"title": "=== KROK 3: BARIERA DŹWIĘKU (Mach 1) ===",

0 commit comments

Comments
 (0)