-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
273 lines (226 loc) · 9.65 KB
/
index.html
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ODE CaseStudy</title>
<link rel="stylesheet" type="text/css" href="css/foundation.css" />
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="js/vendor/modernizr.js"></script>
</head>
<body>
<div class="row">
<div class="contain-to-grid sticky show-for-small-only">
<nav class="top-bar" data-topbar>
<center>
<a class="play_btn button radius"><span>Play</span></a>
<a class="pause_btn button radius"><span>Pause</span></a>
<a class="reset_btn button radius alert"><span>Reset</span></a>
</center>
</nav>
</div>
<div class="large-12 columns text-center">
<h1>Ordinary Differential Equations | CaseStudy</h1>
<hr/>
<h3>CO Laboratory Work nr. 1, <em class="subheader">by Istratii Andrei @ FAF-121</em></h3>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<dl class="accordion" data-accordion>
<dd>
<a href="#acc-intro" class="text-center">Introduction</a>
<div id="acc-intro" class="content active">
<p>
A lot of processes in nature can be described through differential equation, thus a lot of problems in science are, in one way or another, connected to the subject of solving differential equations and related systems. However, it happens quite rarely that these problems which arise can be represented in the matters of sipmle ODEs that can be solved analyticaly, therefore one should use numerical methods in order to find an answer to more complex questions.
</p>
<p>
The purpose of this laboratory work is to analyze and solve numerically a problem related to ODE and, using the obtained solution, try to describe the physical process, relate it to the real world and after that reason about the correctness of the solution.
</p>
</div>
</dd>
<dd>
<a href="#acc-oscilator" class="text-center">The Harmonic Oscillator</a>
<div id="acc-oscilator" class="content">
<p>
The problem is given as an equation of a spring oscillator which is influenced by the force of elasticity, the damping force (ex. resistance of the environment) and an external force that is represented as a function of time and can take a variety of different forms.
<div class="latex text-center">
m\frac{d^2x}{dt^2}+c\frac{dx}{dt}+kx=F(t)
</div>
</p>
<p>
Now, our goal is, given the constants <span class="latex">m</span>, <span class="latex">c</span>, <span class="latex">k</span> and the function <span class="latex">F(t)</span>, to compute the position <i><b>x</b></i> as a function of time. This requires a numerical method because the function of the external force is assumed to be unknown as it can be anything, thus we cannot program an analytic solution.
</p>
</div>
</dd>
<dd>
<a href="#acc-numeric" class="text-center">Runge-Kutta</a>
<div id="acc-numeric" class="content">
<p>
The numerical solution of this problem is achieved using the Runge-Kutta method of order 4. In order to make it possible, the initial second order differential equation was transformed in a system of two first order differential equations:
<div class="latex text-center">
y_0' = y_1, \qquad
y_1' = \frac{F(t) - ky_1 - cy_0}{m}
</div>
Where:
<div class="latex text-center">
y_0 = x, \qquad
y_1 = x' = v, \qquad
y_1' = x'' = v' = a
</div>
</p>
<p>
Given such a system and the initial state, the algorithm is able to iteratively generate values for the position and the velocity of the mass on the spring.
</p>
</div>
</dd>
</dl>
<hr/>
</div>
</div>
<div class="row">
<div class="small-12 large-6 columns">
<div class="row">
<div class="small-12 medium-6 columns">
<div id="spring">
</div>
</div>
<div class="small-12 medium-6 columns">
<div class="row">
<div class="small-12 columns">
<b>Spring properties</b>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<br>
Mass { <span id="mass-feedback"></span> }
<div id="mass-slider" class="range-slider round small" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Elasticity { <span id="elasticity-feedback"></span> }
<div id="elasticity-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Damping { <span id="damping-feedback"></span> }
<div id="damping-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="small-12 large-6 columns">
<div class="row">
<div class="small-12 medium-6 columns">
<div class="row">
<div class="small-12 columns">
<b>External Force</b>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<br>
Amplitude { <span id="amplitude-feedback"></span> }
<div id="amplitude-slider" class="range-slider round small" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Pulsation { <span id="pulsation-feedback"></span> }
<div id="pulsation-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Phase { <span id="phase-feedback"></span> }
<div id="phase-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
</div>
</div>
<hr/>
</div>
<div class="small-12 medium-6 columns">
<div class="row">
<div class="small-12 columns">
<b>Initial conditions</b>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<br>
Position { <span id="position-feedback"></span> }
<div id="position-slider" class="range-slider round small" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Velocity { <span id="velocity-feedback"></span> }
<div id="velocity-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
Time delta { <span id="delta-feedback"></span> }
<div id="delta-slider" class="range-slider round" data-slider>
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
<input type="hidden">
</div>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="small-12 columns hide-for-small-only">
<center>
<a class="play_btn button radius small">Play simulation</a>
<a class="pause_btn button radius small">Pause simulation</a>
<a class="reset_btn button radius small alert">Update'n'Reset</a>
</center>
<hr/>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="panel">
<center><h4>Position & Velocity</h4></center>
<p>
<div id="graph1" class="graph">
</div>
</p>
</div>
<div class="panel">
<center><h4>External force</h4></center>
<p>
<div id="graph2" class="graph">
</div>
</p>
</div>
</div>
</div>
<script type="text/javascript" src="js/vendor/jquery.js"></script>
<script type="text/javascript" src="js/vendor/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="js/vendor/jquery.jslatex.packed.js"></script>
<script type="text/javascript" src="js/foundation.min.js"></script>
<script type="text/javascript" src="spring.js" charset="utf-8"></script>
<script>
$(function () {
$(document).foundation();
$(".latex").latex();
});
</script>
</body>
</html>