-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
256 lines (225 loc) · 11.6 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Euler's Method Demonstrator</title>
<meta name="theme-color" content="#89cce5">
<!--font awesome-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
<!--bootstrap-->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--mdb-->
<link href="css/mdb.promin.css" rel="stylesheet">
<!--custom css-->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" type="image/png" href="icon.png">
</head>
<body>
<div id="mdb-preloader" class="flex-center">
<div id="preloader-markup">
</div>
</div>
<!--POINT MODAL-->
<div class="modal fade" id="point_modal" tabindex="-1" role="dialog" aria-labelledby="point_modal_label" aria-hidden="true">
<div class="modal-dialog" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="point_modal_label">Calculated Points</h4>
</div>
<!--Body-->
<div class="modal-body">
<!-- Nav tabs -->
<ul id="points_tab" class="nav nav-tabs tabs-2" role="tablist">
<li class="nav-item">
<a class="nav-link waves-effect active" data-toggle="tab" href="#panel1" role="tab" id="step_size_pt_panel">Step Size 1</a>
</li>
<li class="nav-item" disabled>
<a class="nav-link waves-effect" data-toggle="tab" href="#panel2" role="tab" id="step_size2_panel" disabled>Step Size 2</a>
</li>
</ul>
<!-- Tab panels -->
<div class="tab-content card">
<!--Panel 1-->
<div class="tab-pane fade in active" id="panel1" role="tabpanel">
<table class="table table-hover" id='point_table'>
<thead>
<tr>
<th>x</th>
<th>y</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<!--Panel 2-->
<div class="tab-pane fade" id="panel2" role="tabpanel">
<table class="table table-hover" id='point_table2'>
<thead>
<tr>
<th>x</th>
<th>y</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!--Footer-->
<div class="modal-footer">
</div>
</div>
<!--/.Content-->
</div>
</div>
<!--Help-->
<div class="modal fade" id="help_modal" tabindex="-1" role="dialog" aria-labelledby="point_modal_label" aria-hidden="true">
<div class="modal-dialog" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="point_modal_label">Help</h4>
</div>
<!--Body-->
<div class="modal-body">
<p>The equation button allows you to input the differential, intial values, step size (possibly 2nd step size) and iterations (number of times to run the method). </p>
<p>The points button displays all the points found with Euler's method. </p>
<p>Point mode draws circles to indicate graphically all the points found with Euler's method. </p>
<p>This program supports all well known math functions and constants. Shown below are some example functions to input:</p>
<ul class="list-group">
<li class="list-group-item"><code>x^3+2x+3</code></li>
<li class="list-group-item"><code>e^x</code></li>
<li class="list-group-item"><code>sqrt(x)/cbrt(y)</code></li>
<li class="list-group-item"><code>tan(x)</code></li>
<li class="list-group-item"><code>atan(x)tanh(x)atanh(x)</code></li>
<li class="list-group-item"><code>abs(x/y+y/x)</code></li>
<li class="list-group-item"><code>log(x,e)</code></li>
<li class="list-group-item"><code>x > 0 ? x^2 : x mod 10</code></li>
</ul>
</div>
<!--Footer-->
<div class="modal-footer">
</div>
</div>
<!--/.Content-->
</div>
</div>
<!-- INPUT Modal -->
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modal_label" aria-hidden="true">
<div class="modal-dialog" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="modal_label">Euler's Method Demonstrator</h4>
</div>
<!--Body-->
<div class="modal-body">
<!--form layout-->
<div id="form">
<div class="md-form">
<input id="equation" type="text" class="validate form-control" required="true">
<label for="equation">\(\frac{dy}{dx}\) = </label>
</div>
</div>
<div id="form-inline">
<div class="md-form col-md-3">
<input id="x" type="number" step="any" class="validate form-control" required="true">
<label for="x">\(x_0\)</label>
</div>
<div class="md-form col-md-3">
<input id="y" type="number" step="any" class="validate form-control" required="true">
<label for="y">\(y_0\)</label>
</div>
<div class="md-form col-md-3">
<input id="step_size" type="number" step="any" class="validate form-control" required="true">
<label for="step_size">\(\Delta x\)</label>
</div>
<div class="md-form col-md-3">
<input id="iterations" type="number" step="1" class="validate form-control" required="true">
<label for="iterations">iterations</label>
</div>
</div>
<button class="btn btn-secondary waves-effect" id="experimental_button" type="button" data-toggle="collapse" data-target="#experimental" aria-expanded="false" aria-controls="experimental"><i class="fa fa-flask left"></i>Experimental</button>
<div class="collapse" id="experimental">
<p>You may set a second step size here. </p>
<div class="md-form">
<input type="number" step="any" id="step_size2" class="validate form-control">
<label for="step_size2" class="">\(\Delta x_2\)</label>
</div>
</div>
</div>
<!--Footer-->
<div class="modal-footer">
<button type="button" class="btn btn-info waves-effect" id="graph_button" class="close" data-dismiss="modal">GRAPH</button>
</div>
</div>
</div>
</div>
<div class="container">
<h3 class="h3-responsive" id="latex">$$\text{Euler's Method}$$</h3>
<span class="point_tooltip"></span>
<div class="row">
<canvas class="col-xs-12" id="canvas" style="box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"></canvas>
</div>
<div class="row" id="toolbar">
<div class="col-md-4">
<p class="text-xs-center">
<!-- Button trigger modal -->
<button type="button" class="btn btn-info waves-effect" data-toggle="modal" data-target="#modal" id="activate_modal_button">EQUATION</button>
<button type="button" class="btn btn-info waves-effect" data-toggle="modal" data-target="#point_modal" id="activate_points" disabled>POINTS</button>
<button type="button" class="btn btn-info waves-effect" data-toggle="modal" data-target="#help_modal" id="help"><i class="fa fa-question"></i></button>
</p>
</div>
<div class="col-md-4">
<p class="text-xs-center">
<a class="btn-floating btn-small lime waves-effect" id="zoom-in"><i class="fa fa-search-plus"></i></a>
<a class="btn-floating btn-small lime waves-effect" id="zoom-out"><i class="fa fa-search-minus"></i></a>
</p>
</div>
<div class="col-md-4">
<div class="switch" style="padding-top: 20px;">
<p class="text-xs-center">
<label>
Point Mode
<input type="checkbox" id="point_mode" disabled onchange="toggle_point_mode(this)">
<span class="lever"></span>
</label>
</p>
</div>
</div>
</div>
</div>
<!--jquery-->
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
<!--font awesome-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
<!--bootstrap-->
<script type="text/javascript" src="js/tether.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!--mdb-->
<script type="text/javascript" src="js/mdb.promin.js"></script>
<!--mathjs-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.8.1/math.min.js"></script>
<!--mathjax-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!--app logic-->
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>