Compare commits
2 Commits
45bec71687
...
MetaPost
| Author | SHA1 | Date | |
|---|---|---|---|
| e891a1124a | |||
| ff28f125a1 |
2
Gemfile
@@ -7,7 +7,7 @@ source "https://rubygems.org"
|
|||||||
#
|
#
|
||||||
# This will help ensure the proper Jekyll version is running.
|
# This will help ensure the proper Jekyll version is running.
|
||||||
# Happy Jekylling!
|
# Happy Jekylling!
|
||||||
gem "jekyll", "~> 4.2.0"
|
gem "jekyll", "~> 4.1.1"
|
||||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||||
|
|
||||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||||
|
|||||||
@@ -32,10 +32,11 @@ author:
|
|||||||
git_username: oyvindskaaden
|
git_username: oyvindskaaden
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
posts:
|
posts:
|
||||||
excerpt_separator: <!--more-->
|
excerpt_separator: <!--more-->
|
||||||
|
permalink:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
markdown: kramdown
|
markdown: kramdown
|
||||||
@@ -52,7 +53,7 @@ defaults:
|
|||||||
type: "posts"
|
type: "posts"
|
||||||
values:
|
values:
|
||||||
layout: layouts/post
|
layout: layouts/post
|
||||||
permalink: /prosjekter/:categories/:year/:month/:day/:title
|
permalink: /prosjekter/:year/:month/:day/:title
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: "ntnu/*"
|
path: "ntnu/*"
|
||||||
|
|||||||
@@ -1,89 +1,51 @@
|
|||||||
# Våren 2021
|
|
||||||
-
|
|
||||||
name: Våren 2021
|
|
||||||
href: 21v
|
|
||||||
courses:
|
|
||||||
-
|
|
||||||
course: ttt4280
|
|
||||||
desc: Sensorer og instrumentering, våren 2021.
|
|
||||||
updated: 2021-01-11
|
|
||||||
-
|
|
||||||
course: tfe4130
|
|
||||||
desc: Bølgeforplantning, våren 2021.
|
|
||||||
updated: 2021-01-12
|
|
||||||
-
|
|
||||||
course: ttk4145
|
|
||||||
desc: Sanntidsprogrammering, våren 2021.
|
|
||||||
updated: 2021-05-18
|
|
||||||
-
|
|
||||||
course: tiø4252
|
|
||||||
desc: Teknologiledelse, våren 2021.
|
|
||||||
updated: 2021-05-13
|
|
||||||
|
|
||||||
# Høsten 2020
|
# Høsten 2020
|
||||||
-
|
-
|
||||||
name: Høsten 2020
|
course: tfe4152
|
||||||
href: 20h
|
desc: Design av integrerte kretser, høsten 2020.
|
||||||
courses:
|
updated: 2020-12-16
|
||||||
-
|
href: tfe4152/summary
|
||||||
course: tfe4152
|
-
|
||||||
desc: Design av integrerte kretser, høsten 2020.
|
course: ttt4120
|
||||||
updated: 2020-12-16
|
desc: Digital signalbehandling, høsten 2020.
|
||||||
href: tfe4152/summary
|
updated: 2020-12-06
|
||||||
-
|
href: ttt4120/summary
|
||||||
course: ttt4120
|
-
|
||||||
desc: Digital signalbehandling, høsten 2020.
|
course: mfel3010
|
||||||
updated: 2020-12-06
|
desc: Medisin for teknologi- og realfagsstudenter, høsten 2020.
|
||||||
href: ttt4120/summary
|
updated: 2020-11-25
|
||||||
-
|
href: mfel3010/summary
|
||||||
course: mfel3010
|
-
|
||||||
desc: Medisin for teknologi- og realfagsstudenter, høsten 2020.
|
course: tfe4146
|
||||||
updated: 2020-11-25
|
desc: Halvlederkomponenter, høsten 2020.
|
||||||
href: mfel3010/summary
|
updated: 2020-11-23
|
||||||
-
|
href: tfe4146/summary
|
||||||
course: tfe4146
|
|
||||||
desc: Halvlederkomponenter, høsten 2020.
|
|
||||||
updated: 2020-11-23
|
|
||||||
href: tfe4146/summary
|
|
||||||
|
|
||||||
# Våren 2020
|
# Våren 2020
|
||||||
-
|
-
|
||||||
name: Våren 2020
|
course: ttt4270
|
||||||
href: 20v
|
desc: Elektronisk systemdesign, prosjekt, våren 2020.
|
||||||
courses:
|
updated: 2020-05-05
|
||||||
-
|
|
||||||
course: ttt4270
|
|
||||||
desc: Elektronisk systemdesign, prosjekt, våren 2020.
|
|
||||||
updated: 2020-05-05
|
|
||||||
|
|
||||||
# Høsten 2019
|
# Høsten 2019
|
||||||
-
|
-
|
||||||
name: Høsten 2019
|
course: ttt4265
|
||||||
href: 19h
|
desc: Elektronisk systemdesign og -analyse II, høsten 2019.
|
||||||
courses:
|
updated: 2019-12-02
|
||||||
-
|
-
|
||||||
course: ttt4265
|
course: tdt4160
|
||||||
desc: Elektronisk systemdesign og -analyse II, høsten 2019.
|
desc: Datamaskiner og digitalteknikk, høsten 2019.
|
||||||
updated: 2019-12-02
|
updated: 2019-11-28
|
||||||
-
|
|
||||||
course: tdt4160
|
|
||||||
desc: Datamaskiner og digitalteknikk, høsten 2019.
|
|
||||||
updated: 2019-11-28
|
|
||||||
|
|
||||||
# Våren 2019
|
# Våren 2019
|
||||||
-
|
-
|
||||||
name: Våren 2019
|
course: ttt4260
|
||||||
href: 19v
|
desc: Elektronisk systemdesign og -analyse I, våren 2019.
|
||||||
courses:
|
updated: 2019-05-05
|
||||||
-
|
-
|
||||||
course: ttt4260
|
course: tma4105
|
||||||
desc: Elektronisk systemdesign og -analyse I, våren 2019.
|
desc: Matematikk 2, våren 2019.
|
||||||
updated: 2019-05-05
|
updated: 2019-05-21
|
||||||
-
|
-
|
||||||
course: tma4105
|
course: tdt4102
|
||||||
desc: Matematikk 2, våren 2019.
|
desc: Prosedyre og objektorientert programmering, våren 2019.
|
||||||
updated: 2019-05-21
|
updated: 2019-05-15
|
||||||
-
|
|
||||||
course: tdt4102
|
|
||||||
desc: Prosedyre og objektorientert programmering, våren 2019.
|
|
||||||
updated: 2019-05-15
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta name="HandheldFriendly" content="True">
|
<meta name="HandheldFriendly" content="True">
|
||||||
<meta name="MobileOptimized" content="320">
|
<meta name="MobileOptimized" content="320">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@@ -18,7 +17,6 @@
|
|||||||
<link rel="stylesheet" href="{{ "/assets/css/default.css" | relative_url }}"/>
|
<link rel="stylesheet" href="{{ "/assets/css/default.css" | relative_url }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{% if page.title %}
|
{% if page.title %}
|
||||||
{{ page.title }} · {{ site.title }}
|
{{ page.title }} · {{ site.title }}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="navbar-nav"><!--ml-auto for høyrejustering-->
|
<div class="navbar-nav"><!--ml-auto for høyrejustering-->
|
||||||
<!--<a class="nav-item nav-link {% if page.url == '/' %}active{% endif %}" href="/">Hjem</a>-->
|
<!--<a class="nav-item nav-link {% if page.url == '/' %}active{% endif %}" href="/">Hjem</a>-->
|
||||||
{% for entry in site.data.nav %}
|
{% for entry in site.data.nav %}
|
||||||
<a class="nav-item nav-link {% if page.url contains entry.href and page.url != / %}active{% endif %}" href="{{ entry.href }}">{{ entry.title }}</a>
|
<a class="nav-item nav-link {% if page.url contains entry.href and page.url != / %}active{% endif %}" href="{{ entry.href }}">{{ entry.title }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav ml-auto">
|
<div class="navbar-nav ml-auto">
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<script src="{{ "/assets/js/jquery-3.5.1.min.js" | relative_url }}"></script>
|
<script src="{{ "/assets/js/jquery-3.5.1.min.js" | relative_url }}"></script>
|
||||||
<script src="{{ "/assets/js/bootstrap.bundle.min.js" | relative_url }}"></script>
|
<script src="{{ "/assets/js/bootstrap.bundle.min.js" | relative_url }}"></script>
|
||||||
<script src="{{ "/assets/js/bootstrap-toc.min.js" | relative_url }}"></script>
|
<script src="{{ "/assets/js/bootstrap-toc.min.js" | relative_url }}"></script>
|
||||||
|
|
||||||
<!--Anchors-->
|
<!--Anchors-->
|
||||||
<script src="{{ "/assets/js/anchor.min.js" | relative_url }}"></script>
|
<script src="{{ "/assets/js/anchor.min.js" | relative_url }}"></script>
|
||||||
<script>
|
<script>
|
||||||
@@ -11,4 +10,4 @@
|
|||||||
icon: '#',
|
icon: '#',
|
||||||
};
|
};
|
||||||
anchors.add('h1, h2, h3, h4, h5').remove('.no-anchor');
|
anchors.add('h1, h2, h3, h4, h5').remove('.no-anchor');
|
||||||
</script>
|
</script>
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
layout: default
|
|
||||||
---
|
|
||||||
<div class="jumbotron">
|
|
||||||
<div class="container">
|
|
||||||
<h1 class="no-anchor" data-toc-skip>{{ page.title }}</h1>
|
|
||||||
<p>{{ page.description }}</p>
|
|
||||||
<small>Forelesningsdato {{ page.date | date: "%d.%m.%Y" }}</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="container" id="main">
|
|
||||||
<div class="row row-offcanvas row-offcanvas-right">
|
|
||||||
<div class="col-xs-12 col-sm-12 col-md-9">
|
|
||||||
{{ content }}
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3 d-none d-md-block" id="sidebar">
|
|
||||||
<nav id="toc" data-toggle="toc" class="sticky-top" style="z-index:1"></nav>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
32
_posts/2020-12-26-glados.no.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
title: "glados.no"
|
||||||
|
description: Hvordan generere nettsider med git og jekyll
|
||||||
|
date: 2020-12-26
|
||||||
|
categories: glados
|
||||||
|
tags: website glados jekyll git gitea
|
||||||
|
---
|
||||||
|
|
||||||
|
Hvordan er egentlig [glados.no](https://glados.no) satt opp som en kontinuerlig integrasjon ved hjelp av jekyll, bootstrap og git.
|
||||||
|
|
||||||
|
<!--MORE-->
|
||||||
|
|
||||||
|
## Prinsipp
|
||||||
|
|
||||||
|
Jeg er er en ganske lat person, men jeg ønsker å lage en velutformet personlig nettside med alt fra personlige prosjekter til fag på NTNU.
|
||||||
|
Derfor ønsker jeg å sette opp en statisk nettsidegenerator som gjør det enkelt for meg å oppdatere og legge nye til til på nettstedet.
|
||||||
|
|
||||||
|
### Statisk nettsidegenerator
|
||||||
|
|
||||||
|
En bra løsning på dette problemet er å bruke en statisk nettsidegenerator.
|
||||||
|
Da er det mulig å skrive hele nettsteder i det enkle språket markdown, som bruker en syntaks for å beskrive hvilke elementer som brukes.
|
||||||
|
Språket brukes på alt fra GitHub (på README filene) til å skrive større dokumentasjon med Pandoc.
|
||||||
|
|
||||||
|
Det finens uttallige forskjellige generatorer, men de to store (i dag) er [jekyll](https://jekyllrb.com/) og [HUGO](https://gohugo.io/).
|
||||||
|
Begge baserer seg på markdown, har en ganske lik filstruktur og er begge brukt masse.
|
||||||
|
Jekyll brukes faktisk for å generere [Github Pages](https://pages.github.com/).
|
||||||
|
|
||||||
|
### Versjonskontroll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
8
about.md
@@ -1,11 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: layouts/list
|
layout: layouts/page
|
||||||
title: Om
|
title: Om
|
||||||
permalink: /om/
|
permalink: /om/
|
||||||
---
|
---
|
||||||
|
|
||||||
Mitt navn er Øyvind Skaaden. Jeg er 22 år gammel og studerer Elektronisk systemdesign og innovasjon på NTNU.
|
Mitt navn er Øyvind Skaaden. Jeg er 21 år gammel og studerer Elektronisk systemdesign og innovasjon på NTNU.
|
||||||
|
|
||||||
Jeg er stor fan av open-source og prøver så godt jeg kan å fremme dette.
|
|
||||||
|
|
||||||
Jeg har både en [github](https://github.com/oyvindskaaden) og en [personlig git](https://git.glados.no/).
|
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ blockquote {
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
|
|||||||
@@ -27,13 +27,7 @@
|
|||||||
min-height: calc(100vh - 47.75rem);
|
min-height: calc(100vh - 47.75rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
.home-link>a {
|
||||||
.home-link a{
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
a.home-link:hover{
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ description: Personlig nettside for Øyvind Skaaden. Inneholder det meste av per
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
{% for home in site.data.home %}
|
{% for home in site.data.home %}
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a class="home-link" href="{{ home.href }}">
|
<a href="{{ home.href }}">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fas {{ home.icon }}"></i>
|
<i class="fas {{ home.icon }}"></i>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="no-anchor home-link">{{ home.title }}</h3>
|
|
||||||
</a>
|
</a>
|
||||||
|
<h3 class="no-anchor home-link"><a class="" href="{{ home.href }}">{{ home.title }}</a></h3>
|
||||||
<p>{{ home.description }}</p>
|
<p>{{ home.description }}</p>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
title: "TFE4130 - 1D Bølger"
|
|
||||||
description: "2021-01-12"
|
|
||||||
math: true
|
|
||||||
---
|
|
||||||
|
|
||||||
## Hva er bølger?
|
|
||||||
|
|
||||||
Bevegelse av partikler i et medium.
|
|
||||||
|
|
||||||
Dispersive gjør at signalet kan endre seg over tid og strekning.
|
|
||||||
Bølgehastigheten er avhengig av frekvensen.
|
|
||||||
|
|
||||||
Ikke-dispersive betyr at bølgen beveger seg med samme hastighet hele tiden, og vil derfor være lik ved alle distanser.
|
|
||||||
|
|
||||||
Bølger kan inteferere.
|
|
||||||
|
|
||||||
Kurset handler mest om EM-bølger, men mekaniske bølger er enklere.
|
|
||||||
Det er da kun trykk som beskriver en bølge, mot en vektor med flere komponenter i EM-bølger.
|
|
||||||
|
|
||||||
Velocity potential:
|
|
||||||
|
|
||||||
$$WIP$$
|
|
||||||
|
|
||||||
Velocities at depth:
|
|
||||||
|
|
||||||
$$WIP$$
|
|
||||||
|
|
||||||
Dispersjonsrelasjonen i havbølger
|
|
||||||
|
|
||||||
$$ \omega^2 = gk \tanh kd $$
|
|
||||||
|
|
||||||
Der $g$ er tyngdeakserelasjonen, $k$ er bølgetallet og $d$ er dybden.
|
|
||||||
|
|
||||||
### Forskjellige typer bølger
|
|
||||||
|
|
||||||
Longitudinale: Langsgående bølger.
|
|
||||||
|
|
||||||
Transversale: Bølger som beveger seg normalt på propageringsretningen.
|
|
||||||
|
|
||||||
### Matematisk
|
|
||||||
|
|
||||||
Bølgene er løsningen på bølgelikningen i forskjellige dimensjoner.
|
|
||||||
|
|
||||||
$$ \ddot{u} = \frac{\partial^2 u}{\partial t^2} = c^2 \nabla^2 u $$
|
|
||||||
|
|
||||||
Denne løses som en partiell differensiallikning.
|
|
||||||
|
|
||||||
En ikke-dispersiv hamonisk bølge er definert:
|
|
||||||
|
|
||||||
$$ p(x, t) = \hat{p} \sin(\omega t - kx) $$
|
|
||||||
|
|
||||||
Der $\omega = 2\pi f$ er frekvensen, $k = \tfrac{\omega}{c}$ er bølgekonstanten, $c$ er propageringshastigheten og $\hat{p}$ er bølgeamplituden.
|
|
||||||
|
|
||||||
## Lydbølger
|
|
||||||
|
|
||||||
Lydbølger er endringer i lydtrykket rundt standardtrykket/det statiske trykket.
|
|
||||||
|
|
||||||
$$ \underbrace{P_\text{total}(x,t)}_{\text{Lufttrykk, [Pa]}} = \underbrace{P_\text{atm}}_\text{Statisk trykk} + \underbrace{p(x,t)}_\text{endringer i trykket, lyd} $$
|
|
||||||
|
|
||||||
|
|
||||||
Bølgelikningen for lydbølger:
|
|
||||||
|
|
||||||
$$ \frac{\partial^2 p}{\partial x^2} - \frac{1}{c^2} \frac{\partial^2 p}{\partial t^2} $$
|
|
||||||
|
|
||||||
## Helmholtz' likning
|
|
||||||
|
|
||||||
Spesialtilfelle av bølgelikningen når bølgen er en harmonisk svingning.
|
|
||||||
|
|
||||||
$$ p(x,t) = p(x) e^{j\omega t} $$
|
|
||||||
|
|
||||||
Den tidsavhengige faktoren kan faktoriseres ut av likningen og vi står igjen med en ODE.
|
|
||||||
|
|
||||||
$$ \frac{\partial^2 p(x)}{\partial x^2} + k^2 p(x) = 0 $$
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/lecture
|
|
||||||
title: "TFE4130"
|
|
||||||
description: "1D Bølger forts."
|
|
||||||
date: "2021-01-14"
|
|
||||||
math: true
|
|
||||||
---
|
|
||||||
|
|
||||||
## Akustisk impedanse
|
|
||||||
|
|
||||||
## Akustisk intensitet
|
|
||||||
|
|
||||||
$$ \boldsymbol{I} = \frac{1}{T}\int_0^T p_\text{real}\boldsymbol{v}_\text{real}(t) dt $$
|
|
||||||
|
|
||||||
FOr en planbølge
|
|
||||||
|
|
||||||
$$ I_x = \frac{p_\text{rms}}{p_x c}$$
|
|
||||||
|
|
||||||
## Refleksjon og transmisjon
|
|
||||||
|
|
||||||
Dersom en børge beveger seg over en grenseflate mellom to forskjellige impedanser.
|
|
||||||
|
|
||||||
* Trykket nå være kontinuerlig over grenseflaten
|
|
||||||
* Farten over grenseflaten må være konstant.
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/list
|
|
||||||
title: "TFE4130"
|
|
||||||
description: "Bølgeforplantning"
|
|
||||||
---
|
|
||||||
|
|
||||||
## Filer og annet
|
|
||||||
|
|
||||||
Alle øvinger og andre viktige filer ligger på [git](https://git.glados.no/oyvindskaaden/TFE4130).
|
|
||||||
|
|
||||||
## Forelesninger
|
|
||||||
|
|
||||||
[2021-01-12](./lectures/2021-01-12/) - Intro
|
|
||||||
|
|
||||||
[2021-01-14](./lectures/2021-01-14/) - Bølger forts.
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
---
|
|
||||||
title: TIØ4252
|
|
||||||
description: Teknologiledelse, våren 2021
|
|
||||||
date: 2021-05-13
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Formelark
|
|
||||||
|
|
||||||
Formelark i TIØ4252 kan finnes [her][formel].
|
|
||||||
|
|
||||||
Kildekoden ligger på [git][git_formel].
|
|
||||||
|
|
||||||
[formel]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/formelark/formelark.pdf
|
|
||||||
[git_formel]:https://git.glados.no/oyvindskaaden/TIO4252/src/branch/main/formelark/
|
|
||||||
|
|
||||||
## Eksamen
|
|
||||||
|
|
||||||
Alle filer er tilgjengelig på [git][git].
|
|
||||||
|
|
||||||
[git]: https://git.glados.no/oyvindskaaden/TIO4252
|
|
||||||
|
|
||||||
Kombinert løsningsforslag for alle eksamener finnes [her][LF_alle].
|
|
||||||
|
|
||||||
[LF_alle]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/LF.pdf
|
|
||||||
|
|
||||||
| År | Eksamen | Oppgave | LF |
|
|
||||||
| :--- | :------ | :------------ | :------- |
|
|
||||||
| 2020 | Høst | [Oppgave][1] | [LF][2] |
|
|
||||||
| 2020 | Sommer | [Oppgave][3] | [LF][4] |
|
|
||||||
| 2020 | Vår | [Oppgave][5] | [LF][6] |
|
|
||||||
| 2019 | Høst | [Oppgave][7] | [LF][8] |
|
|
||||||
| 2019 | Sommer | [Oppgave][9] | [LF][10] |
|
|
||||||
| 2018 | Høst | [Oppgave][11] | [LF][12] |
|
|
||||||
| 2018 | Sommer | [Oppgave][13] | [LF][14] |
|
|
||||||
| 2018 | Vår | [Oppgave][15] | [LF][16] |
|
|
||||||
| 2017 | Høst | [Oppgave][17] | [LF][18] |
|
|
||||||
| 2017 | Vår | [Oppgave][19] | [LF][20] |
|
|
||||||
| 2014 | Sommer | [Oppgave][21] | [LF][22] |
|
|
||||||
| 2013 | Sommer | [Oppgave][23] | [LF][24] |
|
|
||||||
{: .table-responsive-lg .table }
|
|
||||||
|
|
||||||
[1]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20H/Eksamen_20H.pdf
|
|
||||||
[2]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20H/Losning_20H.pdf
|
|
||||||
[3]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20S/Eksamen_20S.pdf
|
|
||||||
[4]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20S/Losning_20S.pdf
|
|
||||||
[5]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20V/Eksamen_20V.pdf
|
|
||||||
[6]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/20V/Losning_20V.pdf
|
|
||||||
[7]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/19H/Eksamen_19H.pdf
|
|
||||||
[8]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/19H/Losning_19H.pdf
|
|
||||||
[9]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/19S/Eksamen_19S.pdf
|
|
||||||
[10]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/19S/Losning_19S.pdf
|
|
||||||
[11]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18H/Eksamen_18H.pdf
|
|
||||||
[12]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18H/Losning_18H.pdf
|
|
||||||
[13]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18S/Eksamen_18S.pdf
|
|
||||||
[14]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18S/Losning_18S.pdf
|
|
||||||
[15]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18V/Eksamen_18V.pdf
|
|
||||||
[16]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/18V/Losning_18V.pdf
|
|
||||||
[17]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/17H/Eksamen_17H.pdf
|
|
||||||
[18]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/17H/Losning_17H.pdf
|
|
||||||
[19]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/17V/Eksamen_17V.pdf
|
|
||||||
[20]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/17V/Losning_17V.pdf
|
|
||||||
[21]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/14S/Eksamen_14S.pdf
|
|
||||||
[22]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/14S/Losning_14S.pdf
|
|
||||||
[23]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/13S/Eksamen_13S.pdf
|
|
||||||
[24]:https://git.glados.no/oyvindskaaden/TIO4252/raw/branch/main/eksamen/13S/Losning_13S.pdf
|
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,540 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Oppsumering av TTK4145"
|
|
||||||
description: "Lot of theory and discussion, some fomulas, spring 2021."
|
|
||||||
date: 2021-05-04
|
|
||||||
math: true
|
|
||||||
---
|
|
||||||
|
|
||||||
## Fault tolerance
|
|
||||||
|
|
||||||
Hard to capture faults.
|
|
||||||
|
|
||||||
|
|
||||||
### Bugs
|
|
||||||
|
|
||||||
* 1 bug per 50 lines before testing
|
|
||||||
* 1 bug per 500 at release
|
|
||||||
* 1 bug per 550 after a year, the constant
|
|
||||||
|
|
||||||
1. Make the program work within specs.
|
|
||||||
2. Run/Tests of the program-
|
|
||||||
3. Errors happen
|
|
||||||
4. Locate errors
|
|
||||||
* Incomplete spec
|
|
||||||
* Missing handleling of som situation
|
|
||||||
5. Fix code
|
|
||||||
|
|
||||||
### Traditional error handeling
|
|
||||||
|
|
||||||
{% highlight java %}
|
|
||||||
FILE *
|
|
||||||
openConfigFile(){
|
|
||||||
FILE * f = fopen("/path/to/config.conf");
|
|
||||||
if (f == NULL) {
|
|
||||||
switch(errno){
|
|
||||||
case ENOMEM: {
|
|
||||||
...
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ENOTDIR: {
|
|
||||||
...
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Do this for all errors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
### Causes of errors
|
|
||||||
|
|
||||||
* Incomplete specification
|
|
||||||
* Software bugs
|
|
||||||
* HW problems
|
|
||||||
* Communication problems
|
|
||||||
|
|
||||||
### Fault tolerance in real time systems
|
|
||||||
|
|
||||||
The problem with traditional errorhandleing is that errors can happen at any possible time.
|
|
||||||
This is extremely hard to test.
|
|
||||||
|
|
||||||
This is some of the error handling real time programming have.
|
|
||||||
|
|
||||||
* Handling of unexpected errors
|
|
||||||
* More threads hanles errors
|
|
||||||
* Can not test the conventional way
|
|
||||||
* Can only show extistence of errors
|
|
||||||
* Can not find errors in specification
|
|
||||||
* Can not find race conditions
|
|
||||||
|
|
||||||
The fault path is shown under.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
With fault tolerance the path looks something more like the figure under.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Error handling
|
|
||||||
|
|
||||||
Keep it simple!
|
|
||||||
|
|
||||||
The error modes is a part of the module interface.
|
|
||||||
|
|
||||||
One way is to handle all errors the same way.
|
|
||||||
Handle the as if it was the worst error.
|
|
||||||
Crash and start again.
|
|
||||||
|
|
||||||
A different approach is to check that everything is OK.
|
|
||||||
|
|
||||||
To test how the systems responds for a unknown error is to insert a failed acceptance test (a not OK signal).
|
|
||||||
|
|
||||||
### Redundancy
|
|
||||||
|
|
||||||
* If I have $N$ copies of my data, it is possible to handle that one is destroyed.
|
|
||||||
* Sending $N$ messages, trying $N$ times.
|
|
||||||
|
|
||||||
**Static redundancy**
|
|
||||||
|
|
||||||
* $N$ active copies. Sending $N$ messages if it is necessary or not.
|
|
||||||
* Detecting errors is not important.
|
|
||||||
* Handles cosmic rays easily.
|
|
||||||
|
|
||||||
**Dynammic redunancy**
|
|
||||||
|
|
||||||
* Relies on detecting the error and recovering
|
|
||||||
* Resend if timeout and not receiving "ack"
|
|
||||||
* Go with default if no messages have been received
|
|
||||||
* The acceptancetest must be good.
|
|
||||||
|
|
||||||
|
|
||||||
### Fault model
|
|
||||||
|
|
||||||
#### Example with storage functions.
|
|
||||||
|
|
||||||
**Step 1: Failure modes**
|
|
||||||
|
|
||||||
Find the failure modes: What could go wrong?
|
|
||||||
|
|
||||||
* **Write**: May return "I failed". Does not know why it faield
|
|
||||||
* **Read**: May return "I failed". Does not know why it failed.
|
|
||||||
|
|
||||||
**Step 2: Detect, Simplify, Inject errors**
|
|
||||||
|
|
||||||
* Write information on where/what/how the process is doing.
|
|
||||||
* All errors --> Fail
|
|
||||||
* Inject errors
|
|
||||||
|
|
||||||
**Step 3: Handling with redundancy**
|
|
||||||
|
|
||||||
* Have multiple copies of the the information
|
|
||||||
* Use only the newest
|
|
||||||
|
|
||||||
#### Example with communication function
|
|
||||||
|
|
||||||
**Step 1: Failure modes**
|
|
||||||
|
|
||||||
* Message
|
|
||||||
* Lost
|
|
||||||
* Delayed
|
|
||||||
* Corrupted
|
|
||||||
* Duplicated
|
|
||||||
* Wrong recipient
|
|
||||||
|
|
||||||
**Step 2: Detection, Merging of errormodes and error injection**
|
|
||||||
|
|
||||||
* Adding information to message
|
|
||||||
* Checksum
|
|
||||||
* Session ID
|
|
||||||
* Sequence number
|
|
||||||
* Adding "ack" on well recieved messages
|
|
||||||
* All errors will be treaded as "Lost message"
|
|
||||||
* Injection
|
|
||||||
* Occasionally throw away some messages
|
|
||||||
|
|
||||||
**Step 3: Handling with redundancy**
|
|
||||||
|
|
||||||
* Timeout
|
|
||||||
* Retransmit message
|
|
||||||
|
|
||||||
#### Example with processes and caculations
|
|
||||||
|
|
||||||
A calculation is an abstract, so how can we talk generally about the failure modes.
|
|
||||||
|
|
||||||
**Step 1: Failure modes**
|
|
||||||
|
|
||||||
One failure mode
|
|
||||||
|
|
||||||
**Step 2: Detect, simplify, inject errors**
|
|
||||||
|
|
||||||
All failed acceptance tests will "PANIC" or "STOP".
|
|
||||||
|
|
||||||
**Step 3: Handling with redundancy**
|
|
||||||
|
|
||||||
There are three solutions:
|
|
||||||
|
|
||||||
1. Checkpoint restart
|
|
||||||
* Do all the work incuding the acceptance test
|
|
||||||
* Wait with the "side effects"
|
|
||||||
* Store a checkpoint
|
|
||||||
* Do the "side effects"
|
|
||||||
2. Process pairs
|
|
||||||
* Crash and let an another process take over
|
|
||||||
3. Presistent processes
|
|
||||||
|
|
||||||
|
|
||||||
## Transactions
|
|
||||||
|
|
||||||
A transaction is a design framework for Damage Confinement and Error Recovery.
|
|
||||||
|
|
||||||
* An *atomic action*, just without the backward recovery error mode as standard mode
|
|
||||||
* invincible and instantaneous "calculation" seen from the outside
|
|
||||||
* A transformation from one consistent state to another'
|
|
||||||
* A modular computation
|
|
||||||
|
|
||||||
### Four features: ACID
|
|
||||||
|
|
||||||
* **A**tomicity: Either all side effects happens or none
|
|
||||||
* **C**oncistency: Leaves the system in a consistent state when finished
|
|
||||||
* **I**solation: Errors does not spread
|
|
||||||
* **D**urability: Results are not lost
|
|
||||||
|
|
||||||
### Atomic Actions
|
|
||||||
|
|
||||||
**Resumption vs. Termination mode**
|
|
||||||
* If we continue where we were (e.g. after the interrupt) --> *Resumption*
|
|
||||||
* If we continue somewhere else (i.e. terminating what we where doing) --> Termination
|
|
||||||
|
|
||||||
**Async Notification (AN) = Low level thread interaction**
|
|
||||||
* Async event handling. ("Signals") (resumption)
|
|
||||||
* Modeled after a HW interrupt
|
|
||||||
* Can be sent to the correct thread
|
|
||||||
* Can be handled, ignored, blocked --> The domain can be controlled.
|
|
||||||
* Often lead to polling
|
|
||||||
* Could rather skip the signal and poll a status variable or a message queue
|
|
||||||
* Useless
|
|
||||||
* ATC --> Async transfer of Control (termination)
|
|
||||||
* Canceling threads
|
|
||||||
* setjmpt/longjmp could convert signals to ATC (not really, but still)
|
|
||||||
* ADA: a strictured mechanism for ATV is integraded with the selected statement
|
|
||||||
* RT Java: A structured mechanism for ATC is integraded with the exception-handling mechanism
|
|
||||||
|
|
||||||
#### Cancelling threads
|
|
||||||
|
|
||||||
**Yes, killing threads is ATC!**
|
|
||||||
|
|
||||||
* Can make termination model by letting domain be a thread
|
|
||||||
* "Create a `doWork` thread, and kill it if the action fails"
|
|
||||||
* Ca still control domain by disabling "cancelstate"
|
|
||||||
|
|
||||||
**But, but, but: It leaves ut in undifined state!?**
|
|
||||||
* Not if we have...
|
|
||||||
* Full control over changed state (like logs or recovery points) or some other way of recovering well.
|
|
||||||
* A lock manager that can unlock on behalf of killed thread
|
|
||||||
* Some control of where we were killed (like nok in the middle of a lock manager or log call)
|
|
||||||
* An this is what we have!
|
|
||||||
|
|
||||||
|
|
||||||
## Shared variable synchronization
|
|
||||||
|
|
||||||
### Non-Preemptive scheduling
|
|
||||||
|
|
||||||
Controlling a pump filling a tank.
|
|
||||||
|
|
||||||
**Spec:**
|
|
||||||
* Every second: measure the water level of the tank and generate the reference to the pump
|
|
||||||
* 10 times a second: Set the power of the pump motor
|
|
||||||
* Do some GUI: let the human control the process
|
|
||||||
|
|
||||||
#### A trivial solution: "Cyclic Exectutive"
|
|
||||||
|
|
||||||
{% highlight java %}
|
|
||||||
oldTime = now();
|
|
||||||
i = 0;
|
|
||||||
while(true) {
|
|
||||||
i = i + 1;
|
|
||||||
if (i % 10 == 0) {
|
|
||||||
i = 0;
|
|
||||||
calculatePumpReference();
|
|
||||||
}
|
|
||||||
controlPump();
|
|
||||||
do {
|
|
||||||
handleUserEvent();
|
|
||||||
} while(now() < oldTime + 0.1);
|
|
||||||
oldTime = oldTime + 0.1;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
**Drawbacks**
|
|
||||||
|
|
||||||
* OK tasks?
|
|
||||||
* Timing hard to tune (what if pump sampling should be $\pi$/10?)
|
|
||||||
* Overload (what if `calucaltePumpReference` uses more than 1/10 seconds?)
|
|
||||||
* How to add new tasks? (Everything is coupled)
|
|
||||||
* Waste of time in the do-loop?
|
|
||||||
* What is priority of `handleUserEvents`?
|
|
||||||
* How are erros, exceptions, alarms etc. handled?
|
|
||||||
|
|
||||||
#### Better soulution with Non-preemptive scheduler
|
|
||||||
|
|
||||||
* *3 taskts* administered by a scheduler
|
|
||||||
* The scheduler takes care of who runs and timing
|
|
||||||
* Scheduler often inculuded in OSes
|
|
||||||
* Introducing priorities
|
|
||||||
|
|
||||||
{% highlight java %}
|
|
||||||
/**
|
|
||||||
* scheduler_registerThread(function, time, priority)
|
|
||||||
* Higher priority numer means higher priority in scheduler
|
|
||||||
*/
|
|
||||||
main() {
|
|
||||||
scheduler_registrerThread(controlPump, 0.1, 3);
|
|
||||||
scheduler_registrerThread(calculatePumpReference, 1, 2);
|
|
||||||
scheduler_registrerThread(handleUserEvents, 0.2, 1);
|
|
||||||
scheduler_mainLoop();
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
**Some notes on priorities**
|
|
||||||
* Priority is generally not important; rather, the main rule is to give higher priority to shorter-deadline tasks.
|
|
||||||
* This allows tasks to reach its deadlines.
|
|
||||||
* ... but this is not always the case - if e.g. the tasks are cooperating
|
|
||||||
* We still handle overload badly
|
|
||||||
* And: What connection between deadline and priority to start with?
|
|
||||||
* Is this a good dependency seen from a code quality perspective?
|
|
||||||
|
|
||||||
### Pros and cons of nonpreemptive scheduling
|
|
||||||
|
|
||||||
| **Pros** | **Cons** |
|
|
||||||
| :--------------------------------------------- | :------------------------------------------------------------------------- |
|
|
||||||
| Simple, intuitive, predictable | C macro hell |
|
|
||||||
| No kernel | Threads must cooperate <-- a form of dependency breaking module boundaries |
|
|
||||||
| Fast switching times | Heavy threads must be divided |
|
|
||||||
| Some elegant sunchronization patterns possible | Can we handle blocking of library functions? |
|
|
||||||
| | Unrobust to errors |
|
|
||||||
| | Unrobust to (heavy) error handling |
|
|
||||||
| | Hard to tune at end of project |
|
|
||||||
{: .table-responsive-lg .table }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Preemptive Kernel
|
|
||||||
|
|
||||||
* Preemption, thread objects and the timer interrupt
|
|
||||||
* Enabling synchronization: Busy waiting, tes-and-set, disabling the timer interrupt
|
|
||||||
* Blocking and suspend & resume
|
|
||||||
* An API for synchronization? Semaphores!
|
|
||||||
|
|
||||||
|
|
||||||
#### Preemption
|
|
||||||
|
|
||||||
* Make a handler for a timer interrupt
|
|
||||||
* Store all registers (including IP & SP) in a "thread object"
|
|
||||||
* Organize queue of processes (Round Robin e.g. - a collection of thread objects?)
|
|
||||||
* Can synchronize by: `while(!ready);` (busy wating, "spin locks")
|
|
||||||
|
|
||||||
**Bad solution**
|
|
||||||
|
|
||||||
{% highlight java%}
|
|
||||||
while(lock==1) {}
|
|
||||||
lock = 1;
|
|
||||||
// We may run
|
|
||||||
lock = 0;
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
**Better solution**
|
|
||||||
|
|
||||||
{% highlight java%}
|
|
||||||
void t1() {
|
|
||||||
flag1 = 1; // Declare my intention
|
|
||||||
turn = 2; // But try to be polite
|
|
||||||
while(flag2 == 1 && turn == 2) {}
|
|
||||||
// We may run
|
|
||||||
flag1 = 0;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
##### Looking more closely at the arsenal
|
|
||||||
|
|
||||||
**How can we make basic synchronization under preemption?**
|
|
||||||
|
|
||||||
* Spin locks (wasting time and cpu)
|
|
||||||
* Test&Set (swap) assembly instruction (atomic, but not obvious)
|
|
||||||
* Disable interrupt (steals control from OS/scheduler)
|
|
||||||
|
|
||||||
**But**
|
|
||||||
* If we disable the timer interrupt we don not have preemption any more
|
|
||||||
* And... Are these good abstractions in the application programmer domain?
|
|
||||||
|
|
||||||
#### Blocked threads
|
|
||||||
|
|
||||||
**Let us introduce another queue; the collection of threads not running, waiting for something**
|
|
||||||
|
|
||||||
* Fixes the bad performance of spin locks. Is conceptually better.
|
|
||||||
* `suspend` moves a thread object from "run" queue to "blocked" queue
|
|
||||||
* `resume` moves it back.
|
|
||||||
|
|
||||||
##### Two bad solutions
|
|
||||||
|
|
||||||
{% highlight java%}
|
|
||||||
t1(){
|
|
||||||
while(busy == 1) suspend();
|
|
||||||
busy = 1; // It is free; tak it - No
|
|
||||||
// Run
|
|
||||||
busy = 0; // Release resource
|
|
||||||
|
|
||||||
resume t2 // No
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
{% highlight java%}
|
|
||||||
t1(){
|
|
||||||
while(TestNSet(busy, 1) == 1) suspend();
|
|
||||||
// We own resource
|
|
||||||
// Run
|
|
||||||
busy = 0;
|
|
||||||
|
|
||||||
resume t2 // No
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
##### The suspend/resume problem
|
|
||||||
|
|
||||||
{% highlight java%}
|
|
||||||
// Global variables
|
|
||||||
bool g_initDone = False;
|
|
||||||
|
|
||||||
// Threads
|
|
||||||
t1(){ t2(){
|
|
||||||
/* Do init */ if (g_initDone == False) {
|
|
||||||
g_initDone = True; Suspend();
|
|
||||||
resume(t2) }
|
|
||||||
// Continue executing // Continue exectuting
|
|
||||||
} }
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
#### Priorities
|
|
||||||
|
|
||||||
* Threads mey have different *priorities*. (A sortet run-queue, or more of them.)
|
|
||||||
* Only if there are no running threads on a higher priority, a thread will run.
|
|
||||||
* We are not aiming for some sens of fairness (!). But predictability.
|
|
||||||
* And priorities supports schedulability proofs.
|
|
||||||
* But we open ourselves up to *starvation*. A thread may not ever get to run, even if it is runnable.
|
|
||||||
|
|
||||||
|
|
||||||
#### Application-level syncronization
|
|
||||||
|
|
||||||
**SO, the application programmer needs some syncronozation primitives...**
|
|
||||||
|
|
||||||
* `sleep()`? - Ok
|
|
||||||
* Publish `suspend` and `resume` - No
|
|
||||||
* Events (`wait` and `signal`) - Just named versions of suspend & resume semantics.
|
|
||||||
* Fixes the need to know aboud "thread objects". But no
|
|
||||||
* ...or "Condition variables" - same
|
|
||||||
|
|
||||||
|
|
||||||
### Semaphores
|
|
||||||
|
|
||||||
**A counting semaphore**
|
|
||||||
|
|
||||||
* `signal(SEM)` increases the counter (possibly resuming a thread waiting for the semaphore)
|
|
||||||
* `wait(SEM)` decrements the counter - will block (be suspended) `if SEM == 0`
|
|
||||||
* The semaphores value can not be negative
|
|
||||||
* Of course; These calls are protected from interleaving by disabling the timer interrupt
|
|
||||||
|
|
||||||
**We solve beautifully:**
|
|
||||||
* Mutual Exclusion
|
|
||||||
* Conditional Synchronization (ref `suspend`/`resume`)
|
|
||||||
* Basic resource allocation
|
|
||||||
|
|
||||||
**Semaphore variations**
|
|
||||||
|
|
||||||
* `wait` and `signal` nay take parameter value to add or subtract
|
|
||||||
* `getValue(SEM)` returning the value of the semaphore. (Fishy)
|
|
||||||
* BInary semaphores (`signal` will fail `if SEM == 1`)
|
|
||||||
* Who is woken at `signal` (FIFO, Arbitrary, Highest priority)
|
|
||||||
* The mutex
|
|
||||||
* binary
|
|
||||||
* ownership
|
|
||||||
* allows mulitple waits by owner
|
|
||||||
* regions (may be released by Javas `wait` or POSIX condition variables)
|
|
||||||
* RTFM
|
|
||||||
|
|
||||||
**Semaphore challenges**
|
|
||||||
|
|
||||||
* Breaks modules (both ways)
|
|
||||||
* Does not scale!
|
|
||||||
* Deadlocks
|
|
||||||
* Global analysis --> Does not scale
|
|
||||||
* Can not release "temporarily
|
|
||||||
* "Limited expressive power". Some reasonalbe problems are hard to solve
|
|
||||||
* Ref ["The Little Book of Semaphores"](https://greenteapress.com/semaphores/LittleBookOfSemaphores.pdf)
|
|
||||||
|
|
||||||
### Why shared-variable synchronization
|
|
||||||
|
|
||||||
**Why not?**
|
|
||||||
|
|
||||||
* "Shared variables" is bad code quality
|
|
||||||
* Ref global variables, and data members in module interfaces
|
|
||||||
* An obvious bottleneck? Scales terribly
|
|
||||||
* "Variables" are passive objects
|
|
||||||
* They can not protect themselves
|
|
||||||
* Why use synchronization when it is communication we need?
|
|
||||||
* Technology transfers badly to distibuted systems
|
|
||||||
* ... and this is before we start discussing how hard it is
|
|
||||||
|
|
||||||
**Why?**
|
|
||||||
|
|
||||||
* Part of the "real-time" design pattern
|
|
||||||
* "One thread per timing demand"
|
|
||||||
* We do have scheduling proofs and best practises
|
|
||||||
* Timing analysis is global anyway
|
|
||||||
* Scalability and deadlock analysis may not be the limiting constraint
|
|
||||||
* HW is shared memory architecture
|
|
||||||
* Infrastucture is avalible
|
|
||||||
* Communication systems requires infrastucture that we may not have
|
|
||||||
|
|
||||||
#### *All* resources are shared!
|
|
||||||
|
|
||||||
* Memory, certainly
|
|
||||||
* "Hidden" memory used by libraries (.. your own modules and the kernel)
|
|
||||||
* If the library takes care of this itself, it is called *"reentrant"*
|
|
||||||
* Sensors and actuators
|
|
||||||
* "CPU" - Computing capacity
|
|
||||||
* *This* is real-time programming; We solve it by *Scheduling*
|
|
||||||
* ... any other interface
|
|
||||||
|
|
||||||
|
|
||||||
#### Some standard problems/pit-falls
|
|
||||||
|
|
||||||
* **Race condition**: A bug that surfaces by unfortunate timing or order of events
|
|
||||||
* **Deadlock:** system in circular wait
|
|
||||||
* Special case of livelock
|
|
||||||
* Does not use CPU
|
|
||||||
* **Livelock:** system locked in a subset of states
|
|
||||||
* like deadlock, but we use CPU
|
|
||||||
* Busy-Waiting is a livelock
|
|
||||||
* **Starvation:** A thread does "by accident" not get the necessary resources
|
|
||||||
|
|
||||||
|
|
||||||
#### Features in syncronization
|
|
||||||
|
|
||||||
* Critical Section - Code that must not be interupted
|
|
||||||
* Mutual Exclusion - More piecesof code that must not interrupt each other
|
|
||||||
* Bounded buffer - Buffer with full/empty synchronization
|
|
||||||
* Read/Write Locks
|
|
||||||
* Readers can interleave eachother
|
|
||||||
* Writers have mutual exclusion
|
|
||||||
* Condition Syncronization - Blocking on event or status
|
|
||||||
* Guards etc.
|
|
||||||
* Resource allocation
|
|
||||||
* More than mutual exclution!
|
|
||||||
* Ref: The lock manager
|
|
||||||
* Rendezvouz/barriere - Synchronization point
|
|
||||||
* Ref: AA "end boundary"
|
|
||||||
* Communication
|
|
||||||
* Broadcast
|
|
||||||
* ...
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/list
|
|
||||||
title: "TTK4145"
|
|
||||||
description: "Sanntidsprogrammering"
|
|
||||||
---
|
|
||||||
|
|
||||||
## Oppsummering
|
|
||||||
|
|
||||||
[Oppsummering](summary/) av faget TTK4145.
|
|
||||||
|
|
||||||
## Prosjekt
|
|
||||||
|
|
||||||
## Øvinger
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/lecture
|
|
||||||
title: "TTT4280"
|
|
||||||
description: "Labforelesning 1"
|
|
||||||
date: "2021-01-18"
|
|
||||||
math: false
|
|
||||||
---
|
|
||||||
|
|
||||||
## Laboratorium
|
|
||||||
|
|
||||||
### System
|
|
||||||
|
|
||||||
* Raspberry Pi
|
|
||||||
* Linux
|
|
||||||
* A/D omformere
|
|
||||||
* Python
|
|
||||||
|
|
||||||
### Oppgaver
|
|
||||||
|
|
||||||
* Systemoppsett
|
|
||||||
* Klargjøre rPi og instrumenteringskrets
|
|
||||||
* Akustikk
|
|
||||||
* Beregne retning til lydkilde
|
|
||||||
* Radar
|
|
||||||
* Doppler
|
|
||||||
* Optikk
|
|
||||||
|
|
||||||
## Laboppgave 1
|
|
||||||
|
|
||||||
1. Tegne blokkdiagram
|
|
||||||
2. Studere datablat for ADC
|
|
||||||
3. Drøfte fordeler med DMA
|
|
||||||
|
|
||||||

|
|
||||||
|
Before Width: | Height: | Size: 112 KiB |
@@ -1,57 +0,0 @@
|
|||||||
---
|
|
||||||
title: "TTT4280 - Måleusikkerhet"
|
|
||||||
description: "2021-01-11"
|
|
||||||
math: true
|
|
||||||
---
|
|
||||||
|
|
||||||
## Faglig innhold
|
|
||||||
|
|
||||||
* Måleusikkerhet
|
|
||||||
* Støyanalyse
|
|
||||||
* Sensorer og aktuatorer
|
|
||||||
* Sensortyper
|
|
||||||
|
|
||||||
## Hva er sensorer
|
|
||||||
|
|
||||||
Noe som kan lese den fysiske verdenen til noe vi kan prosessere.
|
|
||||||
|
|
||||||
Finnes mange forskjellige sensorer. Flere i biler, telefoner, klokker osv.
|
|
||||||
|
|
||||||
Tidligere ble det estimert at vi skulle ha ca 50 milliarder sensorer i 2020.
|
|
||||||
|
|
||||||
## Måleusikkerhet
|
|
||||||
|
|
||||||
Bruk av sensor = Utføre en måling.
|
|
||||||
|
|
||||||
...og måleverdier har en usikkerhet.
|
|
||||||
|
|
||||||
I visse situasjoner har måleusikkerheten masse å si, i andre har det ikke så mye å si.
|
|
||||||
|
|
||||||
Sensitivitet er en måling for å ikke gjøre en Type II feil (alarmen løser **ikke** ut).
|
|
||||||
|
|
||||||
Spesifisitet er en måling for å ikke gjøre en Type I feil (**falsk** alarm).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Grunnmodell for måleprosess
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
I realiteten er det støy i alle ledd.
|
|
||||||
|
|
||||||
Sannsynligheten for at et sensorsystem gir riktig svar påvirkes av (minst) to faktorer:
|
|
||||||
|
|
||||||
* Hvor entydig er underliggende sammenhenger?
|
|
||||||
* Hvor nøyaktig kan vi måle de fysiske størrelsene?
|
|
||||||
|
|
||||||
$$ \text{SNR} = \frac{\text{(Effekten for) sann verdi}}{\text{(Effekten for) støy}} $$
|
|
||||||
|
|
||||||
### Målefeil
|
|
||||||
|
|
||||||
Stokastiske feil (Type A feil) påvirker målingens *presisjon*.
|
|
||||||
Presisjonen beskriver hvor reproduserbar en måling er.
|
|
||||||
|
|
||||||
Systematiske feil (Type B feil) påvirker målingens *sannhet*.
|
|
||||||
Sannheten er en måling på hvor langt unna den sanne verdien en måling er.
|
|
||||||
|
|
||||||

|
|
||||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/lecture
|
|
||||||
title: "TTT4280"
|
|
||||||
description: "Usikkerhet og feilforplantning"
|
|
||||||
date: "2021-01-18"
|
|
||||||
math: true
|
|
||||||
---
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
layout: layouts/list
|
|
||||||
title: "TTT4280"
|
|
||||||
description: "Sensorer og instrumentering"
|
|
||||||
---
|
|
||||||
|
|
||||||
## Forelesninger
|
|
||||||
|
|
||||||
[2021-01-11](./lectures/2021-01-11/) - Intro og målesikkerhet
|
|
||||||
|
|
||||||
[2021-01-18](./lectures/2021-01-18/) - Usikkerhet og feilforplantning
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 727 KiB After Width: | Height: | Size: 727 KiB |
|
Before Width: | Height: | Size: 412 KiB After Width: | Height: | Size: 412 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 846 KiB After Width: | Height: | Size: 846 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 382 KiB After Width: | Height: | Size: 382 KiB |
|
Before Width: | Height: | Size: 518 KiB After Width: | Height: | Size: 518 KiB |
|
Before Width: | Height: | Size: 604 KiB After Width: | Height: | Size: 604 KiB |
@@ -4,15 +4,13 @@ title: "NTNU"
|
|||||||
description: "Alt som har med studier på NTNU å gjøre."
|
description: "Alt som har med studier på NTNU å gjøre."
|
||||||
---
|
---
|
||||||
|
|
||||||
{% for semester in site.data.ntnu-courses %}
|
{% assign courses = site.data.ntnu-courses | sort: 'update' %}
|
||||||
<h2>{{ semester.name }}</h2>
|
|
||||||
{% assign courses = semester.courses | sort: 'updated' | reverse %}
|
|
||||||
<div class="row row-cols-1 row-cols-md-3">
|
<div class="row row-cols-1 row-cols-md-3">
|
||||||
{% for course in courses %}
|
{% for course in courses %}
|
||||||
<div class="col mb-4">
|
<div class="col mb-4">
|
||||||
<div class="card h-100">
|
<div class="card h-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title no-anchor" data-toc-skip><a href="{{ semester.href }}/{% if course.href %}{{ course.href }}{% else %}{{ course.course }}{% endif %}">{{ course.course | upcase }}</a></h5>
|
<h5 class="card-title no-anchor" data-toc-skip><a href="{% if course.href %}{{ course.href }}{% else %}{{ course.course }}{% endif %}">{{ course.course | upcase }}</a></h5>
|
||||||
<p class="card-text">{{ course.desc }}</p>
|
<p class="card-text">{{ course.desc }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
@@ -21,5 +19,4 @@ description: "Alt som har med studier på NTNU å gjøre."
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
|
||||||
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 480 KiB After Width: | Height: | Size: 480 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |