Claudio Gomes 6 yıl önce
ebeveyn
işleme
00bbd20833

+ 2 - 0
.gitignore

@@ -2,3 +2,5 @@
 /*.aux
 /*.log
 /*.gz
+*.pyc
+/materials/lib/CBDSimulatorInterpreter/.idea

+ 103 - 0
materials/5-CBDModeling/CBDModelling.ipynb

@@ -0,0 +1,103 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "data": {
+      "image/svg+xml": [
+       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
+       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
+       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
+       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
+       " -->\r\n",
+       "<!-- Title: %3 Pages: 1 -->\r\n",
+       "<svg width=\"269pt\" height=\"204pt\"\r\n",
+       " viewBox=\"0.00 0.00 268.98 204.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
+       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 200)\">\r\n",
+       "<title>%3</title>\r\n",
+       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-200 264.984,-200 264.984,4 -4,4\"/>\r\n",
+       "<!-- A -->\r\n",
+       "<g id=\"node1\" class=\"node\"><title>A</title>\r\n",
+       "<ellipse fill=\"none\" stroke=\"black\" cx=\"179.992\" cy=\"-178\" rx=\"53.8905\" ry=\"18\"/>\r\n",
+       "<text text-anchor=\"middle\" x=\"179.992\" y=\"-174.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">King Arthur</text>\r\n",
+       "</g>\r\n",
+       "<!-- B -->\r\n",
+       "<g id=\"node2\" class=\"node\"><title>B</title>\r\n",
+       "<ellipse fill=\"none\" stroke=\"black\" cx=\"90.9919\" cy=\"-105\" rx=\"90.9839\" ry=\"18\"/>\r\n",
+       "<text text-anchor=\"middle\" x=\"90.9919\" y=\"-101.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Sir Bedevere the Wise</text>\r\n",
+       "</g>\r\n",
+       "<!-- A&#45;&gt;B -->\r\n",
+       "<g id=\"edge1\" class=\"edge\"><title>A&#45;&gt;B</title>\r\n",
+       "<path fill=\"none\" stroke=\"black\" d=\"M160.24,-161.243C148.365,-151.77 133.043,-139.547 119.832,-129.007\"/>\r\n",
+       "<polygon fill=\"black\" stroke=\"black\" points=\"121.929,-126.203 111.929,-122.702 117.563,-131.675 121.929,-126.203\"/>\r\n",
+       "</g>\r\n",
+       "<!-- L -->\r\n",
+       "<g id=\"node3\" class=\"node\"><title>L</title>\r\n",
+       "<ellipse fill=\"none\" stroke=\"black\" cx=\"169.992\" cy=\"-18\" rx=\"90.9839\" ry=\"18\"/>\r\n",
+       "<text text-anchor=\"middle\" x=\"169.992\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Sir Lancelot the Brave</text>\r\n",
+       "</g>\r\n",
+       "<!-- A&#45;&gt;L -->\r\n",
+       "<g id=\"edge2\" class=\"edge\"><title>A&#45;&gt;L</title>\r\n",
+       "<path fill=\"none\" stroke=\"black\" d=\"M184.456,-159.626C186.927,-149.107 189.744,-135.375 190.992,-123 192.597,-107.081 193.379,-102.821 190.992,-87 188.889,-73.0645 184.491,-58.0477 180.261,-45.6797\"/>\r\n",
+       "<polygon fill=\"black\" stroke=\"black\" points=\"183.461,-44.2348 176.801,-35.9954 176.869,-46.59 183.461,-44.2348\"/>\r\n",
+       "</g>\r\n",
+       "<!-- B&#45;&gt;L -->\r\n",
+       "<g id=\"edge3\" class=\"edge\"><title>B&#45;&gt;L</title>\r\n",
+       "<path fill=\"none\" stroke=\"black\" d=\"M106.6,-87.2067C118.286,-74.6335 134.44,-57.252 147.516,-43.1825\"/>\r\n",
+       "<polygon fill=\"black\" stroke=\"black\" points=\"150.172,-45.466 154.416,-35.7584 145.045,-40.7005 150.172,-45.466\"/>\r\n",
+       "<text text-anchor=\"middle\" x=\"148.992\" y=\"-57.8\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">false</text>\r\n",
+       "</g>\r\n",
+       "</g>\r\n",
+       "</svg>\r\n"
+      ],
+      "text/plain": [
+       "<graphviz.dot.Digraph at 0x28d45fe8588>"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "from graphviz import Digraph\n",
+    "\n",
+    "dot = Digraph(comment='The Round Table')\n",
+    "\n",
+    "dot.node('A', 'King Arthur', {'shape':''})\n",
+    "dot.node('B', 'Sir Bedevere the Wise')\n",
+    "dot.node('L', 'Sir Lancelot the Brave')\n",
+    "dot.edges(['AB', 'AL'])\n",
+    "dot.edge('B', 'L', 'false')\n",
+    "\n",
+    "dot"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 46 - 0
materials/DockerfileTutorials123567

@@ -0,0 +1,46 @@
+FROM jupyter/minimal-notebook:latest
+
+# Install simpy
+RUN /opt/conda/bin/conda install sympy
+
+# Install scipy
+RUN /opt/conda/bin/conda install scipy
+
+USER root
+
+# Install Julia 0.6
+RUN mkdir /opt/julia && \
+		cd /opt/julia && \
+		wget --quiet https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.4-linux-x86_64.tar.gz && \
+		tar -xzf julia-0.6.4-linux-x86_64.tar.gz --directory . --strip-components=1 && \
+		ln -s /opt/julia/bin/julia /usr/bin/julia && \
+		julia --version
+
+RUN mkdir /opt/bondgraphs
+
+COPY test_bondgraphs.py /opt/bondgraphs/
+
+# Install BondGraphTools and run test file (forces installation of dependencies)
+RUN apt-get update -y && \
+		apt-get install -y dvipng && \
+		pip install BondGraphTools && \
+		python3 /opt/bondgraphs/test_bondgraphs.py
+
+# Copy local files to the remote notebooks
+RUN mkdir /opt/notebooks
+
+COPY 1-NewtonsLaws /opt/notebooks/1-NewtonsLaws
+COPY 2-StationaryAction /opt/notebooks/2-StationaryAction
+COPY 3-BondGraphs /opt/notebooks/3-BondGraphs
+
+WORKDIR /opt/notebooks/
+
+# Port
+EXPOSE 8888
+
+# Run Jupyter Notebook
+CMD ["/opt/conda/bin/jupyter", "notebook", "--notebook-dir=/opt/notebooks", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
+
+# Uncomment to access command line on the docker container
+CMD ["bash"]
+# to start jupyter run: /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root

+ 21 - 0
materials/DockerfileTutorials4

@@ -0,0 +1,21 @@
+FROM mechatronics3d/jjmodelica
+
+USER root
+
+# Copy local files to the remote notebooks
+RUN mkdir /opt/notebooks
+
+COPY 4-Modelica /opt/notebooks/4-Modelica
+
+WORKDIR /opt/notebooks/
+
+# Port
+EXPOSE 8888
+
+# Run Jupyter Notebook
+CMD ["jupyter", "notebook", "--notebook-dir=/opt/notebooks", "--ip=0.0.0.0", "--port=8888", "--no-browser"]
+
+# Uncomment to access command line on the docker container
+# CMD ["bash"]
+# to start jupyter run: 
+# jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root

+ 2 - 2
materials/README.md

@@ -10,12 +10,12 @@ This repository contains the materials that are used in the MoDELS tutorial of p
 
 3. Build the corresponding docker image: 
     ```
-    docker build -f DockerfileTutorials123 -t jupyter .
+    docker build -f DockerfileTutorials123567 -t jupyter .
     ```
 or 
 
     ```
-    docker build -f DockerfileTutorials45 -t jupyter .
+    docker build -f DockerfileTutorials4 -t jupyter .
     ```
 
 This will download all dependencies you need to run the examples. You might need root access.

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
materials/notes.drawio