-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualphase.html
More file actions
171 lines (157 loc) · 8.29 KB
/
visualphase.html
File metadata and controls
171 lines (157 loc) · 8.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Laser Pulse Simulator</title>
<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/visuphy/visuphy.github.io/refs/heads/main/favicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="/header.css">
<link rel="stylesheet" href="/footer.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div id="header-placeholder"></div>
<h1>
<div class="h1-title-group">
<span class="h1-title">Laser Pulse Simulator (Qualitative)</span>
<div class="h1-copyright">
© 2025 <a href="https://github.com/visuphy" target="_blank" title="Visit VisuPhy on GitHub">VisuPhy</a>
</div>
</div>
<div class="h1-info">
<div class="info-item">
<span class="info-label">About and discussion</span>
<div class="info-content">
<a href="." target="_blank" title="About and Discussion">
<i class="fa-solid fa-file-invoice"></i>
</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Source</span>
<div class="info-content">
<a href="https://github.com/visuphy/LaserPulseSimulator" target="_blank" title="View Source on GitHub">
<i class="fab fa-github"></i>
</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Original Author</span>
<div class="info-content">
<a href="https://github.com/Hussein-Tofaili" target="_blank">Hussein-Tofaili</a>
</div>
</div>
<div class="info-item">
<span class="info-label">Other Contributors</span>
<div class="info-content">
<a href="" target="_blank">none</a>
</div>
</div>
</div>
</h1>
<div class="container">
<div class="controls">
<div class="plot-container">
<h3>Spectrum S(ω) & Spectral Phase Φ(ω)</h3>
<canvas id="spectrumChart"></canvas>
<div class="checkbox-group">
<input type="checkbox" id="showSpectralPhase" checked>
<label for="showSpectralPhase">Show Spectral Phase Φ(ω)</label>
</div>
<div class="spectrum-mode-selector">
<label><input type="radio" name="spectrumMode" value="gaussian" id="gaussianModeRadio" checked> Gaussian S(ω)</label>
<label><input type="radio" name="spectrumMode" value="custom" id="customModeRadio"> Custom S(ω)</label>
</div>
<small id="customSpectrumHelpText" style="display: none; text-align: center; margin-top: 10px; margin-bottom: 5px; font-size:0.85em; color:#555;">
Move the red dots up and down to adjust S(ω) shape.
</small>
</div>
<h2>Controls</h2>
<div class="slider-columns-container">
<div class="slider-column"> <div class="slider-group" id="omega0SliderGroup"> <label for="omega0" id="omega0_label">Central Frequency (ω₀):</label>
<div class="slider-input-wrapper">
<input type="range" id="omega0" min="0.1" max="10" value="5" step="0.1"> <input type="number" id="omega0_val" min="0.1" max="10" value="5" step="0.1">
</div>
<div class="checkbox-group-inline" style="margin-top: 5px;"> <input type="checkbox" id="autoOmega0Custom" checked>
<label for="autoOmega0Custom" style="font-size: 0.85em; font-weight: normal;">Auto-calculate from S(ω)</label>
</div>
<small id="omega0_custom_note" style="display:none; font-size:0.8em; color:#555;">Note: ω₀ sets phase reference. Uncheck "Auto-calculate" for manual input.</small>
</div>
<button id="resetCustomSpectrumButton" style="display:none; margin-top: 10px; margin-bottom: 15px; width: 100%;">Reset Custom Spectrum to Zero</button>
<div id="gaussianControls"> <div class="slider-group">
<label for="delta_omega">Spectral Bandwidth (Δω - FWHM):</label>
<div class="slider-input-wrapper">
<input type="range" id="delta_omega" min="0.2" max="5" value="2" step="0.1">
<input type="number" id="delta_omega_val" min="0.2" max="5" value="2" step="0.1">
</div>
</div>
</div>
</div>
<div class="slider-column"> <h3>Spectral Phase Coefficients:</h3>
<p>Phase Φ(ω) = c₀ + c₁(ω-ω₀) + ½ c₂(ω-ω₀)² + ⅙ c₃(ω-ω₀)³</p>
<div class="slider-group">
<label for="phi0">Constant term c₀ (Constant):</label>
<div class="slider-input-wrapper">
<input type="range" id="phi0" min="-6.3" max="6.3" value="0" step="0.1">
<input type="number" id="phi0_val" min="-6.3" max="6.3" value="0" step="0.1">
</div>
</div>
<div class="slider-group">
<label for="phi1">Linear term c₁ (Group Delay):</label>
<div class="slider-input-wrapper">
<input type="range" id="phi1" min="-5" max="5" value="0" step="0.1">
<input type="number" id="phi1_val" min="-5" max="5" value="0" step="0.1">
</div>
</div>
<div class="slider-group">
<label for="phi2">Quadratic term c₂ (GDD):</label>
<div class="slider-input-wrapper">
<input type="range" id="phi2" min="-4" max="4" value="0" step="0.1">
<input type="number" id="phi2_val" min="-4" max="4" value="0" step="0.1">
</div>
</div>
<div class="slider-group">
<label for="phi3">Cubic term c₃ (TOD):</label>
<div class="slider-input-wrapper">
<input type="range" id="phi3" min="-12" max="12" value="0" step="0.2">
<input type="number" id="phi3_val" min="-12" max="12" value="0" step="0.2">
</div>
</div>
</div>
</div>
</div>
<div class="plots">
<div class="plot-container">
<h3>Individual Cosine Waves: A(ω)cos(Φ(ω) - ωt)</h3>
<canvas id="individualCosinesChart"></canvas>
<div class="checkbox-group">
<input type="checkbox" id="showPeakConnector" unchecked>
<label for="showPeakConnector">Show Peak Connector Line</label>
</div>
</div>
<div class="plot-container">
<h3>Sum of Cosine Waves E(t)</h3>
<canvas id="sumCosinesChart"></canvas>
<div class="checkbox-group">
<input type="checkbox" id="showEnvelopeE" checked>
<label for="showEnvelopeE">Show E(t) Envelope</label>
</div>
</div>
<div class="plot-container">
<h3>Sum Intensity I(t) ∝ E(t)²</h3>
<canvas id="sumIntensityChart"></canvas>
<div class="checkbox-group">
<input type="checkbox" id="showEnvelopeI" checked>
<label for="showEnvelopeI">Show I(t) Envelope</label>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
<div id="footer-placeholder"></div>
<!-- Script to include Header/Footer -->
<script src="/layout.js" defer></script>
</body>
</html>