Commit c5d7e23f authored by Johan Gronqvist's avatar Johan Gronqvist
Browse files

Add furuta notebooks.

parent 5a482330
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Welcome to Jupyter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This course will use Jupyter as the software environment for the Automatic Control part of the course.\n",
"\n",
"Jupyter is a web-based interface, with a file browser (to the left), a main area where this notebook is now displayed, and a few other bits that you will see later.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"One useful feature of Jupyter Notebooks is that they allow mixing text (with fancy formatting) and executable code (organized in \"cells\"), and that the results of executing code gets printed.\n",
"\n",
"If you click in the below code cell, containing the code `print (\"I can see the output!\")`, and press shift+enter, then you should indeed see the output."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"I can see the output.\n"
]
}
],
"source": [
"print(\"I can see the output.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You should now see the text \"I can see the output.\", and the cell should have been give a number which is shown to the left of the cell, telling us that it was the first cell to be executed. If you execute the cell again, it should get the number 2 instead.\n",
"\n",
"This notebook uses python as the programming language to execute, but jupyter can handle many other programming languages as well. \n",
"\n",
"Let's define a function in one cell and use it in the next."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def f(x):\n",
" return x*x - x + 0.18"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.42"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(1.2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are more ways to execute the cells in a notebook than pressing shift+enter, including the buttons just above the notebook, and via the menus at the top, but we will not focus on them now."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"At the bottom left of the screen, there should now be a text saying that we are using a Python 3 kernel, and that the kernel is currently *Idle*. When we run a longer computation, we will see that change to *Busy* instead. There is also a place at the top right where it says that the kernel is Python 3, with a nearby circle. When a computation is running, the circle will be filled.\n",
"\n",
"Let's try something that keeps the kernel \"busy\" for 10 seconds..."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment