{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "**Hello, freifrau! I am TheInterview, your partial differential equations and simulations expert.**\n", "Let's set up a model and simulation together.\n", "\n", "To get explanations, enter explain . \n", "To see a recap of what we know so far, enter recap . \n", "To interactively visualize ther current theory graph, enter tgwiev or tgview mpd. \n", "Otherwise, you can always answer with LaTeX-type input.\n", "\n", "You can inspect the currently loaded MMT theories under http://localhost:43397\n", "\n", "\n", "How many dimensions does your model have?\n", "\n", "\n", "I am just assuming it's 1, since that is all we can currently handle.\n", "\n", "\n", "\n", "\n", "What is the domain you would like to simulate for? Ω : type ❘ = [?;?], e.g. \\Omega = [0.0;1.0]\n", "By the way, you can always try and use LaTeX-type input.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "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" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Ω = [0.0;1.0]" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Ok, s : Ω → ℝ\n", "s : Ω → ℝ\n", "\n", "\n", "Would you like to name additional parameters like constants or functions (that are independent of your unknowns)? c : ℝ = ? or f : Ω → ℝ = ?\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "s : Ω → ℝ" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Ok, f = [ x : Ω] x\n", "Would you like to declare more parameters?\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "f = x" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Ok, α = [ x : Ω] -5.0\n", "Would you like to declare more parameters?\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "\\alpha = -5.0" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/markdown": [] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "y" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/markdown": [ "I did not catch that. Could you please rephrase?\n", "Details: MMT server error: unbound token: ·.
\n", "
\n", "
\n", "
info.kwarc.mmt.api.SourceError of level 2
\n", "
unbound token: ·
\n", "
source error (object-parser) at http://mathhub.info/MitM/smglom/calculus/differentialequations#15.0.15:15.0.15\n", "\n", "
\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeError(NotationBasedParser.scala:93)\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeTerm(NotationBasedParser.scala:321)\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.NotationBasedParser.$anonfun$makeTerm$5(NotationBasedParser.scala:345)\n", " \n", " \n", " scala.collection.immutable.List.map(List.scala:287)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeTerm(NotationBasedParser.scala:345)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.doFoundContent$1(NotationBasedParser.scala:437)\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.NotationBasedParser.$anonfun$makeTermFromMatchedList$14(NotationBasedParser.scala:496)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.$anonfun$makeTermFromMatchedList$14$adapted(NotationBasedParser.scala:493)\n", " \n", " \n", " scala.collection.immutable.List.foreach(List.scala:389)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeTermFromMatchedList(NotationBasedParser.scala:493)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeTerm(NotationBasedParser.scala:329)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.makeTerm(NotationBasedParser.scala:335)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.$anonfun$apply$10(NotationBasedParser.scala:214)\n", "
\n", "
\n", " info.kwarc.mmt.api.frontend.Logger.logGroup(Log.scala:34)\n", "
\n", "
\n", " info.kwarc.mmt.api.frontend.Logger.logGroup$(Log.scala:31)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.logGroup(NotationBasedParser.scala:69)\n", " \n", " \n", " info.kwarc.mmt.api.parser.NotationBasedParser.apply(NotationBasedParser.scala:214)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.puCont(StructureParser.scala:141)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readParsedObject(StructureParser.scala:287)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.doComponent(StructureParser.scala:292)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readConstant(StructureParser.scala:880)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readInModuleAux(StructureParser.scala:630)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readInModule(StructureParser.scala:457)\n", " \n", " \n", " info.kwarc.mmt.interviews.InterviewServer.parseDecl(InterviewServer.scala:102)\n", " \n", " \n", " info.kwarc.mmt.interviews.InterviewServer.apply(InterviewServer.scala:50)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.resolveExtension(Server.scala:95)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.resolve(Server.scala:76)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.handleRequest(Server.scala:53)\n", " \n", " \n", " info.kwarc.mmt.api.web.TiscafServerImplementation$RequestHandler$$anon1.act(TiscafServerImplementation.scala:49)\n", " \n", " \n", " tiscaf.HSimpleLet.aact(HLet.scala:166)\n", " \n", " \n", " tiscaf.HSimpleLet.aact(HLet.scala:165)\n", " \n", " \n", " info.kwarc.mmt.api.web.TiscafServerImplementationRequestHandler$$anon$1.aact(TiscafServerImplementation.scala:47)\n", " \n", " \n", " tiscaf.HAcceptor.talk(HAcceptor.scala:246)\n", " \n", " \n", " tiscaf.HSimplePeer.doTalkItself$1(HPeer.scala:101)\n", "
\n", "
\n", " tiscaf.HSimplePeer.$anonfun$readChannel$1(HPeer.scala:114)\n", " \n", " \n", " scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)\n", " \n", " \n", " scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)\n", " \n", " \n", " scala.util.Success.$anonfun$map$1(Try.scala:251)\n", "
\n", "
\n", " scala.util.Success.map(Try.scala:209)\n", "
\n", "
\n", " scala.concurrent.Future.$anonfun$map$1(Future.scala:288)\n", " \n", " \n", " scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)\n", "
\n", "
\n", " scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)\n", " \n", " \n", " scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)\n", " \n", " \n", " tiscaf.sync.SyncQuExecutionContext$$anon1.run(SyncQuExecutionContext.scala:69)\n", " \n", " \n", " \n", " \n", " \n", "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "k = x \\cdot x" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "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" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/markdown": [ "Ok, \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\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" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Δs = \\alpha" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Ok \n", "\n", "\n", "These are all the boundary conditions needed.\n", "\n", "\n", "Do you know something about the operator Δ? Is it e.g. linear, or not elliptic ? \n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "s = f" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "OK!\n", "do you know anything else?\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "linear" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "OK!\n", "do you know anything else?\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "elliptic" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "\n", "\n", "Would you like to try and solve the PDE using the Finite Difference Method in ExaStencils? If yes, you can provide a configuration name, or we'll just use your name.\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 13, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "http://localhost:60393/graphs/tgview.html?type=mpd&graphdata=http%3A%2F%2Fmathhub.info%2FMitM%2Fsmglom%2Fcalculus%2Fdifferentialequations%3FModel&viewOnlyMode=true\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "I did not catch that. Could you please rephrase?\n", "Details: MMT server error: invalid unit: http://mathhub.info/MitM/smglom/calculus/differentialequations?MPD_f?proof_f?type: Judgment |- ⊦(oneOf /A/0 f f)≐[x:Ω]x INHABITABLE. \n", " \n", " \n", " info.kwarc.mmt.api.InvalidUnit of level 2 \n", " invalid unit: http://mathhub.info/MitM/smglom/calculus/differentialequations?MPD_f?proof_f?type: Judgment |- ⊦(oneOf /A/0 f f)≐[x:Ω]x INHABITABLE \n", " \n", " \n", " info.kwarc.mmt.api.checking.RuleBasedChecker.anonfunapply15(RuleBasedChecker.scala:97)\n", " \n", " \n", " info.kwarc.mmt.api.checking.RuleBasedChecker.anonfunapply15adapted(RuleBasedChecker.scala:95)\n", " \n", " \n", " scala.collection.immutable.List.foreach(List.scala:389)\n", " \n", " \n", " info.kwarc.mmt.api.checking.RuleBasedChecker.anonfunapply13(RuleBasedChecker.scala:95)\n", " \n", " \n", " scala.runtime.java8.JFunction0mcVsp.apply(JFunction0mcVsp.java:12)\n", " \n", " \n", " info.kwarc.mmt.api.frontend.Logger.logGroup(Log.scala:34)\n", " \n", " \n", " info.kwarc.mmt.api.frontend.Logger.logGroup(Log.scala:31)\n", " \n", " \n", " info.kwarc.mmt.api.checking.RuleBasedChecker.logGroup(RuleBasedChecker.scala:17)\n", " \n", " \n", " info.kwarc.mmt.api.checking.RuleBasedChecker.apply(RuleBasedChecker.scala:88)\n", " \n", " \n", " info.kwarc.mmt.api.checking.MMTStructureChecker.checkInhabitable1(MMTStructureChecker.scala:245)\n", " \n", " \n", " info.kwarc.mmt.api.checking.MMTStructureChecker.anonfuncheck13(MMTStructureChecker.scala:253)\n", " \n", " \n", " info.kwarc.mmt.api.checking.MMTStructureChecker.anonfuncheck13adapted(MMTStructureChecker.scala:250)\n", " \n", " \n", " scala.Option.foreach(Option.scala:257)\n", " \n", " \n", " info.kwarc.mmt.api.checking.MMTStructureChecker.check(MMTStructureChecker.scala:250)\n", " \n", " \n", " info.kwarc.mmt.api.checking.MMTStructureChecker.applyElementBegin(MMTStructureChecker.scala:72)\n", " \n", " \n", " info.kwarc.mmt.interviews.InterviewServer$$anon$1.onElement(InterviewServer.scala:94)\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.KeywordBasedParser.seCont(StructureParser.scala:97)\n", "
\n", "
\n", " info.kwarc.mmt.api.parser.KeywordBasedParser.addDeclaration$1(StructureParser.scala:479)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readInModuleAux(StructureParser.scala:631)\n", " \n", " \n", " info.kwarc.mmt.api.parser.KeywordBasedParser.readInModule(StructureParser.scala:457)\n", " \n", " \n", " info.kwarc.mmt.interviews.InterviewServer.parseDecl(InterviewServer.scala:102)\n", " \n", " \n", " info.kwarc.mmt.interviews.InterviewServer.apply(InterviewServer.scala:50)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.resolveExtension(Server.scala:95)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.resolve(Server.scala:76)\n", " \n", " \n", " info.kwarc.mmt.api.web.Server.handleRequest(Server.scala:53)\n", " \n", " \n", " info.kwarc.mmt.api.web.TiscafServerImplementation$RequestHandler$$anon1.act(TiscafServerImplementation.scala:49)\n", " \n", " \n", " tiscaf.HSimpleLet.aact(HLet.scala:166)\n", " \n", " \n", " tiscaf.HSimpleLet.aact(HLet.scala:165)\n", " \n", " \n", " info.kwarc.mmt.api.web.TiscafServerImplementationRequestHandler$$anon$1.aact(TiscafServerImplementation.scala:47)\n", " \n", " \n", " tiscaf.HAcceptor.talk(HAcceptor.scala:246)\n", " \n", " \n", " tiscaf.HSimplePeer.doTalkItself$1(HPeer.scala:101)\n", "
\n", "
\n", " tiscaf.HSimplePeer.$anonfun$readChannel$1(HPeer.scala:114)\n", " \n", " \n", " scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)\n", " \n", " \n", " scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)\n", " \n", " \n", " scala.util.Success.$anonfun$map$1(Try.scala:251)\n", "
\n", "
\n", " scala.util.Success.map(Try.scala:209)\n", "
\n", "
\n", " scala.concurrent.Future.$anonfun$map$1(Future.scala:288)\n", " \n", " \n", " scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)\n", "
\n", "
\n", " scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)\n", " \n", " \n", " scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)\n", " \n", " \n", " tiscaf.sync.SyncQuExecutionContext$$anon$1.run(SyncQuExecutionContext.scala:69)\n", "
\n", "
\n", "
\n", "
\n", "
\n", "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "tgview mpd" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "domain: {'name': 'Ω', 'theoryname': 'ephdomain', 'axes': OrderedDict([('x', '[0.0;1.0]')]), 'from': '0.0', 'to': '1.0', 'boundary_name': 'Ω', 'viewname': 'ephdomainASmDomain'}\n", "unknowns: OrderedDict([('s', {'theoryname': 's', 'string': 's : Ω → ℝ', 'type': 'Ω → ℝ', 'codomain': 'ℝ', 'viewname': 'sASmUnknown'})])\n", "parameters: OrderedDict([('f', {'theoryname': 'f', 'string': 'f = x', 'parsestring': 'f = [ x : Ω] x', 'type': '{ : Ω } Ω', 'viewname': 'fASmParameter'}), ('α', {'theoryname': 'α', 'string': 'α = -5.0', 'parsestring': 'α = [ x : Ω] -5.0', 'type': '{ : Ω } ℝ', 'viewname': 'αASmParameter'})])\n", "pdes: {'pdes': [{'theoryname': 'ephpde1', 'string': 'Δs = α', 'lhsstring': 'Δs', 'rhsstring': 'α', 'rhsstring_expanded': '-5.0', 'viewname': 'ephpde1ASmPDE', 'op': 'Δ', 'lhsparsestring': ' [ anys : Ω → ℝ ] Δ anys ', 'rhsparsestring': ' α'}]}\n", "bcs: {'theoryname': 'ephbcs', 'bcs': [{'name': 'bc0', 'string': 's = f', 'lhsstring': 's', 'rhsstring': 'f', 'rhsstring_expanded': 'x', 'type': ('Dirichlet',), 'on': ('x',), 'measure': (2,)}], 'bctypes': {'theoryname': 'sBCTypes', 'viewname': 'sBCTypesASmBCTypes'}, 'viewname': 'ephbcsASmBCsRequired', 'measure_given': 2}\n", "props: {'theoryname': 'ephBoundaryValueProblem', 'viewname': 'ephBoundaryValueProblemASmEllipticLinearDirichletBoundaryValueProblem', 'ops': [{'name': 'Δ', 'props': ['elliptic'], 'linear': True}]}\n", "sim: {'type': None}\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "recap" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\n", " \"stdin_port\": UNKNOWN,\n", " \"shell_port\": UNKNOWN,\n", " \"iopub_port\": UNKNOWN,\n", " \"hb_port\": UNKNOWN,\n", " \"ip\": \"UNKNOWN\",\n", " \"key\": \"UNKNOWN\",\n", " \"signature_scheme\": \"UNKNOWN\",\n", " \"transport\": \"UNKNOWN\"\n", "}\n", "\n", "Paste the above JSON into a file, and connect with:\n", " $> ipython --existing \n", "or, if you are local, you can connect with just:\n", "$> ipython --existing UNKNOWN\n", "\n", "or even just:\n", " \$> ipython --existing\n", "if this is the most recent Jupyter session you have started.\n", "\n" ] } ], "source": [ "%connect_info" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "TheInterview", "language": "text", "name": "interview" }, "language_info": { "file_extension": ".txt", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/plain", "name": "text" } }, "nbformat": 4, "nbformat_minor": 2 }