example_interview.ipynb 10.5 KB
Newer Older
Theresa Pollinger's avatar
Theresa Pollinger committed
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello, user! I am TheInterview, your partial differential equations and simulations expert. Let's set up a simulation together.\n",
      "How many dimensions does your model have?\n",
      "I am just assuming it's 1, since that is all we can currently handle.\n",
      "\n",
      "\n",
      "What is the domain you would like to simulate for?     Ω : type ❘ = [?;?], e.g. Ω = [0.0;1.0]\n",
      "By the way, you can always try and use LaTeX-type input.\n"
     ]
    }
   ],
   "source": [
    "anything"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "we will just assume that the variable is called x for now.\n",
      "\n",
      "\n",
      "Which variable(s) are you looking for? / What are the unknowns in your model?  u : Ω → ??,  e.g., u : Ω → ℝ ?\n"
     ]
    }
   ],
   "source": [
    "Ω = [0.0;1.0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok, u : Ω → ℝ\n",
      "u : Ω → ℝ\n",
      "\n",
      "\n",
      "Would you like to name additional parameters like constants or functions (that are independent of your unknowns)?  c : ℝ = ? or f : Ω → ℝ = ?\n"
     ]
    }
   ],
   "source": [
    "u : Ω → ℝ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok, f = [ x : Ω] x\n",
      "Would you like to declare more parameters? [y/n]? \n"
     ]
    }
   ],
   "source": [
    "f = x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok, α = [ x : Ω] -5.0\n",
      "Would you like to declare more parameters? [y/n]? \n"
     ]
    }
   ],
   "source": [
    "\\alpha = -5.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "I did not catch that. Could you please rephrase?\n",
      "Details: MMT server error: unbound token: ·\n"
     ]
    }
   ],
   "source": [
    "k = x \\cdot x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "f = x\n",
      "α = -5.0\n",
      "\n",
      "\n",
      "Let's talk about your partial differential equation(s). What do they look like? Δu = 0.0, or laplace_operator Ω ℝ u = f ?\n"
     ]
    }
   ],
   "source": [
    "n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok, <result>\n",
      "  <xml>\n",
      "    <theory meta=\"http://mathhub.info/MitM/Foundation?Logic\" base=\"http://mathhub.info/MitM/smglom/calculus\" name=\"ephpde1\">\n",
      "        \n",
      "        \n",
      "        <import from=\"http://mathhub.info/MitM/smglom/calculus?mDifferentialOperators\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#0.0.0:32.0.32\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></import><import from=\"http://mathhub.info/MitM/smglom/calculus?u\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#0.0.0:11.0.11\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></import><import from=\"http://mathhub.info/MitM/smglom/calculus?f\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#0.0.0:11.0.11\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></import><import from=\"http://mathhub.info/MitM/smglom/calculus?&#945;\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#0.0.0:11.0.11\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></import><constant name=\"mylhs\">\n",
      "       <metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#1.0.1:35.0.35\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "       <type><om:OMOBJ xmlns:om=\"http://www.openmath.org/OpenMath\"><om:OMBIND>\n",
      "                 <om:OMS name=\"Pi\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "                 <om:OMBVAR><om:OMV name=\"anyu\"><type><om:OMA><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#19.0.19:23.0.23\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "              <om:OMS name=\"arrow\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "              <om:OMS name=\"&#937;\" module=\"ephdomain\" base=\"http://mathhub.info/MitM/smglom/calculus\"/><om:OMS name=\"real_lit\" module=\"RealLiterals\" base=\"http://mathhub.info/MitM/Foundation\"/>\n",
      "      </om:OMA></type></om:OMV></om:OMBVAR>\n",
      "                 <om:OMA>\n",
      "              <om:OMS name=\"arrow\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "              <om:OMS name=\"&#937;\" module=\"ephdomain\" base=\"http://mathhub.info/MitM/smglom/calculus\"/><om:OMS name=\"real_lit\" module=\"RealLiterals\" base=\"http://mathhub.info/MitM/Foundation\"/>\n",
      "      </om:OMA>\n",
      "      </om:OMBIND></om:OMOBJ></type>\n",
      "       <definition><om:OMOBJ xmlns:om=\"http://www.openmath.org/OpenMath\"><om:OMBIND><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#10.0.10:32.0.32\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "                 <om:OMS name=\"lambda\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "                 <om:OMBVAR><om:OMV name=\"anyu\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#12.0.12:15.0.15\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata><type><om:OMA><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#19.0.19:23.0.23\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "              <om:OMS name=\"arrow\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "              <om:OMS name=\"&#937;\" module=\"ephdomain\" base=\"http://mathhub.info/MitM/smglom/calculus\"/><om:OMS name=\"real_lit\" module=\"RealLiterals\" base=\"http://mathhub.info/MitM/Foundation\"/>\n",
      "      </om:OMA></type></om:OMV></om:OMBVAR>\n",
      "                 <om:OMA><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#27.0.27:32.0.32\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "              <om:OMS name=\"apply\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "              <om:OMS name=\"laplace_operator\" module=\"mDifferentialOperators\" base=\"http://mathhub.info/MitM/smglom/calculus\"/><om:OMS name=\"&#937;\" module=\"ephdomain\" base=\"http://mathhub.info/MitM/smglom/calculus\"/><om:OMS name=\"real_lit\" module=\"RealLiterals\" base=\"http://mathhub.info/MitM/Foundation\"/><om:OMV name=\"anyu\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#29.0.29:32.0.32\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></om:OMV>\n",
      "      </om:OMA>\n",
      "      </om:OMBIND></om:OMOBJ></definition>\n",
      "       \n",
      "     </constant><constant name=\"myrhs\">\n",
      "       <metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#1.0.1:12.0.12\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata>\n",
      "       <type><om:OMOBJ xmlns:om=\"http://www.openmath.org/OpenMath\"><om:OMBIND>\n",
      "                 <om:OMS name=\"Pi\" module=\"LambdaPi\" base=\"http://cds.omdoc.org/urtheories\"/>\n",
      "                 <om:OMBVAR><om:OMV name=\"x\"><type><om:OMS name=\"&#937;\" module=\"ephdomain\" base=\"http://mathhub.info/MitM/smglom/calculus\"/></type></om:OMV></om:OMBVAR>\n",
      "                 <om:OMS name=\"real_lit\" module=\"RealLiterals\" base=\"http://mathhub.info/MitM/Foundation\"/>\n",
      "      </om:OMBIND></om:OMOBJ></type>\n",
      "       <definition><om:OMOBJ xmlns:om=\"http://www.openmath.org/OpenMath\"><om:OMS name=\"&#945;\" module=\"&#945;\" base=\"http://mathhub.info/MitM/smglom/calculus\"><metadata><link resource=\"http://mathhub.info/MitM/smglom/calculus#10.0.10:10.0.10\" rel=\"http://cds.omdoc.org/mmt?metadata?sourceRef\"/></metadata></om:OMS></om:OMOBJ></definition>\n",
      "       \n",
      "     </constant>\n",
      "      </theory>\n",
      "  </xml>\n",
      "</result>\n",
      "\n",
      "\n",
      "\n",
      "These are all the PDEs needed.\n",
      "Let's discuss your boundary conditions. What do they look like? u(x) = f(x) or u(1.0) = \\alpha ?\n"
     ]
    }
   ],
   "source": [
    "Δu = \\alpha"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok \n",
      "\n",
      "\n",
      "These are all the boundary conditions needed.\n",
      "Would you like to try and solve the PDE using the Finite Difference Method in ExaStencils? [y/n]? \n"
     ]
    }
   ],
   "source": [
    "u = f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Generated ExaStencils input.\n"
     ]
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Interview",
   "language": "text",
   "name": "echo"
  },
  "language_info": {
   "file_extension": ".txt",
   "mimetype": "text/plain",
   "name": "Any text"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}