Browse Source

modelica exercises

Claudio Gomes 4 years ago
parent
commit
ff1ef37a40

+ 9 - 0
.gitignore

@@ -4,3 +4,12 @@
 /*.gz
 *.pyc
 /materials/notebooks/lib/CBDSimulatorInterpreter/.idea
+/materials/notebooks/4-Modelica/QuarterCar.fmu
+/materials/notebooks/4-Modelica/QuarterCar.mo
+/materials/notebooks/4-Modelica/QuarterCarScenario.fmu
+/materials/notebooks/4-Modelica/QuarterCarScenario.mo
+/materials/notebooks/4-Modelica/QuarterCarScenario_log.txt
+/materials/notebooks/4-Modelica/QuarterCarScenario_result.txt
+/materials/notebooks/4-Modelica/QuarterCar_log.txt
+/materials/notebooks/4-Modelica/QuarterCar_result.txt
+/materials/notebooks/4-Modelica/quarter_car.mo

+ 1 - 0
materials/generate_exercises.ps1

@@ -1,5 +1,6 @@
 & C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\1-NewtonsLaws\NewtonsLaws.ipynb
 & C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\2-StationaryAction\StationaryAction.ipynb
 & C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\3-BondGraphs\BondGraphs.ipynb
+& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\4-Modelica\Modelica.ipynb
 
 pause

+ 25 - 9
materials/notebooks/1-NewtonsLaws/NewtonsLaws.ipynb

@@ -4,7 +4,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Mass-Spring System"
+    "# Exercise: Mass-Spring System Derivation"
    ]
   },
   {
@@ -44,7 +44,9 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Import required libraries\n",
@@ -57,7 +59,9 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Variables used to derive equations\n",
@@ -67,7 +71,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -93,7 +99,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Derivative of velocity is acceleration, \n",
@@ -129,7 +137,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "m_val = 1.0\n",
@@ -148,7 +158,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def fe_val(t):\n",
@@ -168,7 +180,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "stop_time = 30.0\n",
@@ -185,7 +199,9 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

+ 25 - 9
materials/notebooks/1-NewtonsLaws/NewtonsLaws_exercises.ipynb

@@ -4,7 +4,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Mass-Spring System"
+    "# Exercise: Mass-Spring System Derivation"
    ]
   },
   {
@@ -44,7 +44,9 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Import required libraries\n",
@@ -57,7 +59,9 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Variables used to derive equations\n",
@@ -67,7 +71,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -93,7 +99,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Derivative of velocity is acceleration, \n",
@@ -126,7 +134,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "m_val = 1.0\n",
@@ -145,7 +155,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def fe_val(t):\n",
@@ -165,7 +177,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "stop_time = 30.0\n",
@@ -182,7 +196,9 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

+ 81 - 36
materials/notebooks/2-StationaryAction/StationaryAction.ipynb

@@ -1,25 +1,13 @@
 {
  "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "from sympy import *\n",
-    "init_printing()\n",
-    "import matplotlib.pyplot as plt\n",
-    "import scipy.integrate as integrate\n",
-    "import numpy as np"
-   ]
-  },
   {
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Principle of Least Action\n",
+    "# Background: Principle of Least Action\n",
     "\n",
-    "based on Chapter 14 of Eriksson, Kenneth, Donald Estep, and Claes Johnson. 2004. *Applied Mathematics: Body and Soul*. Volume 2. Berlin, Heidelberg: Springer Berlin Heidelberg. <https://doi.org/10.1007/978-3-662-05798-8>.\n",
+    "based on Chapter 14 of: \n",
+    "- Eriksson, Kenneth, Donald Estep, and Claes Johnson. 2004. *Applied Mathematics: Body and Soul*. Volume 2. Berlin, Heidelberg: Springer Berlin Heidelberg. <https://doi.org/10.1007/978-3-662-05798-8>.\n",
     "\n",
     "The principle of least action states that a system's trajectory $u(t)$ under the effect of conservative forces, over an interval of time $[t_1, t_2]$ is such that the following integral, called the action integral, is stationary:\n",
     "$$\n",
@@ -38,10 +26,29 @@
     "The kinetic energy of the ball is  $T(\\dot{u}(t)) = \\frac{1}{2}m\\dot{u}(t)^2$ and the potential energy is $V(u(t)) = mgu(t)$."
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "collapsed": true
+   },
+   "outputs": [],
+   "source": [
+    "# Import necessary libraries \n",
+    "\n",
+    "from sympy import *\n",
+    "init_printing()\n",
+    "import matplotlib.pyplot as plt\n",
+    "import scipy.integrate as integrate\n",
+    "import numpy as np"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -72,7 +79,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -153,7 +162,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -185,7 +196,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -221,7 +234,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -295,7 +310,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -327,7 +344,9 @@
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -362,7 +381,9 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Computes the action integral in [0,10]\n",
@@ -383,7 +404,9 @@
   {
    "cell_type": "code",
    "execution_count": 10,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -416,7 +439,9 @@
   {
    "cell_type": "code",
    "execution_count": 11,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -458,7 +483,9 @@
   {
    "cell_type": "code",
    "execution_count": 12,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -491,7 +518,9 @@
   {
    "cell_type": "code",
    "execution_count": 13,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -531,7 +560,9 @@
   {
    "cell_type": "code",
    "execution_count": 14,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -606,7 +637,9 @@
   {
    "cell_type": "code",
    "execution_count": 15,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -630,7 +663,9 @@
   {
    "cell_type": "code",
    "execution_count": 16,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -662,7 +697,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Exercise\n",
+    "# Exercise : Mass-Spring System Derivation\n",
     "\n",
     "Use both the above methods to check which of the following is the correct trajectory for the mass-spring system (there are no external forces acting on the system). \n",
     "Assume that the mass starts at rest in position $1$."
@@ -671,7 +706,9 @@
   {
    "cell_type": "code",
    "execution_count": 17,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -699,7 +736,9 @@
   {
    "cell_type": "code",
    "execution_count": 18,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -728,7 +767,9 @@
   {
    "cell_type": "code",
    "execution_count": 19,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -757,7 +798,9 @@
   {
    "cell_type": "code",
    "execution_count": 20,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -786,7 +829,9 @@
   {
    "cell_type": "code",
    "execution_count": 21,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

+ 81 - 36
materials/notebooks/2-StationaryAction/StationaryAction_exercises.ipynb

@@ -1,25 +1,13 @@
 {
  "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "from sympy import *\n",
-    "init_printing()\n",
-    "import matplotlib.pyplot as plt\n",
-    "import scipy.integrate as integrate\n",
-    "import numpy as np"
-   ]
-  },
   {
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Principle of Least Action\n",
+    "# Background: Principle of Least Action\n",
     "\n",
-    "based on Chapter 14 of Eriksson, Kenneth, Donald Estep, and Claes Johnson. 2004. *Applied Mathematics: Body and Soul*. Volume 2. Berlin, Heidelberg: Springer Berlin Heidelberg. <https://doi.org/10.1007/978-3-662-05798-8>.\n",
+    "based on Chapter 14 of: \n",
+    "- Eriksson, Kenneth, Donald Estep, and Claes Johnson. 2004. *Applied Mathematics: Body and Soul*. Volume 2. Berlin, Heidelberg: Springer Berlin Heidelberg. <https://doi.org/10.1007/978-3-662-05798-8>.\n",
     "\n",
     "The principle of least action states that a system's trajectory $u(t)$ under the effect of conservative forces, over an interval of time $[t_1, t_2]$ is such that the following integral, called the action integral, is stationary:\n",
     "$$\n",
@@ -38,10 +26,29 @@
     "The kinetic energy of the ball is  $T(\\dot{u}(t)) = \\frac{1}{2}m\\dot{u}(t)^2$ and the potential energy is $V(u(t)) = mgu(t)$."
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "collapsed": true
+   },
+   "outputs": [],
+   "source": [
+    "# Import necessary libraries \n",
+    "\n",
+    "from sympy import *\n",
+    "init_printing()\n",
+    "import matplotlib.pyplot as plt\n",
+    "import scipy.integrate as integrate\n",
+    "import numpy as np"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -72,7 +79,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -153,7 +162,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -185,7 +196,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -221,7 +234,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -295,7 +310,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -327,7 +344,9 @@
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -362,7 +381,9 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Computes the action integral in [0,10]\n",
@@ -383,7 +404,9 @@
   {
    "cell_type": "code",
    "execution_count": 10,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -416,7 +439,9 @@
   {
    "cell_type": "code",
    "execution_count": 11,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -458,7 +483,9 @@
   {
    "cell_type": "code",
    "execution_count": 12,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -491,7 +518,9 @@
   {
    "cell_type": "code",
    "execution_count": 13,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -531,7 +560,9 @@
   {
    "cell_type": "code",
    "execution_count": 14,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -606,7 +637,9 @@
   {
    "cell_type": "code",
    "execution_count": 15,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -630,7 +663,9 @@
   {
    "cell_type": "code",
    "execution_count": 16,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -662,7 +697,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Exercise\n",
+    "# Exercise : Mass-Spring System Derivation\n",
     "\n",
     "Use both the above methods to check which of the following is the correct trajectory for the mass-spring system (there are no external forces acting on the system). \n",
     "Assume that the mass starts at rest in position $1$."
@@ -671,7 +706,9 @@
   {
    "cell_type": "code",
    "execution_count": 17,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -699,7 +736,9 @@
   {
    "cell_type": "code",
    "execution_count": 18,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -728,7 +767,9 @@
   {
    "cell_type": "code",
    "execution_count": 19,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -757,7 +798,9 @@
   {
    "cell_type": "code",
    "execution_count": 20,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -786,7 +829,9 @@
   {
    "cell_type": "code",
    "execution_count": 21,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

+ 23 - 11
materials/notebooks/3-BondGraphs/BondGraphs.ipynb

@@ -4,9 +4,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Bond Graph Modelling\n",
-    "\n",
-    "## Exercise 1: Mass-spring System\n",
+    "# Exercise 1: Mass-spring System with Bond Graphs\n",
     "\n",
     "In this exercise, you will build a bond graph model of a Mass-Spring System, illustrated below."
    ]
@@ -38,7 +36,9 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "import BondGraphTools as bgt"
@@ -47,7 +47,9 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Create model\n",
@@ -85,7 +87,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Draw the model. May need to be run more than once to produce effect.\n",
@@ -95,7 +99,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Run a simulation\n",
@@ -110,7 +116,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -139,7 +147,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Exercise 2: Add a Damper"
+    "# Exercise 2: Mass-spring-damper System"
    ]
   },
   {
@@ -161,7 +169,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "#>Solution\n",
@@ -183,7 +193,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

+ 23 - 11
materials/notebooks/3-BondGraphs/BondGraphs_exercises.ipynb

@@ -4,9 +4,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Bond Graph Modelling\n",
-    "\n",
-    "## Exercise 1: Mass-spring System\n",
+    "# Exercise 1: Mass-spring System with Bond Graphs\n",
     "\n",
     "In this exercise, you will build a bond graph model of a Mass-Spring System, illustrated below."
    ]
@@ -38,7 +36,9 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "import BondGraphTools as bgt"
@@ -47,7 +47,9 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Create model\n",
@@ -75,7 +77,9 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Draw the model. May need to be run more than once to produce effect.\n",
@@ -85,7 +89,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# Run a simulation\n",
@@ -100,7 +106,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {
@@ -129,7 +137,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Exercise 2: Add a Damper"
+    "# Exercise 2: Mass-spring-damper System"
    ]
   },
   {
@@ -151,7 +159,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# TODO"
@@ -160,7 +170,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": false
+   },
    "outputs": [
     {
      "data": {

File diff suppressed because it is too large
+ 275 - 43
materials/notebooks/4-Modelica/Modelica.ipynb


File diff suppressed because it is too large
+ 365 - 0
materials/notebooks/4-Modelica/Modelica_exercises.ipynb


File diff suppressed because it is too large
+ 3976 - 0
materials/notebooks/4-Modelica/resources/quarter_car.svg


BIN
materials/notebooks/4-Modelica/resources/quarter_car_model.pdn


BIN
materials/notebooks/4-Modelica/resources/quarter_car_model.png


+ 12 - 0
materials/notebooks/4-Modelica/scenario.mo

@@ -0,0 +1,12 @@
+
+model QuarterCarScenario
+  QuarterCar quarter_car;
+  Modelica.Blocks.Sources.TimeTable road_profile_table(table=[0, 0;
+                                                              4, 0;
+                                                              5, 0.2;
+                                                              6, 0;
+                                                              7, 0
+                                                              ]);
+equation
+  connect(quarter_car.road_profile, road_profile_table.y);
+end QuarterCarScenario;

File diff suppressed because it is too large
+ 1 - 1
materials/notes/notes.drawio