split files
This commit is contained in:
parent
45391642f2
commit
bb416ae5b4
1661
photonics.typ
1661
photonics.typ
File diff suppressed because it is too large
Load Diff
161
src/analysis_1.typ
Normal file
161
src/analysis_1.typ
Normal file
@ -0,0 +1,161 @@
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
|
||||
// {{{
|
||||
== Mengen
|
||||
=== Element
|
||||
#table(columns: 2, stroke: none, align: horizon, inset: 2pt,
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$x in A$ ])], [x ist in der Menge A enthalten.],
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$x in.not A$ ])], [x ist *nicht* in der Menge A enthalten.],
|
||||
)
|
||||
|
||||
Die Notation ist dabei egal: \
|
||||
$x in A arrow.l.r.double.long A in.rev x$
|
||||
|
||||
=== Leere Menge
|
||||
#table(columns: 2, stroke: none, align: horizon, inset: 2pt,
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [ $emptyset = \{\}$ ])], [Die Menge enthält keine Elemente.])
|
||||
|
||||
=== Teilmengen
|
||||
#table(columns: 2, stroke: none, align: horizon, inset: 2pt,
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$A subset.eq B$])], [A ist eine Teilmenge von B (A = B ist möglich)],
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$A subset B$])], [A ist eine strikte Teilmenge von B (A = B ist nicht möglich)],
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$A subset.not.eq B$ ])], [A ist keine Teilmenge von B (A = B ist nicht möglich)],
|
||||
[#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$A subset.not B$ ])], [A ist keine strikte Teilmenge von B (A = B ist möglich)],
|
||||
)
|
||||
|
||||
=== Operationen
|
||||
#let op_scale = 0.6
|
||||
#table(columns: 3, stroke: (x: none), align: horizon,
|
||||
[Vereinigung \ $A union B$],[
|
||||
#cetz.canvas({
|
||||
cetz.draw.scale(op_scale)
|
||||
cetz-venn.venn2(
|
||||
name: "Vereinigung",
|
||||
a-fill: yellow.transparentize(40%),
|
||||
b-fill: yellow.transparentize(40%),
|
||||
ab-fill: yellow.transparentize(40%),
|
||||
)
|
||||
cetz.draw.content("Vereinigung.a", [A])
|
||||
cetz.draw.content("Vereinigung.b", [B])
|
||||
})
|
||||
],[Die Menge aus allen Elementen.],
|
||||
[Durchschnitt \ $A inter B$],[
|
||||
#cetz.canvas({
|
||||
cetz.draw.scale(op_scale)
|
||||
cetz-venn.venn2(
|
||||
name: "Durchschnitt",
|
||||
a-fill: none,
|
||||
b-fill: none,
|
||||
ab-fill: yellow.transparentize(40%),
|
||||
)
|
||||
cetz.draw.content("Durchschnitt.a", [A])
|
||||
cetz.draw.content("Durchschnitt.b", [B])
|
||||
})
|
||||
],[Alle Elemente welche in A und B sind.],
|
||||
[Mengendifferenz \ $A \\ B$],[
|
||||
#cetz.canvas({
|
||||
cetz.draw.scale(op_scale)
|
||||
cetz-venn.venn2(
|
||||
name: "Mengendifferenz",
|
||||
a-fill: yellow.transparentize(40%),
|
||||
b-fill: none,
|
||||
ab-fill: none,
|
||||
)
|
||||
cetz.draw.content("Mengendifferenz.a", [A])
|
||||
cetz.draw.content("Mengendifferenz.b", [B])
|
||||
})
|
||||
],[Alle Elemente welche nur in A vorkommen aber nicht in B.],
|
||||
[Symmetrische Differenz \ $A Delta B :eq (A \\ B) union (B \\ A)$],[
|
||||
#cetz.canvas({
|
||||
cetz.draw.scale(op_scale)
|
||||
cetz-venn.venn2(
|
||||
name: "Symmetrische Differenz",
|
||||
a-fill: yellow.transparentize(40%),
|
||||
b-fill: yellow.transparentize(40%),
|
||||
ab-fill: none,
|
||||
)
|
||||
cetz.draw.content("Symmetrische Differenz.a", [A])
|
||||
cetz.draw.content("Symmetrische Differenz.b", [B])
|
||||
})
|
||||
],[Alle Elemente welche in A oder B sind jedoch nich in beiden liegen.],
|
||||
[Komplementierung \ $accent(A, macron) :eq G \\ B$],[
|
||||
#cetz.canvas(background: yellow.transparentize(40%), {
|
||||
cetz.draw.scale(op_scale * 0.6)
|
||||
cetz.draw.rect((0, 0),(8, 5))
|
||||
cetz.draw.circle((2, 3), fill: white)
|
||||
cetz.draw.circle((3, 3))
|
||||
cetz.draw.circle((6, 1.5))
|
||||
cetz.draw.content((1.5, 3), [A])
|
||||
cetz.draw.content((3.5, 3), [B])
|
||||
cetz.draw.content((6, 1.5), [C])
|
||||
cetz.draw.content((1, 1), [G])
|
||||
})
|
||||
],[Alle Elemente der Grundmenge G welche nicht in A sind.],
|
||||
)
|
||||
|
||||
=== Kartesisches Produkt
|
||||
|
||||
== Funktionen
|
||||
Definition
|
||||
|
||||
=== Urbild & Bild
|
||||
|
||||
=== Identität
|
||||
|
||||
=== Surjektivität, Injektivität, Bijektivität
|
||||
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (1, 4))
|
||||
content((0.5, 0.5), [1])
|
||||
content((0.5, 1.5), [2])
|
||||
content((0.5, 2.5), [3])
|
||||
content((0.5, 3.5), [4])
|
||||
rect((3, 0), (4, 3))
|
||||
content((3.5, 0.5), [a])
|
||||
content((3.5, 1.5), [b])
|
||||
content((3.5, 2.5), [c])
|
||||
line((1, 0.5), (3, 0.5), mark: (end: ">"), fill: black)
|
||||
line((1, 1.5), (3, 1.5), mark: (end: ">"), fill: black)
|
||||
line((1, 2.5), (3, 2.5), mark: (end: ">"), fill: black)
|
||||
line((1, 3.5), (3, 2.5), mark: (end: ">"), fill: black)
|
||||
})
|
||||
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (1, 3))
|
||||
content((0.5, 0.5), [1])
|
||||
content((0.5, 1.5), [2])
|
||||
content((0.5, 2.5), [3])
|
||||
rect((3, 0), (4, 4))
|
||||
content((3.5, 0.5), [a])
|
||||
content((3.5, 1.5), [b])
|
||||
content((3.5, 2.5), [c])
|
||||
content((3.5, 3.5), [d])
|
||||
line((1, 0.5), (3, 0.5), mark: (end: ">"), fill: black)
|
||||
line((1, 1.5), (3, 1.5), mark: (end: ">"), fill: black)
|
||||
line((1, 2.5), (3, 2.5), mark: (end: ">"), fill: black)
|
||||
})
|
||||
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (1, 4))
|
||||
content((0.5, 0.5), [1])
|
||||
content((0.5, 1.5), [2])
|
||||
content((0.5, 2.5), [3])
|
||||
content((0.5, 3.5), [4])
|
||||
rect((3, 0), (4, 4))
|
||||
content((3.5, 0.5), [a])
|
||||
content((3.5, 1.5), [b])
|
||||
content((3.5, 2.5), [c])
|
||||
content((3.5, 3.5), [d])
|
||||
line((1, 0.5), (3, 0.5), mark: (end: ">"), fill: black)
|
||||
line((1, 1.5), (3, 1.5), mark: (end: ">"), fill: black)
|
||||
line((1, 2.5), (3, 2.5), mark: (end: ">"), fill: black)
|
||||
line((1, 3.5), (3, 3.5), mark: (end: ">"), fill: black)
|
||||
})
|
||||
|
||||
== Folgen, Reihen & Grenzwerte
|
||||
|
||||
// }}}
|
0
src/analysis_2.typ
Normal file
0
src/analysis_2.typ
Normal file
41
src/analysis_3.typ
Normal file
41
src/analysis_3.typ
Normal file
@ -0,0 +1,41 @@
|
||||
== Differentialgleichungen
|
||||
=== Abkürzungen
|
||||
#table(columns: (0.5fr, 1fr, 1fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Abk.], [Englisch], [Deutsch],
|
||||
[ODE], [Ordinary Differential Equation], [Gewöhnliche Differentialgleichung],
|
||||
[PDE], [Partial Differential Equation], [Partielle Differentialgleichung],
|
||||
[IC], [Initial Condition], [Anfangsbedingung],
|
||||
[BC], [Boundary Condition], [Randbedingung],
|
||||
[IVP], [Initial Value Problem], [Anfangswertproblem],
|
||||
[BVP], [Boundary Value Problem], [Randwertproblem],
|
||||
)
|
||||
=== Klassifizierung nach Kriterien
|
||||
// #table(columns: 3, stroke: (x: none), align: horizon, inset: 2pt,
|
||||
#table(columns: (0.7fr, 0.8fr, 1fr), stroke: (x: none), align: horizon,
|
||||
[Analytisch isolierbar], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$y' = f(x; y)$ ])], [
|
||||
- $y' = y$
|
||||
- $y' = x^2 dot y^3$
|
||||
- $y' = sin(x) dot cos^2(y) - tan(x dot y)$],
|
||||
[Elementar integrierbar], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$y' = g(x)$ ])], [
|
||||
- $y' = 2 dot x$
|
||||
- $y' = 1 + 3 dot x^2$
|
||||
- $y' = cos(x) + 1$
|
||||
],
|
||||
[Separierbar], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$y' = g(x) dot h(y)$ ])], [
|
||||
- $y' = x^2$
|
||||
- $y' = y^2$
|
||||
- $y' = x^2 dot y^3$
|
||||
],
|
||||
[Linear], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$y' = m(x) dot y + q(x)$ ])], [
|
||||
- $y' = 3 det y$
|
||||
- $y' = 3 dot x^2 dot y$
|
||||
- $y' = sin(x) dot y + e^x$
|
||||
],
|
||||
[Statische Lösung], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$y_s' eq.triple c eq.triple "konst."$])], [
|
||||
- $y' = 2 dot y + 8$
|
||||
- $y' = y^2 - 1 = (y + 1) dot (y - 1)$
|
||||
- $y' = g(x) dot h(y_s)$
|
||||
],
|
||||
)
|
||||
|
104
src/arbeiten_mit_pc.typ
Normal file
104
src/arbeiten_mit_pc.typ
Normal file
@ -0,0 +1,104 @@
|
||||
Die Fachhochschule setzt stark auf die Arbeit mit Computern, daher möchte ich kurz auf einen wichtigen Aspekt eingehen: das Betriebssystem.
|
||||
Ich gehe davon aus, dass die meisten von euch *Windows* von Microsoft nutzen. Meiner Meinung nach ist *Linux* jedoch die bessere Wahl für das Studium. In meinem Jahrgang konnte ich einige Mitstudenten dazu ermutigen, Linux auszuprobieren. Einer von ihnen bedankte sich sogar bei mir mit den Worten: "Das ist das Beste, was ich je gemacht habe. Danke, dass du mir Linux gezeigt hast!"
|
||||
Aus diesem Grund werde ich in diesem Kapitel auf Linux, Neovim (nvim) und weitere praktische Tools und Programme eingehen, die dir das Leben deutlich erleichtern können.
|
||||
|
||||
== Linux
|
||||
|
||||
== Effizientes Arbeiten mit Texteditoren
|
||||
An der Fachhochschule schreibst du viele Dokumente: von kleinen Projektarbeiten über C-Programme bis hin zu Python-Skripten für die Analysis. Meiner persönlichen Meinung nach solltest du dich in einem Programm wohlfühlen und es für all diese Aufgaben nutzen können. Es ist ineffizient, Python in Spyder, C in der Arduino-IDE oder später in der CubeIDE und Notizen in Obsidian zu schreiben. Jedes Tool hat eine andere Oberfläche, ein anderes Syntax-Highlighting und unterschiedliche Schaltflächen, wo du dich jedes Mal aufs Neue einarbeiten musst.
|
||||
|
||||
Um hier Konsistenz zu schaffen, empfehle ich dir, einen der folgenden Texteditoren zu verwenden:
|
||||
- Neovim (Nvim)
|
||||
- Kakoune
|
||||
- Helix
|
||||
- VS Code
|
||||
- (Notepad++)
|
||||
|
||||
Für Arduino und STM32 gibt es zudem Workarounds, um sie ohne dedizierte IDEs nutzen zu können.
|
||||
|
||||
Tipp: Ich empfehle dir dringend, die Vim-Bewegungen zu lernen. Am Anfang mag es schwer sein, aber sobald du es gemeistert hast, wirst du jeden, der seine Dokumente mit der Maus bearbeitet, für verrückt halten, weil es auf Dauer extrem mühsam ist.
|
||||
|
||||
=== Effizientes arbeiten mit Vim-Editoren
|
||||
Die Kernidee hinter Editoren wie *Vim* ist es, Text vollständig *ohne Maus* bearbeiten zu können. Mit etwas Übung wird das extrem effizient. Um das zu ermöglichen, nutzen diese Editoren (Vim, Neovim, und VS Code mit dem Vim-Plugin) verschiedene Modi. Helix und Kakoune funktionieren ähnlich, werden hier aber nicht im Detail behandelt.
|
||||
\
|
||||
Wenn du ein Dokument öffnest, befindest du dich im Normal-Modus. Dieser Modus ist darauf ausgelegt, schnell durch den Text zu navigieren:
|
||||
#table(columns: 2, stroke: none, inset: 0pt, column-gutter: 5pt,
|
||||
[Mit den Tasten *h, j, k, l* bewegst du den Cursor wie mit den Pfeiltasten nach links, unten, oben und rechts. Sobald du an der gewünschten Stelle bist, wechselst du mit *i* (oder *a*, um nach dem Cursor einzufügen) in den Insert-Modus. Hier kannst du ganz normal Text bearbeiten. Um zurück in den Normal-Modus zu gelangen, drücke einfach die *ESC-Taste*.],[
|
||||
#table(columns: 3,
|
||||
[], [k], [],
|
||||
[h], [], [l],
|
||||
[], [j], [])
|
||||
])
|
||||
|
||||
#pagebreak()
|
||||
=== Vim-Cheatsheet
|
||||
// #table(columns: (0.2fr, 1fr), align: (center, left), stroke: none,
|
||||
// #grid(columns: (0.4fr, 2fr), rows: auto, column-gutter: 1em, row-gutter: 0.5em,
|
||||
#grid(columns: (0.4fr, 2fr), rows: auto, column-gutter: 0em, row-gutter: 0.8em,
|
||||
fill: (_, y) =>
|
||||
if calc.odd(y) { luma(240) }
|
||||
else { white },
|
||||
|
||||
[Taste(n)], [Beschreibung],
|
||||
line(length: 100%),
|
||||
line(length: 100%),
|
||||
|
||||
// Navigation
|
||||
text(weight: "bold")[Navigation], [],
|
||||
[`h j k l`], [Cursor bewegen: links, unten, oben, rechts],
|
||||
[`gg`], [Zum Dateianfang springen],
|
||||
[`G`], [Zum Dateiende springen],
|
||||
[`{`], [Einen Absatz/Block nach oben springen],
|
||||
[`}`], [Einen Absatz/Block nach unten springen],
|
||||
[`b`], [Ein Wort zurückspringen (Anfang des vorherigen Worts)],
|
||||
[`e`], [Zum Ende des aktuellen Worts springen],
|
||||
[`w`], [Zum Anfang des nächsten Worts springen],
|
||||
[`0`], [Zum Zeilenanfang springen],
|
||||
[`_`], [Zum ersten Nicht-Leerzeichen der Zeile springen],
|
||||
[`$`], [Zum Zeilenende springen],
|
||||
|
||||
// Bearbeiten / Einfügen
|
||||
text(weight: "bold")[Bearbeiten / Einfügen], [],
|
||||
[`i`], [In den Insert-Modus wechseln (vor dem Cursor einfügen)],
|
||||
[`a`], [In den Insert-Modus wechseln (nach dem Cursor einfügen)],
|
||||
[`I`], [Zum Zeilenanfang springen und in den Insert-Modus wechseln],
|
||||
[`A`], [Zum Zeilenende springen und in den Insert-Modus wechseln],
|
||||
[`ESC`], [Vom Insert- oder Visual-Modus in den Normal-Modus wechseln],
|
||||
[`dd`], [Aktuelle Zeile löschen],
|
||||
[`yy`], [Aktuelle Zeile kopieren],
|
||||
[`r`], [Zeichen unter dem Cursor ersetzen],
|
||||
[`c`], [Auswahl ersetzen (z.B. `caw` um das Wort unter dem Cursor zu ersetzen)],
|
||||
|
||||
// Auswahl / Rückgängig
|
||||
text(weight: "bold")[Auswahl / Rückgängig], [],
|
||||
[`v`], [In den Visual-Modus wechseln (Text auswählen)],
|
||||
[`u`], [Rückgängig machen (Undo)],
|
||||
[`Ctrl + r`], [Wiederherstellen (Redo)],
|
||||
)
|
||||
\
|
||||
Wenn in einer Tasten-Kombination ein Bindestrich erscheint, ist damit ein #strong[Modifier] gemeint, wie beispielsweise "CTRL".
|
||||
Hier eine Übersicht über die gebräuchlichsten Notationen:
|
||||
#grid(columns: (0.4fr, 2fr), rows: auto, column-gutter: 0em, row-gutter: 0.8em,
|
||||
fill: (_, y) =>
|
||||
if calc.odd(y) { luma(240) }
|
||||
else { white },
|
||||
text(weight: "bold")[Notation],
|
||||
text(weight: "bold")[Beschreibung],
|
||||
line(length: 100%),
|
||||
line(length: 100%),
|
||||
[`C-x`], [`CTRL + x`],
|
||||
[`M-x`], [`ALT + x`],
|
||||
[`S-x`], [`SHIFT + x` (wird aber oft als "X" geschrieben)],
|
||||
[`D-x`], [`SUPER + x` (WINDOWS + x)],
|
||||
[`CR`], [`carriage return` (Enter)],
|
||||
[#raw("<Leader>")], [Modifier-Taste, welche in der Vim- oder Nvim-Konfiguration selbst definiert wurde. (oft die Leertaste, da mit beiden Händen erreichbar)],)
|
||||
|
||||
Für weitere Informationen über TastenKombinationen kann *`:help key-notation`* in Vim/Nvim aufgerufen werden.
|
||||
|
||||
Es ist verständlich, dass das Ganze auf den ersten Blick sehr abschreckend wirken kann. Aber der Einstieg gelingt, indem man mit den grundlegenden Befehlen wie `h`, `j`, `k`, `l`, `a`, `i` beginnt und dann Stück für Stück weitere, auch komplexere Tastenkombinationen wie `vib` lernt.
|
||||
|
||||
#image("../img/vim-learning-curve.png", width: 60%)
|
||||
|
||||
== Filemanager Yazi
|
||||
// }}}
|
||||
|
329
src/bachelorarbeit.typ
Normal file
329
src/bachelorarbeit.typ
Normal file
@ -0,0 +1,329 @@
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
|
||||
== Einführung
|
||||
Für das Schreiben einer grösseren Arbeit sind Programme wie Microsoft Word oder Google docs gänzlich ungeeignet. Wesentlich besser geeignet sind Code basierte Tool's wie LaTeX oder Typst.
|
||||
|
||||
Vergleich von Word, Latex und Typst:
|
||||
|
||||
#table(columns: 4,
|
||||
[Merkmal], [Microsoft Word], [LaTeX], [Typst],
|
||||
|
||||
[Typ], [WYSIWYG (What You See Is What You Get) Textverarbeitung], [Markup-Sprache / Textsatzsystem], [Markup-basierte Textverarbeitung (Syntax-orientiert, kompiliert)],
|
||||
[Bedienung], [Grafische Benutzeroberfläche (GUI), intuitiv], [Code-basiert, steile Lernkurve], [Code-basiert, flachere Lernkurve als LaTeX, moderner],
|
||||
[Fokus], [Allgemeine Dokumente, schnelle Erstellung], [Wissenschaftliche Arbeiten, technische Dokumente, Bücher, Formeln], [Wissenschaftliche Arbeiten, Berichte, Präsentationen, schneller],
|
||||
[Komplexität], [Einfach für Grundfunktionen, komplex für Fortgeschrittenes], [Hoch (Code, Pakete, Makros)], [Mittel (einfacher als LaTeX, aber immer noch Code-basiert)],
|
||||
[Ausgabe], [.docx (nativ), PDF, HTML etc.], [PDF (nativ), DVI, PostScript etc.], [PDF (nativ)],
|
||||
[Formatierung], [Manuell/visuell, Formatvorlagen], [Makros, Pakete, präzise typografische Kontrolle], [Funktionen, Makros, präzise Kontrolle, oft vordefinierte Stile],
|
||||
[Formeln], [Eingebauter Formeleditor (oft umständlich)], [Exzellent (TeX-Syntax), professionelle Darstellung], [Gut (ähnliche Syntax wie LaTeX, intuitive Ergänzungen)],
|
||||
[Zitationen], [Eingebaut (oft rudimentär), Plugins (z.B. Citavi, EndNote)], [BibTeX/BibLaTeX (sehr mächtig und flexibel)], [Eingebaut, flexibel (z.B. mit BibTeX-Dateien)],
|
||||
[Bilder/Tabellen], [Einfaches Einfügen, Drag & Drop], [Code-basiert, präzise Platzierung, Beschriftungen], [Code-basiert, einfacher als LaTeX, flexiblere Anordnung],
|
||||
[Anpassbarkeit], [Begrenzt (Themes, Vorlagen)], [Extrem hoch (Pakete, eigene Makros, Klassen)], [Hoch (eigene Funktionen, Stile definierbar)],
|
||||
)
|
||||
|
||||
#pagebreak()
|
||||
== LaTex, Typst
|
||||
Dokument aufsetzen und Grundbefehle
|
||||
#set par(justify: false) // Blocksatz
|
||||
#table(columns: 3,
|
||||
[], [Latex], [Typst],
|
||||
[Seitenformat],
|
||||
[```tex \documentclass[12pt, a4paper]{article} ``` ],
|
||||
[Typst hat Standartmässig ein A4 Vormat. \ ```typ #set text(paper: "a3") // (optional) ``` ],
|
||||
[Blocksatz],
|
||||
[ ```tex Standartmässig aktiv ``` ],
|
||||
[ ```typ #set par(justify: true) ``` ],
|
||||
[Zeilenabstand],
|
||||
[```tex \linespread{1.25} ```],
|
||||
[```typ #set par(leading: 0.65em) ```],
|
||||
[Sprache],
|
||||
[```tex \usepackage[ngerman]{babel} ```],
|
||||
[```typ #set text(lang: "de") ```],
|
||||
[Sielbentrennung],
|
||||
[```tex Standartmässig aktiv ```],
|
||||
[```typ #set text(hyphenate: true) ```],
|
||||
[Font],
|
||||
[```tex \fontfamily{Helvetica} ```],
|
||||
[```typ #set text(font: "New Computer Modern") ```],
|
||||
[Schriftgrösse],
|
||||
[ Die grundgrösse wird in `\documentclass` festgelegt.
|
||||
danach kann mit:
|
||||
#table(columns: 4,
|
||||
[Befehl], [10pt], [11pt], [12pt],
|
||||
[```tex \tiny```], [5pt], [6pt], [6pt],
|
||||
[```tex \scriptsize```], [7pt], [8pt], [8pt],
|
||||
[```tex \footnotesize```], [8pt], [9pt], [10pt],
|
||||
[```tex \small```], [9pt], [10pt], [11pt],
|
||||
[```tex \normalsize```], [10pt], [11pt], [12pt],
|
||||
[```tex \large```], [12pt], [12pt], [14pt],
|
||||
[```tex \Large```], [14pt], [14pt], [17pt],
|
||||
[```tex \LARGE```], [17pt], [17pt], [20pt],
|
||||
[```tex \huge```], [20pt], [20pt], [25pt],
|
||||
[```tex \Huge```], [25pt], [25pt], [25pt],
|
||||
)
|
||||
die Grösse verändert werden.
|
||||
],
|
||||
[```typ #set text(size: 10pt) ```],
|
||||
[Fett],
|
||||
[```tex \textbf{bal bla bla} ```],
|
||||
[```typ *bla bla bla* ```],
|
||||
[Kusiev],
|
||||
[```tex \emph{bal bla bla} ```],
|
||||
[```typ _bla bla bla_ ```],
|
||||
[Monospace],
|
||||
[```tex \texttt{bal bla bla} ```],
|
||||
[```typ `bla bla bla` ```],
|
||||
[Link],
|
||||
[```tex \url{https://typst.app} ```],
|
||||
[```typ https://typst.app ```],
|
||||
[Label],
|
||||
[```tex \label{intro} ```],
|
||||
[```typ <bla bla bla> ```],
|
||||
[Reference],
|
||||
[```tex \ref{bla bal bla} ```],
|
||||
[```typ @NurEinWortSo @[bla bla bla] ```],
|
||||
[Liste],
|
||||
[```tex
|
||||
\begin{itemize}
|
||||
\item bla
|
||||
\item bla bla
|
||||
\item la la la
|
||||
\end{itemize}
|
||||
```],
|
||||
[```typ
|
||||
- bla
|
||||
- bla bla bla
|
||||
- la la la
|
||||
``` ],
|
||||
[Nummerierte Liste],
|
||||
[```tex
|
||||
\begin{enumerate}
|
||||
\item erstes
|
||||
\item zweites
|
||||
\end{enumerate}
|
||||
```],
|
||||
[```typ
|
||||
+ bla
|
||||
+ bla bla bla
|
||||
```],
|
||||
[Kapietel],
|
||||
[```tex
|
||||
\section{Superlicht}
|
||||
\subsection{unterlicht}
|
||||
\subsubsection{unter dem unterlicht}
|
||||
```],
|
||||
[```typ
|
||||
= Superlicht
|
||||
== unterlicht
|
||||
=== unter dem unterlicht
|
||||
```],
|
||||
)
|
||||
|
||||
\* optional (muss meistens nicht abgegeben werden)
|
||||
|
||||
Bei Typst können auch mehere Parameter auf einmal gesetzt werden:
|
||||
```typ
|
||||
#set text(
|
||||
font: "New Computer Modern",
|
||||
size: 10pt
|
||||
)
|
||||
```
|
||||
|
||||
#text(fill: blue)[`#set ...`] wirkt sich auf den folgenden test aus. Soll nur etwas gemcht werden dann kann auch z.B. `#text(size: 16pt)[text]` mit klammern verwendet werden.
|
||||
#text(size: 16pt)[Das könnte mal noch nützlich sein.]
|
||||
|
||||
=== Inhaltsverzeichnis
|
||||
*Typst*
|
||||
```typ
|
||||
#set heading(numbering: "1.")
|
||||
// 1
|
||||
// 1.1
|
||||
#set heading(numbering: "1.a")
|
||||
// 1
|
||||
// 1.a
|
||||
|
||||
// eigentliches Inhaltsverzeichnis
|
||||
#outline()
|
||||
```
|
||||
*LaTeX*
|
||||
```tex
|
||||
\tableofcontents
|
||||
```
|
||||
|
||||
=== Referenz beispiel
|
||||
```typ
|
||||
Glaciers as the one shown in
|
||||
@glaciers will cease to exist if
|
||||
we don't take action soon!
|
||||
|
||||
#figure(
|
||||
image("glacier.jpg", width: 70%),
|
||||
caption: [
|
||||
_Glaciers_ form an important part
|
||||
of the earth's climate system.
|
||||
],
|
||||
) <glaciers>
|
||||
```
|
||||
|
||||
== PDF Generieren
|
||||
Falls in einer gui umgebung gearbeitet wird gibt es dafür schaltflächen, aber weil wir alle mit vim resp. nvim im Terminal unterwegs sind hier die befehle:
|
||||
#table(columns: 2,
|
||||
[Latex],
|
||||
[ Da es verschieden Compiler gibt:
|
||||
#table(columns: 2,
|
||||
[Latex], [```sh pdflatex mydocument.tex```],
|
||||
[XeTeX], [```sh xelatex mydocument.tex```],
|
||||
[LuaTeX], [```sh luatex mydocument.tex```]
|
||||
)],
|
||||
[Typst], [```sh typst compile mydocument.typ```]
|
||||
)
|
||||
|
||||
|
||||
#set par(justify: true) // Blocksatz
|
||||
#pagebreak()
|
||||
== Symbole
|
||||
#table(columns: (1fr, 1fr),
|
||||
[$plus.minus$], [```typ $plus.minus$ ```],
|
||||
[$eq$], [```typ $eq$ ```],
|
||||
[$eq.triple$], [```typ $eq.triple$ ```],
|
||||
[$approx$], [```typ $approx$ ```],
|
||||
[$in$], [```typ $in$ ```],
|
||||
[$in.not$], [```typ $in.not$ ```],
|
||||
[$emptyset$], [```typ $emptyset$ ```],
|
||||
[$diameter$], [```typ $diameter$ ```],
|
||||
[$subset$], [```typ $subset$ ```],
|
||||
[$subset.eq$], [```typ $subset.eq$ ```],
|
||||
[$subset.not$], [```typ $subset.not$ ```],
|
||||
[$subset.not.eq$], [```typ $subset.not.eq$ ```],
|
||||
[$union$], [```typ $union$ ```],
|
||||
[$inter$], [```typ $inter$ ```],
|
||||
[$Delta$], [```typ $Delta$ ```],
|
||||
[$mu$], [```typ $mu$ ```],
|
||||
[$sigma$], [```typ $sigma$ ```],
|
||||
[$sigma$], [```typ $sigma$ ```],
|
||||
[$accent(x, macron)$], [```typ $accent(x, macron)$ ```],
|
||||
[$root(, 4)$], [```typ $root(, 4)$ ```],
|
||||
[$root(3, 4)$], [```typ $root(3, 4)$ ```],
|
||||
[$frac(1, 2)$], [```typ $frac(1, 2)$ ```],
|
||||
[$sum_i^N$], [```typ $sum_i^N$ ```],
|
||||
)
|
||||
== cetz
|
||||
importieren:
|
||||
```typ
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
```
|
||||
|
||||
#table(columns: (1fr, 0.7fr),
|
||||
[```typ
|
||||
rect((0, 0), (1, 1))
|
||||
rect((2, 0), (3, 1), fill: blue)
|
||||
rect((4, 0), (6, 1), fill: rgb(0, 0, 255, 60))
|
||||
```], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (1, 1))
|
||||
rect((2, 0), (3, 1), fill: blue)
|
||||
rect((4, 0), (6, 1), fill: rgb(0, 0, 255, 60))
|
||||
})], [```typ
|
||||
grid((0, 0), (3, 1), step: 1)
|
||||
grid((0, -1), (6, -5), step: 2)
|
||||
```], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
grid((0, 0), (3, 1), step: 1)
|
||||
grid((0, -1), (6, -5), step: 2)
|
||||
})], [```typ
|
||||
circle((0, 0))
|
||||
circle((2, 0), radius: 0.5)
|
||||
circle((4, 0), radius: (1, 0.5))
|
||||
```], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
circle((0, 0))
|
||||
circle((2, 0), radius: 0.5)
|
||||
circle((4, 0), radius: (1, 0.5))
|
||||
})], [```typ
|
||||
line((0, 0), (6, 0))
|
||||
line((0, -1), (6, -1), stroke: (dash: "dashed"))
|
||||
line((0, -2), (6, -2), mark: (symbol: ">"), fill: blue, stroke: blue)
|
||||
line((0, -3), (6, -3), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
```], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
line((0, 0), (6, 0))
|
||||
line((0, -1), (6, -1), stroke: (dash: "dashed"))
|
||||
line((0, -2), (6, -2), mark: (symbol: ">"), fill: blue, stroke: blue)
|
||||
line((0, -3), (6, -3), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
})], [```typ
|
||||
content((0, 0), [1])
|
||||
content((0, -1), [Median = 4])
|
||||
```], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
content((0, 0), [1])
|
||||
content((0, -1), [Median = 4])
|
||||
})], [```typ
|
||||
|
||||
```],[]
|
||||
)
|
||||
|
||||
beispiel code
|
||||
```typ
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
scale(0.5)
|
||||
rect((0, 0), (5, 1), fill: blue)
|
||||
rect((0, 0), (5, 1), fill: rgb(0, 0, 255, 60))
|
||||
grid((0, 0), (5, 1), step: 1)
|
||||
circle((3, 5))
|
||||
circle((3, 5), radius: (1, 0.5))
|
||||
line((0, 0), (3, 2))
|
||||
line((6, 0), (6, 2), stroke: (dash: "dashed"))
|
||||
line((3, 0), (6, 0), mark: (symbol: ">"), fill: blue, stroke: blue)
|
||||
line((2.5, 0), (2.5, -0.8), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
content((0.5, 0.5), [1])
|
||||
content((2.5, -1), [Median = 4])
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
#pagebreak()
|
||||
== randome typst stuff
|
||||
|
||||
// #show table.cell.where(y: 0): set text(weight: "bold")
|
||||
|
||||
#figure(
|
||||
table(
|
||||
columns: 4,
|
||||
stroke: none,
|
||||
|
||||
table.header[Test Item][Specification][Test Result][Compliance],
|
||||
[Voltage], [220V ± 5%], [218V], [Pass],
|
||||
[Current], [5A ± 0.5A], [4.2A], [Fail],
|
||||
),
|
||||
caption: [Probe results for design A],
|
||||
) <probe-a>
|
||||
|
||||
The results from @probe-a show that the design is not yet optimal.
|
||||
We will show how its performance can be improved in this section.
|
||||
|
||||
|
||||
#line()
|
||||
|
||||
#table(
|
||||
columns: 2,
|
||||
stroke: (x: none),
|
||||
align: horizon,
|
||||
[☒], [Close cabin door],
|
||||
[☐], [Start engines],
|
||||
[☐], [Radio tower],
|
||||
[☐], [Push back],
|
||||
)
|
||||
|
||||
// fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
|
||||
// https://typst.app/docs/guides/table-guide/#table-across-pages
|
||||
// #set block(breakable: true)
|
||||
// #show figure: set block(breakable: true)
|
||||
|
1
src/elektronik_1.typ
Normal file
1
src/elektronik_1.typ
Normal file
@ -0,0 +1 @@
|
||||
== Elektronik 1
|
1
src/elektronik_2.typ
Normal file
1
src/elektronik_2.typ
Normal file
@ -0,0 +1 @@
|
||||
== Elektronik 2
|
28
src/elektronik_3.typ
Normal file
28
src/elektronik_3.typ
Normal file
@ -0,0 +1,28 @@
|
||||
== Elektronik 3
|
||||
=== Speisungen
|
||||
Speisungen (linear, boost, buck, inverter, charge pump)
|
||||
|
||||
78xx
|
||||
|
||||
|
||||
|
||||
=== Reale Bauelemente (Transistor und OP)
|
||||
=== Operationsverstärker und Transimpedanzverstärker
|
||||
|
||||
Eingangsspannungs offset nullen
|
||||
|
||||
=== Verstärkerschaltungen für Detektoren
|
||||
=== Schaltungen für Gepulste Sender, Laser und Gleichlichtunterdrückung von Detektoren
|
||||
=== Brückenschaltungen und ihre Steuerung
|
||||
=== Wirkungsgrad und Verluste
|
||||
=== Rauschen
|
||||
=== Signalintegrität (Massnahmen)
|
||||
=== Netzwerkgrundlagen
|
||||
==== Topologien
|
||||
==== Schichtenmodell
|
||||
==== TCP/IP
|
||||
==== Sockets
|
||||
==== HTTP/HTML, JS/Web-Programmierung
|
||||
==== MQTT
|
||||
==== Sicherheit
|
||||
|
274
src/informatik_1.typ
Normal file
274
src/informatik_1.typ
Normal file
@ -0,0 +1,274 @@
|
||||
== C
|
||||
=== Hello World
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("Hello World\n");
|
||||
return 0;
|
||||
}
|
||||
```]
|
||||
|
||||
=== Compilieren
|
||||
Im Terminal:
|
||||
#table(columns: 2,
|
||||
[```sh
|
||||
gcc {name des .c files}
|
||||
```],
|
||||
[Dies erzeugt eine #text(fill: blue)[`a.out`] Datei welche ausführbar ist.],
|
||||
[```sh
|
||||
gcc -o superprogramm.out {name des .c files}
|
||||
```],
|
||||
[Der Programm name kann als Parameter `-o` mitgegeben werden.],
|
||||
[```sh
|
||||
tcc -run {name des .c files}
|
||||
```],
|
||||
[Kann für einfache programme sinnvoll sein da diese so nicht kompieliert werden müssen.]
|
||||
)
|
||||
Geheimtipp für die nvim conf:
|
||||
```vim
|
||||
vim.api.nvim_buf_set_keymap(0, "n", '<F10>', "<ESC> :w <bar> :term tcc -run %<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_buf_set_keymap(0, "i", '<F10>', "<ESC> :w <bar> :term tcc -run %<CR>i", { noremap = true, silent = true })
|
||||
```
|
||||
|
||||
=== Datentypen
|
||||
#table(columns: (auto, 0.5fr, 1fr, 0.5fr),
|
||||
[Datentyp], [Grösse in Bits \ (typisch)], [Wertebereich (typisch)], [printf-Format-Specifier],
|
||||
[char], [8], [-128 bis 127], [#text(fill: blue)[`%c`] (für Zeichen), #text(fill: blue)[`%hhd`] (für Integer-Wert)],
|
||||
[unsigned char], [8], [0 bis 255], [#text(fill: blue)[`%hhu`]],
|
||||
[bool], [8 (oft als char implementiert)], [0 (false) oder 1 (true) (oder beliebiger Nicht-Null-Wert für true)], [#text(fill: blue)[`%d`] (als Integer)],
|
||||
[short (int)], [16], [-32.768 bis 32.767], [#text(fill: blue)[`%hd`]],
|
||||
[unsigned short (int)], [16], [0 bis 65.535], [#text(fill: blue)[`%hu`]],
|
||||
[(long) int], [32], [-2.147.483.648 bis 2.147.483.647], [#text(fill: blue)[`%d`], #text(fill: blue)[`%i`]],
|
||||
[unsigned (long) int], [32], [0 bis 4.294.967.295], [#text(fill: blue)[`%u`]],
|
||||
[long long int], [64], [-9.223.372.036.854.775.808 bis 9.223.372.036.854.775.807], [#text(fill: blue)[`%lld`]],
|
||||
[unsigned long long int], [64], [0 bis 18.446.744.073.709.551.615], [#text(fill: blue)[`%llu`]],
|
||||
[float], [32], [ca. $1,175494351 dot 10^38$ bis $3.402823466 dot 10^38$ (7 Dezimalstellen Genauigkeit)], [#text(fill: blue)[`%f`], #text(fill: blue)[`%e`], #text(fill: blue)[`%g`]],
|
||||
[double], [64], [ca. $2,2250738585072014 dot 10^308$ bis $1.7976931348623158 dot 10^308$ (15-17 Dezimalstellen Genauigkeit)], [#text(fill: blue)[`%lf`], #text(fill: blue)[`%le`], #text(fill: blue)[`%lg`]],
|
||||
[long double], [80 oder 128 (compilerabhängig)], [Sehr grosser Bereich, höhere Genauigkeit als double], [#text(fill: blue)[`%Lf`], #text(fill: blue)[`%Le`], #text(fill: blue)[`%Lg`]],
|
||||
)
|
||||
|
||||
=== Operatoren
|
||||
#table(columns: (0.5fr, 1fr),
|
||||
[Operator/Ausdruck], [Beschreibung],
|
||||
[#text(fill: purple,)[a + b]], [#text(fill: purple,)[a] plus #text(fill: purple,)[b]],
|
||||
[#text(fill: purple,)[a - b]], [#text(fill: purple,)[a] minus #text(fill: purple,)[b]],
|
||||
[#text(fill: purple,)[a \* b]], [#text(fill: purple,)[a] mal #text(fill: purple,)[b]],
|
||||
[#text(fill: purple,)[a / b]], [#text(fill: purple,)[a] geteilt durch #text(fill: purple,)[b]],
|
||||
[#text(fill: purple,)[a % b]], [#text(fill: purple,)[a] modulo #text(fill: purple,)[b] (Anwendung nur auf positive Integer-Ausdrücke)],
|
||||
)
|
||||
|
||||
=== Vergleichsoperatoren
|
||||
#table(columns: (0.5fr, 1fr),
|
||||
[Operator/Ausdruck], [Beschreibung],
|
||||
[#text(fill: purple,)[a == b]], [Ist #text(fill: purple,)[a] gleich #text(fill: purple,)[b]?],
|
||||
[#text(fill: purple,)[a != b]], [Ist #text(fill: purple,)[a] ungleich #text(fill: purple,)[b]?],
|
||||
[#text(fill: purple,)[a < b]], [Ist #text(fill: purple,)[a] kleiner #text(fill: purple,)[b]?],
|
||||
[#text(fill: purple,)[a > b]], [Ist #text(fill: purple,)[a] grösser #text(fill: purple,)[b]?],
|
||||
[#text(fill: purple,)[a <= b]], [Ist #text(fill: purple,)[a] kleiner oder gleich #text(fill: purple,)[b]?],
|
||||
[#text(fill: purple,)[a >= b]], [Ist #text(fill: purple,)[a] grösser oder gleich #text(fill: purple,)[b]?],
|
||||
)
|
||||
|
||||
=== Logische Operatoren
|
||||
#table(columns: (0.3fr, 1fr),
|
||||
[Operator/Ausdruck], [Beschreibung],
|
||||
[#text(fill: purple,)[a && b]],
|
||||
[logisches "und"; \ "1", wenn #text(fill: purple,)[a] ungleich "0" (also "true") und #text(fill: purple,)[b] ungleich "0" (also "true"); "0" sonst; #text(fill: purple,)[b] wird nur ausgewertet, falls #text(fill: purple,)[a] ungleich "0" (also "true") ist],
|
||||
[#text(fill: purple,)[a || b]],
|
||||
[logisches "oder"; \ "1", wenn #text(fill: purple,)[a] ungleich "0" (also "true") oder #text(fill: purple,)[b] ungleich "0" (also "true"); "0" sonst; #text(fill: purple,)[b] wird nur ausgewertet, falls #text(fill: purple,)[a] gleich "0" (also "false") ist],
|
||||
[#text(fill: purple,)[!a]],
|
||||
[logische "Negation"; \ "1", wenn #text(fill: purple,)[a] gleich "0" (also "false"); "0" sonst],
|
||||
)
|
||||
|
||||
=== Array
|
||||
Array definieren
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
// Array fix
|
||||
int array1[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
int array2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
|
||||
// Array als pointer
|
||||
int *array3 = (int [10]){0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
int *array4 = (int []){0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
``` ]
|
||||
Array beschreiben oder lese:
|
||||
#table(columns: (1fr, 1fr),
|
||||
[Array initialisieren], [```c int foo[3]; ```],
|
||||
[Array definieren und mit "0" ininitalisieren], [ ```c int meinArray[5] = {0}; ```],
|
||||
[Daten schreiben], [```c foo[0] = 30; ```],
|
||||
[Daten lesen], [```c x = foo[0]; ```]
|
||||
)
|
||||
|
||||
=== if Abfrage
|
||||
#table(columns: (0.3fr, 1fr),
|
||||
[Einfache if abfrage:],
|
||||
[```c
|
||||
if (z){
|
||||
printf("Die Variable z ist true.");
|
||||
}
|
||||
```],
|
||||
[Abfrage mit else:],
|
||||
[```c
|
||||
if (x > 3){
|
||||
printf("x ist grösser als 3.");
|
||||
} else {
|
||||
printf("x ist gleich 3 oder kleiner.");
|
||||
}
|
||||
```]
|
||||
)
|
||||
|
||||
=== Schleifen
|
||||
Eine For-Schleife wird verwendet, wenn die Länge oder die Anzahl der Wiederholungen bekannt ist. Im folgenden Beispiel wird so lange eine zufällige Zahl vergeben, bis der Wert grösser als 100 ist. Da jedoch nicht bekannt ist, wie viele Versuche dafür notwendig sind, kommt eine While-Schleife zum Einsatz.
|
||||
|
||||
==== while
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
while(x > 100){
|
||||
x = randome();
|
||||
}
|
||||
```]
|
||||
|
||||
==== for
|
||||
#table(columns: (1fr, 1fr),
|
||||
[ ```c
|
||||
for(int i = 0; i < 5; i++){
|
||||
printf("i = %i\n", i);
|
||||
}
|
||||
``` ],
|
||||
[ ```
|
||||
i = 0
|
||||
i = 1
|
||||
i = 2
|
||||
i = 3
|
||||
i = 4
|
||||
```]
|
||||
)
|
||||
|
||||
|
||||
=== switch case
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
switch (<var>) {
|
||||
case 0: {printf("\033[1;31m*\033[0m"); break;}
|
||||
case 1: {printf("\033[1;32m*\033[0m"); break;}
|
||||
...
|
||||
case n: {printf("\033[1;34m*\033[0m"); break;}
|
||||
default:
|
||||
printf("*");
|
||||
}
|
||||
```
|
||||
]
|
||||
|
||||
=== vom Terminal lesen
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
scanf("%s", &var);
|
||||
scanf("%99[^\n]s", &string[0]);
|
||||
```
|
||||
]
|
||||
|
||||
=== WHITESPACE
|
||||
macht 10 WHITESPACE vor dem text → rechtsbündig
|
||||
#table(columns: (1fr, 1fr), [
|
||||
```c
|
||||
printf("%10s\n", "xxx");
|
||||
// Eingabe mit strings
|
||||
printf("%10sxxx", "");
|
||||
``` ], [
|
||||
```
|
||||
1234567890
|
||||
xxx
|
||||
xxx
|
||||
```
|
||||
])
|
||||
|
||||
=== Programmkopf
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
/* inline printing
|
||||
Programm das einen String mit variablen ausgibt.
|
||||
Autor: Thomas Zwicker
|
||||
Version: 0.1
|
||||
Datum: 02.10.2024
|
||||
Änderungen:
|
||||
0.1 02.10.2024 Erste Version
|
||||
*/
|
||||
|
||||
// Einbinden von Headerdateien der Programmbibliothek.
|
||||
#include <stdio.h>
|
||||
|
||||
//programm start
|
||||
int main(){
|
||||
printf("%i plus %i ist gleich %s.\n", 3, 2, "Fünf");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
]
|
||||
|
||||
=== enum
|
||||
|
||||
=== struct
|
||||
|
||||
=== speicher
|
||||
|
||||
=== Pointer
|
||||
call-by-reference
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
void tausche(int *var1, int *var2){
|
||||
int temp;
|
||||
temp = *var1;
|
||||
*var1 = *var2;
|
||||
*var2 = temp;
|
||||
return;
|
||||
}
|
||||
|
||||
int main(){
|
||||
int var1 = 5;
|
||||
int var2 = 2;
|
||||
tausche(&var1, &var2);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
]
|
||||
Mit dem `*` und dem `&` werden die variabeln direkt im speicher geändert und müssen deshalb nicht zurückgegeben werden.
|
||||
|
||||
=== Liberys
|
||||
==== sleep
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
#include <unistd.h>
|
||||
sleep(<zeit in s>);
|
||||
usleep(<zeit in us>);
|
||||
int t = time(0) // gibt die aktuelle zeit in s
|
||||
```
|
||||
]
|
||||
==== random
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
srand(time(0)); //init randomee seed
|
||||
int n = rand() % 10; // n = 0 - 9
|
||||
```
|
||||
]
|
||||
==== strings
|
||||
#table(columns: 1fr)[
|
||||
```c
|
||||
#include <string.h>
|
||||
char Ziel[20];
|
||||
char Temp[20];
|
||||
strcpy( Ziel, "Hallo " ); // Ziel enthält den String "Hallo "
|
||||
strcat( Ziel, "Welt" ); // Ziel enthält jetzt den String "Hallo Welt"
|
||||
strcpy( Temp, "!" );
|
||||
strcat( Ziel, Temp ); // Ziel enthält jetzt den String "Hallo Welt!«
|
||||
printf("\nDer string hat %li Zeichen.\n", strlen(Ziel));
|
||||
if (strcmp(Ziel,"Hallo ") == 0)
|
||||
{
|
||||
// tut etwas wenn die strings gleich sind.
|
||||
}
|
||||
```
|
||||
]
|
||||
|
4
src/informatik_2.typ
Normal file
4
src/informatik_2.typ
Normal file
@ -0,0 +1,4 @@
|
||||
== Arduino
|
||||
|
||||
== STM 32
|
||||
|
224
src/informatik_3.typ
Normal file
224
src/informatik_3.typ
Normal file
@ -0,0 +1,224 @@
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
|
||||
== CPP
|
||||
=== Hello World cpp
|
||||
#table(columns: 1fr)[```cpp
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World";
|
||||
return 0;
|
||||
}
|
||||
```]
|
||||
|
||||
=== compile cpp
|
||||
```sh
|
||||
g++ hello.cpp # gibt: a.out
|
||||
g++ hello.cpp -o hallo # Programm heisst hallo
|
||||
```
|
||||
=== print to console
|
||||
#table(columns: 1fr,
|
||||
[```c
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
int i = 23;
|
||||
double d = 42.7;
|
||||
printf("i is %i and d is %f\n", i, d);
|
||||
return 0;
|
||||
}
|
||||
```], [```cpp
|
||||
#include <iostream>
|
||||
int main() {
|
||||
int i = 23;
|
||||
double d = 42.7;
|
||||
std::cout << "i is " << i << " and d is " << d <<"\n";
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
])
|
||||
|
||||
=== class
|
||||
Einfache Klasse:
|
||||
#table(columns: 1fr)[
|
||||
```cpp
|
||||
class Vec3 {
|
||||
public:
|
||||
...
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
};
|
||||
Vec3 v;
|
||||
v.x = 1.0;
|
||||
}
|
||||
```]
|
||||
*Private-Variablen*: Auf Private-Variablen kann von ausenerhalb der Klasse nicht zugegiffen werden!
|
||||
#table(columns: 1fr)[
|
||||
```cpp
|
||||
class Vec3 {
|
||||
public:
|
||||
...
|
||||
double x;
|
||||
private:
|
||||
double y;
|
||||
double z;
|
||||
};
|
||||
Vec3 v;
|
||||
v.x = 1.0; // okay, is public
|
||||
v.y = 2.0; // compiler error!
|
||||
```]
|
||||
*Klassen Initialisieren*: Die Funktion "Foo()" wird beim aufrufen von "Foo f;" aufgerufen. Dort wird die Variabel "i" mit 123 initialisiert. Beim aufrufen von "f.bar(456)" wird 456 ausgegeben! Möchte man 123 ausgeben das das "int i" bei der Funktion weglassen damit das i der Klasse verwendet wird.
|
||||
#table(columns: 1fr)[```cpp
|
||||
#include <iostream>
|
||||
class Foo {
|
||||
public:
|
||||
int i;
|
||||
Foo() {
|
||||
i = 123;
|
||||
}
|
||||
void bar(int i) {
|
||||
printf("%i\n", i); // output is "456"
|
||||
}
|
||||
};
|
||||
int main() {
|
||||
Foo f;
|
||||
f.bar(456);
|
||||
}
|
||||
```]
|
||||
|
||||
*Args:* In cpp kann eine Funktion mehrmahls aufgerufen werden. Der compiler schaut selbst wie viele argumente mitgegeben werden und linkt dies ensprechend. (Angebliech soll das auch führ normale funktionen gehen 🤔)
|
||||
#table(columns: 1fr)[```cpp
|
||||
class Foo {
|
||||
Foo(){}
|
||||
Foo(int a, int b){
|
||||
...
|
||||
}
|
||||
Foo(int a, int b, float c){
|
||||
...
|
||||
}
|
||||
};
|
||||
```]
|
||||
Alternativ kann auch direkt in der Funktion default Values definiert werden welche ähnlich wie in Python funktionieren.
|
||||
#table(columns: 1fr)[```cpp
|
||||
class Foo {
|
||||
Foo(int a = 2, int b = 8){
|
||||
...
|
||||
}
|
||||
};
|
||||
```]
|
||||
|
||||
==== constructor
|
||||
|
||||
==== decounstructor
|
||||
|
||||
=== overloading
|
||||
|
||||
=== std -> Namespace
|
||||
|
||||
=== std::string
|
||||
Für Strings: ```cpp #include <string> ```
|
||||
#table(columns: (1fr, 1fr),
|
||||
[String einer Variable Zuweisen], [```cpp std::string str = "Hello"; ```],
|
||||
[Auf ein Element zugreifen \ (Nicht empfohlen da zugriff auch ausserhalb des str möglich)!], [```cpp str[0]; ```],
|
||||
[Auf ein Element zugreifen \ empfohlen option], [```cpp str.at(0); ```],
|
||||
[Anzahl Zeichen im str], [```cpp str.length(); ```],
|
||||
[Grösse von vom String], [```cpp str.size(); ```],
|
||||
[Erstes Zeichen ausgeben], [```cpp str.font(); ```],
|
||||
[Letztes Zeichen ausgeben], [```cpp str.back(); ```],
|
||||
[Vom start eine bestimmte länge ausgeben], [```cpp str.substr(start, anzahl_zeichen); ```],
|
||||
[Strings zusammensetzen], [```cpp
|
||||
str = "Hello";
|
||||
str += "world";
|
||||
str = str + "!";
|
||||
```],
|
||||
[Bereich löschen], [```cpp str.erase(start, anzahl_zeichen) ```],
|
||||
[Text einfügen], [```cpp str.inset(start, "Hello") ```],
|
||||
[find], [```cpp size_t pos = str.find("de"); ``` \ ```cpp if (pos == std::string::npos){} ```],
|
||||
[Strings vergleichen], [```cpp (str1 == str2) ```],
|
||||
)
|
||||
=== container
|
||||
container sind arrays welche daten enthalten und nicht selbst mit array handeling (malloc, speicher freigeben) zu tun haben.
|
||||
==== std::vector
|
||||
Beim vector wird im hintergrund ein Speicherbereich reserviert. Falls der user etwas ergenzen möchte wird noch etwas mehr reserviert als benötigt wird. Sollte viel mehr ergäntz werden, so muss ein neuer Speicherbereich reserviert werden die daten rüber kopiert werden und der alte Speicherbereich wieder freigeben werden.
|
||||
#table(columns: (1fr, 1fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Vorteile], [Nachteile],
|
||||
[Schnelle zugriffszeit], [Wird der vector um viele elemente erweitert so muss der speicher neu zugewiessen werden.],
|
||||
[Geringerer Speicher-Overhead pro Element.], [Langsame Einfüge- und Löschvorgänge in der Mitte]
|
||||
)
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (8, 1), fill: rgb(0, 0, 255, 60))
|
||||
grid((0, 0), (8, 1), step: 1)
|
||||
content((0.5, 0.5), [1])
|
||||
content((1.5, 0.5), [2])
|
||||
content((2.5, 0.5), [3])
|
||||
content((3.5, 0.5), [4])
|
||||
content((4.5, 0.5), [5])
|
||||
})
|
||||
Zum verwenden eines Vectors: ```cpp #include <vector> ``` \
|
||||
Vektoren können verschieden Datentypen haben.
|
||||
#table(columns: (0.6fr, 1fr),
|
||||
[Vektor initialisieren], [```cpp std::vector<bool> states; ``` \ ```cpp std::vector<int> numbers{1, 2, 3}; ``` \ ```cpp std::vector<std::string> strings; ``` \ ```cpp std::vector<eigene_class> players; ```],
|
||||
[Auf ein Element zugreifen], [```cpp v[0]; ```],
|
||||
[Grösse von vom vector], [```cpp v.size(); ```],
|
||||
[Erstes Zeichen ausgeben], [```cpp v.font(); ```],
|
||||
[Letztes Zeichen ausgeben], [```cpp v.back(); ```],
|
||||
[Element am Ende anhängen], [```cpp v.push_back(number); ```],
|
||||
[Element am Anfang einfügen], [```cpp v.inset(v.begin(), number); ```],
|
||||
[Element en stelle X einfügen], [```cpp v.inset(pos, number); ```],
|
||||
[Zwei Vektoren Zusammenhang], [```cpp v1.inset(v1.end(), v2.begin(), v2.end()); ```],
|
||||
[Element löschen], [```cpp v.erase(pos); ```],
|
||||
[Bereich löschen], [```cpp v.erase(start, stop); ```],
|
||||
[Bereich extrahieren \ v1 ist der ursprüngliche vektor. v2 ist der auschnit von v1. im Beispiel rechts ist: \ v2 = {2, 3, 4}], [```cpp
|
||||
std::vector<int> v1{ 1, 2, 3, 4, 5 };
|
||||
std::vector<int>::iterator first = v1.begin() + 1;
|
||||
std::vector<int>::iterator last = v1.begin() + 4;
|
||||
std::vector<int> v2(first, last);
|
||||
```],
|
||||
[Conteiner ineinander packen \ (Nesting) \ können normal wie 2D array's behandelt werden: v[i][j]], [```cpp
|
||||
std::vector<std::vector<int>> v{{ 0, 1 },
|
||||
{ -1, 0, 2 }}; ```],
|
||||
)
|
||||
==== std::list
|
||||
Listen sind verkettete Daten. Listen sollten verwendet werden wenn häufig elemente in der mitte hinzugefügt oder enternt werden.
|
||||
#table(columns: (1fr, 1fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Vorteile], [Nachteile],
|
||||
[Schnelles Einfügen und Löschen an jeder Position], [Kein schneller Direktzugriff],
|
||||
[], [Hoher Speicher-Overhead durch die Zeiger],
|
||||
[], [Schlechte Cache-Performance aufgrund des nicht-kontinuierlichen Speichers.]
|
||||
)
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
content((-2, 1.5), [node\*])
|
||||
line((-1.5, 1.5), (0, 1.5), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
for i in range(0, 4){
|
||||
rect((i * 3, 0), (i * 3 + 1, 2), fill: rgb(0, 0, 255, 60))
|
||||
line((i * 3, 1), (i * 3 + 1, 1))
|
||||
}
|
||||
for i in range(0, 3){
|
||||
line((i * 3 + 1, 0.5), (i * 3 + 3, 1.5), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
}
|
||||
content((0.5, 1.5), [1])
|
||||
content((0.5, 0.5), [0x80])
|
||||
content((3.5, 1.5), [3])
|
||||
content((3.5, 0.5), [0x84])
|
||||
content((6.5, 1.5), [5])
|
||||
content((6.5, 0.5), [0x66])
|
||||
content((9.5, 1.5), [13])
|
||||
content((9.5, 0.5), [0x49])
|
||||
})
|
||||
|
||||
==== std::array
|
||||
==== std::map
|
||||
|
||||
=== testing
|
||||
```cpp
|
||||
#include <cassert>
|
||||
|
||||
assert(funktion_1 == "hello");
|
||||
assert("hell" == "hello");
|
||||
```
|
||||
|
0
src/lineare_algebra_1.typ
Normal file
0
src/lineare_algebra_1.typ
Normal file
0
src/lineare_algebra_2.typ
Normal file
0
src/lineare_algebra_2.typ
Normal file
0
src/lineare_algebra_3.typ
Normal file
0
src/lineare_algebra_3.typ
Normal file
188
src/optische_messtechnik.typ
Normal file
188
src/optische_messtechnik.typ
Normal file
@ -0,0 +1,188 @@
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
|
||||
== Fehlertypen
|
||||
// {{{2
|
||||
*Systematische Fehler* \
|
||||
- treten wiederholt ein, jedoch immer mit der etwa gleichen abweichung / fehler auf. \
|
||||
*Zufällige Fehler* \
|
||||
- treten zufählig auf \
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
cetz.draw.scale(0.5)
|
||||
|
||||
let (a, b) = (0, 0)
|
||||
for i in range(0, 4){
|
||||
circle((a, b), radius: i)
|
||||
}
|
||||
line((a, b + 0.5), (a, b + 3.5))
|
||||
line((a, b - 0.5), (a, b - 3.5))
|
||||
line((a + 0.5, b), (a + 3.5, a))
|
||||
line((a - 0.5, b), (a - 3.5, a))
|
||||
content((a - 3, 3), [A])
|
||||
content((a , - 4), [Ohne Fehler])
|
||||
circle((0, 0), radius: .1, fill: black)
|
||||
circle((0.2, 0.3), radius: .1, fill: black)
|
||||
circle((-0.3, 0.2), radius: .1, fill: black)
|
||||
circle((-0.2, -0.4), radius: .1, fill: black)
|
||||
circle((0.1, -0.3), radius: .1, fill: black)
|
||||
circle((0.4, -0.1), radius: .1, fill: black)
|
||||
circle((-0.4, -0.1), radius: .1, fill: black)
|
||||
|
||||
let (a, b) = (8, 0)
|
||||
for i in range(0, 4){
|
||||
circle((a, b), radius: i)
|
||||
}
|
||||
line((a, b + 0.5), (a, b + 3.5))
|
||||
line((a, b - 0.5), (a, b - 3.5))
|
||||
line((a + 0.5, b), (a + 3.5, b))
|
||||
line((a - 0.5, b), (a - 3.5, b))
|
||||
content((a - 3, 3), [B])
|
||||
content((a , - 4), [Systematischer Fehler])
|
||||
circle((9.5, 1.5), radius: .1, fill: black)
|
||||
circle((9.7, 1.8), radius: .1, fill: black)
|
||||
circle((9.2, 1.7), radius: .1, fill: black)
|
||||
circle((9.4, 1.1), radius: .1, fill: black)
|
||||
circle((9.7, 1.2), radius: .1, fill: black)
|
||||
circle((9.9, 1.4), radius: .1, fill: black)
|
||||
circle((9.1, 1.4), radius: .1, fill: black)
|
||||
|
||||
let (a, b) = (16, 0)
|
||||
for i in range(0, 4){
|
||||
circle((a, b), radius: i)
|
||||
}
|
||||
line((a, b + 0.5), (a, b + 3.5))
|
||||
line((a, b - 0.5), (a, b - 3.5))
|
||||
line((a + 0.5, b), (a + 3.5, b))
|
||||
line((a - 0.5, b), (a - 3.5, b))
|
||||
content((a - 3, 3), [C])
|
||||
content((a , - 4), [Zufälliger Fehler])
|
||||
circle((a + 1, b + 1), radius: .1, fill: black)
|
||||
circle((a + 0.2, b + 0.5), radius: .1, fill: black)
|
||||
circle((a - 1.5, b + 0.3), radius: .1, fill: black)
|
||||
circle((a - 2, b - 1), radius: .1, fill: black)
|
||||
circle((a - 1, b - 1.3), radius: .1, fill: black)
|
||||
circle((a + 0.6, b - 1.5), radius: .1, fill: black)
|
||||
circle((a - 0.7, b + 1), radius: .1, fill: black)
|
||||
circle((a + 0.5, b - 0.3), radius: .1, fill: black)
|
||||
circle((a + 1.3, b - 0.4), radius: .1, fill: black)
|
||||
})
|
||||
// #table(columns: (1fr, 0.5fr), stroke: none, [#image("../img/Systematische_und_zufällige_Fehler.svg.png", width: 95%)], [
|
||||
// - A) ohne Fehler
|
||||
// - B) Systematischer Fehler
|
||||
// - C) Zufälliger Fehler
|
||||
// ])
|
||||
// }}}
|
||||
|
||||
== Mittelwert und Standardabweichung
|
||||
*Mittelwert:* $ accent(x, macron) eq frac(1, N) (x_1 + x_2 + ... + x_N) eq frac(1, N) sum_i^N x_i $
|
||||
Durchschnittlicher Wert aller Messungen. \ \
|
||||
*Standardabweichung:* $ Delta x = plus.minus " " root(, frac(1, N - 1) [(x_1 - accent(x, macron))^2 + (x_2 - accent(x, macron))^2] + ... + (x_n - accent(x, macron))^2) eq plus.minus " " root(, frac(1, N - 1) sum_i^N (x_i - accent(x, macron))^2) $
|
||||
Die Standardabweichung ist ein Mass dafür, wie sehr Werte von ihrem eigenen Durchschnittswert(Mittelwert) abweichen. \ \
|
||||
*Standardfehler:* $ Delta accent(x, macron) = frac(Delta x, root(, N)) $
|
||||
Der Standardfehler misst die Genauigkeit einer Stichprobenstatistik, indem er angibt, wie stark diese Statistik (z.B. der Mittelwert) typischerweise von Stichprobe zu Stichprobe schwankt. \
|
||||
|
||||
== Runden nach DIN1333
|
||||
Messergebnisse werden folgendermassen angegeben: $ x eq (accent(x, macron) plus.minus Delta x) "Einheit" " z.B." m = (2.544 plus.minus 0.026) "kg" $
|
||||
Beim runden ist die erste *signifikante Stelle* wichtig es wird auf folgende Anzahl Stellen gerundet.
|
||||
#table(columns: (0.5fr, 1fr),
|
||||
[0], [Weiter bis eine signifikante kommt.], [1 - 2], [Auf Zwei Stellen runden.], [3 - 9], [Auf Eine Stelle Runden.])
|
||||
*Beispiel 1: Runden auf zwei signifikante Stellen* \
|
||||
Originalwert: (2,5437±0,0256) kg \
|
||||
Toleranz runden: Die Toleranz ist 0,0256. Die erste signifikante Ziffer ist eine 2. Da sie eine 1 oder 2 ist, runden wir auf zwei signifikante Stellen. Die Ziffer nach der 5 ist eine 6, also wird aufgerundet.
|
||||
$ 0,0256 approx 0,026 $
|
||||
Messwert anpassen: Die gerundete Toleranz (0,026) endet auf der Tausendstel-Stelle. Der Messwert 2,5437 muss also auch auf die Tausendstel-Stelle gerundet werden. Die 7 führt zur Aufrundung.
|
||||
$ 2,5437 approx 2,544 $
|
||||
$arrow$ Ergebnis: (2,544±0,026) kg \
|
||||
|
||||
*Beispiel 2: Runden auf eine signifikante Stelle* \
|
||||
Originalwert: (174,032±82,543) m
|
||||
Toleranz runden: Die Toleranz ist 82,543. Die erste signifikante Ziffer ist eine 8. Da sie 3 oder höher ist, runden wir auf eine signifikante Stelle. Die Ziffer nach der 8 ist eine 2, also wird abgerundet.
|
||||
$ 82,543 approx 80 $
|
||||
Messwert anpassen: Die gerundete Toleranz (80) endet auf der Zehner-Stelle. Der Messwert 174,032 muss also auch auf die Zehner-Stelle gerundet werden. Die 4 führt zur Abrundung.
|
||||
$ 174,032 approx 170 $
|
||||
$arrow$ Ergebnis: (170±80) m
|
||||
|
||||
== Median
|
||||
Der Median auch Zentralwert ist der mittlere Wert in einer sortierten Datenreihe. Er teilt die Daten so, dass 50 % der Werte kleiner und 50 % größer sind. Sein großer Vorteil ist, dass er unempfindlich gegenüber Ausreissern ist, was ihn robuster macht als der Mittelwert. \
|
||||
z.B.
|
||||
#table(columns: (1fr, 1fr), stroke: none, align: center, [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (5, 1), fill: rgb(0, 0, 255, 60))
|
||||
grid((0, 0), (5, 1), step: 1)
|
||||
content((0.5, 0.5), [1])
|
||||
content((1.5, 0.5), [2])
|
||||
content((2.5, 0.5), [4])
|
||||
content((3.5, 0.5), [5])
|
||||
content((4.5, 0.5), [15])
|
||||
line((2.5, 0), (2.5, -0.8), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
content((2.5, -1), [Median = 4])
|
||||
})], [
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
rect((0, 0), (6, 1), fill: rgb(0, 0, 255, 60))
|
||||
grid((0, 0), (6, 1), step: 1)
|
||||
content((0.5, 0.5), [1])
|
||||
content((1.5, 0.5), [2])
|
||||
content((2.5, 0.5), [4])
|
||||
content((3.5, 0.5), [5])
|
||||
content((4.5, 0.5), [15])
|
||||
content((5.5, 0.5), [16])
|
||||
line((3, 0), (3, -0.8), mark: (end: ">"), fill: blue, stroke: blue)
|
||||
content((3, -1), [Median = 4.5])
|
||||
})])
|
||||
|
||||
#pagebreak()
|
||||
== Normalverteilung
|
||||
Die Normalverteilung, auch Gauß-Verteilung genannt, ist eine der wichtigsten Wahrscheinlichkeitsverteilungen in der Statistik. Sie beschreibt die Verteilung vieler zufälliger Phänomene in der Natur und Gesellschaft, wie z.B. die Körpergröße von Menschen, den Intelligenzquotienten oder Messfehler.
|
||||
$ f(x) eq frac(1, sigma root(, 2 pi)) e ^(- frac((x - mu)^2, 2 sigma^2)) $
|
||||
#grid(columns: 2,
|
||||
[
|
||||
Es gilt: \
|
||||
$accent(x, macron) arrow mu$ \
|
||||
$Delta x arrow sigma$ \
|
||||
$mu$ = *Erwartungswert* \
|
||||
$sigma$ = *Standardabweichung* \
|
||||
$sigma^2$ = *Varianz* \
|
||||
|
||||
Verteilung: \
|
||||
68.27% Der Messwerte liegen im Intervall: \ $\[mu - sigma ; mu + sigma \]$ \
|
||||
95.45% Der Messwerte liegen im Intervall: \ $\[mu - 2 sigma ; mu + 2 sigma \]$ \
|
||||
],
|
||||
[#image("../img/optische_messtechnik/Normalverteilung.svg")],
|
||||
[#image("../img/optische_messtechnik/Normalverteilung_u.svg")],
|
||||
[#image("../img/optische_messtechnik/Normalverteilung_sigma.svg")],
|
||||
)
|
||||
=== FWHM
|
||||
Die *FWHM* (full width at half maximum) #text(fill: orange)[*Halbwertsbreite*] der Gausskurve ist gegeben durch:
|
||||
$ Delta x_("FWHM") = 2 " " root(, 2 ln(2)) dot sigma $
|
||||
|
||||
== Lineare Regression
|
||||
#grid(columns: 2,
|
||||
[Hat man einen linearen Zusammenhang wie z. B. $y eq m dot x + b$, der jedoch wegen Messtoleranzen oder äusserer Einflüsse Abweichungen aufweist, so können die Werte mittels linearer Regression an eine lineare Funktion angepasst werden.
|
||||
],
|
||||
// image("../img/optische_messtechnik/lineare_Regression.svg", height: 80%)
|
||||
image("../img/optische_messtechnik/lineare_Regression.svg")
|
||||
)
|
||||
|
||||
=== Determinationskoeffizient
|
||||
Wertebereich: $R^2$ liegt immer zwischen 0 und 1 (oder 0 % und 100 %).
|
||||
- $r^2 = 1.0$: perfekter linearer Zusammenhang, alle Punkte liegen auf einer Gerade
|
||||
- $r^2 = 0.7$: deutliche Korrelation, aber starke Schwankungen
|
||||
- $r^2 = 0.0$: gar kein linearer Zusammenhang, perfekte Unordnung
|
||||
#image("../img/optische_messtechnik/Determinationskoeffizient.svg", width: 60%)
|
||||
|
||||
== Gauss’sches Fehlerfortpflanzungsgesetz
|
||||
|
||||
== Wahrscheinlichkeitsverteilungen
|
||||
|
||||
== Fouriertransformation
|
||||
|
||||
== Interferometrie
|
||||
=== Interferenzgleichung
|
||||
=== Michelson Interferometer
|
||||
==== Weglängenänderung
|
||||
==== Brechungsindexänderung
|
||||
=== Fabry-Pérot Interferometer
|
||||
|
2
src/physik_1.typ
Normal file
2
src/physik_1.typ
Normal file
@ -0,0 +1,2 @@
|
||||
== Physik 1
|
||||
|
4
src/physik_2.typ
Normal file
4
src/physik_2.typ
Normal file
@ -0,0 +1,4 @@
|
||||
== Schwingungen und Wellen
|
||||
|
||||
== Elektromagnetismus
|
||||
|
105
src/physik_3.typ
Normal file
105
src/physik_3.typ
Normal file
@ -0,0 +1,105 @@
|
||||
#import "@preview/cetz:0.4.1"
|
||||
#import "@preview/cetz-venn:0.1.4"
|
||||
|
||||
== Physik 3
|
||||
=== Physik des Lichts
|
||||
==== Elektromagnetische Wellen
|
||||
=== Kalorik
|
||||
==== Druck
|
||||
|
||||
==== Temperatur
|
||||
===== Temperatur-Skalen
|
||||
#table(columns: (0.5fr, 1fr, 1fr, 1fr),
|
||||
[], [Fahrenheit], [Celsius], [Kelvin],
|
||||
[Definition], [willkürlich], [willkürlich], ["Bewusst"],
|
||||
[Bestimmung], [0 ℉ kälteste bekannte Temperatur. \ 32 ℉ Gefrierpunkt von Wasser. \ 96 ℉ Körpertemperatur eines gesunden Menschen.],
|
||||
[0 ℃ am Gefrierpunkt von Wasser \ 100 ℃ Siedepunkt von Wasser], [Absoluter Nullpunkt]
|
||||
)
|
||||
Umrechnungsformeln
|
||||
#table(columns: (0.4fr, 1fr, 1fr, 1fr),
|
||||
[], [$x$K], [$y$℃ ], [$z$℉ ],
|
||||
[$x$K], [$x$K], [$(x - 273.15)$℃ ], [$(x dot frac(9, 5) - 459.67)$℉ ],
|
||||
[$y$℃ ], [$y + 273.15)$K], [$y$℃ ], [$(y dot frac(9, 5) + 32)$℉ ],
|
||||
[$z$℉ ], [$frac(5, 9) dot (z + 459.67)$K], [$frac(5, 9) dot (z -32)$K], [$z$℉ ],
|
||||
)
|
||||
|
||||
===== Thermische Ausdehnung
|
||||
#table(columns: (0.7fr, 0.8fr, 1fr), stroke: (x: none), align: horizon,
|
||||
[Länge], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$Delta l eq alpha dot l_(alpha) dot Delta T$])], [],
|
||||
[Fläche], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$Delta A eq beta dot A_0 dot Delta T$])], [$beta approx 2 dot alpha$],
|
||||
[Volumen], [#box(stroke: 1pt + red, inset: (x: 1em, y: 0.5em), [$Delta V eq gamma dot V_0 dot Delta T$])], [$gamma approx 3 dot alpha$],
|
||||
)
|
||||
Volumenausdenung:
|
||||
#table(columns: (1fr, 1fr),
|
||||
[Festkörper], [$gamma approx 3 dot alpha$],
|
||||
[Flüssigkeiten], [$gamma$ in Tabellen gelistet],
|
||||
[Gase], [nicht anwendbar],
|
||||
)
|
||||
|
||||
isotherme -> die Temperatur bleibt während des Prozesses immer konstant
|
||||
|
||||
==== Wärme-Energie
|
||||
|
||||
===== Phasendiagramme
|
||||
|
||||
===== Wärmekapazität
|
||||
|
||||
==== Latenz-Wärme
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
line((-0.5, 0), (15, 0), mark: (end: ">"), fill: black)
|
||||
line((0, -0.5), (0, 6), mark: (end: ">"), fill: black)
|
||||
line((0, 0), (3, 2))
|
||||
line((3, 2), (6, 2))
|
||||
line((6, 2), (10, 4))
|
||||
line((10, 4), (12, 4))
|
||||
line((12, 4), (14, 5))
|
||||
line((3, 0), (3, 2), stroke: (dash: "dashed"))
|
||||
line((6, 0), (6, 2), stroke: (dash: "dashed"))
|
||||
line((3, 0), (6, 0), mark: (symbol: ">"), fill: blue, stroke: blue)
|
||||
line((10, 0), (10, 4), stroke: (dash: "dashed"))
|
||||
line((12, 0), (12, 4), stroke: (dash: "dashed"))
|
||||
line((10, 0), (12, 0), mark: (symbol: ">"), fill: blue, stroke: blue)
|
||||
line((-0.5, 2), (3, 2), stroke: (dash: "dashed"))
|
||||
line((-0.5, 4), (10, 4), stroke: (dash: "dashed"))
|
||||
content((0.5, 6), [$T$])
|
||||
content((-1, 4), [$T_v$])
|
||||
content((-1, 2), [$T_s$])
|
||||
content((15, -0.5), [$Q$])
|
||||
content((4.5, -0.5), [$Q_s$])
|
||||
content((11, -0.5), [$Q_v$])
|
||||
content((2, 0.5), [fest])
|
||||
content((8, 0.5), [flüssig])
|
||||
content((13.5, 0.5), [gas])
|
||||
})
|
||||
|
||||
==== Ideale Gase
|
||||
===== Makrozustand
|
||||
#cetz.canvas({
|
||||
import cetz.draw: *
|
||||
scale(0.9)
|
||||
for i in range(0, 4){
|
||||
rect((i * 5, 0), (i * 5 + 4, 1))
|
||||
}
|
||||
content((2, 0.5), [Stoffmenge (n)])
|
||||
content((7, 0.5), [Volumen (V)])
|
||||
content((12, 0.5), [Geschwindigkeit (v)])
|
||||
content((17, 0.5), [Masse (m)])
|
||||
rect((1, -1), (8, -2))
|
||||
rect((11, -1), (18, -2))
|
||||
line((2, 0), (2, -1), mark: (end: ">"), fill: black)
|
||||
line((7, 0), (7, -1), mark: (end: ">"), fill: black)
|
||||
line((11.5, 0), (7.5, -1), mark: (end: ">"), fill: black)
|
||||
line((12, 0), (12, -1), mark: (end: ">"), fill: black)
|
||||
line((17, 0), (17, -1), mark: (end: ">"), fill: black)
|
||||
content((4.5, -1.5), [Häufigkeit der Stösse])
|
||||
content((14.5, -1.5), [Heftigkeit der Stösse])
|
||||
content((4.5, -2.5), [$approx n dot v dot frac(1, V)$])
|
||||
content((14.5, -2.5), [$approx m dot v$])
|
||||
})
|
||||
|
||||
===== Universelle Gasgleichung
|
||||
===== Allgemeine Gasgleichung
|
||||
|
||||
==== Kalorische Zustandsgleichung
|
||||
|
189
src/python.typ
Normal file
189
src/python.typ
Normal file
@ -0,0 +1,189 @@
|
||||
== Befehle
|
||||
#table(columns: (0.3fr, 1fr, 0.4fr),
|
||||
[Befehl], [Code], [Ausgabe],
|
||||
[Betrag], [```py np.abs(-5) ``` \ ```py np.absolute(-5) ```], [5],
|
||||
[Mittelwert], [```py np.mean([1, 2, 3, 4, 5]) ```], [3],
|
||||
[Median \ (Zentralwert)], [```py np.median([1, 2, 4, 5, 15]) ``` \ ```py np.median([1, 2, 4, 5, 15, 16]) ```], [4 \ 4.5],
|
||||
[Standardabweichung], [```py np.std([1, 2, 3, 4, 5]) ``` \ ```py np.std([1, 2, 3, 4, 5], ddof=1) ``` \ ddof = Delta Degrees of Freedom (Nicht so relevant für uns "höhere mathe" wichitg immer gleich machen!)], [1.41 \ 1.58],
|
||||
[Wurzel], [```py np.sqrt(16) ```], [4],
|
||||
[Integrall], [```py inter = np.trapezoid(y_data, x_data)```], [],
|
||||
|
||||
[Array], [```py np.linspace(2, 10, 5) ```], [\[ 2. 4. 6. 8. 10.\]],
|
||||
[Array], [```py np.arange(4, 10) ``` \ ```py np.arange(0, 1, 0.2) ```], [\[4 5 6 7 8 9\] \ \[0. 0.2 0.4 0.6 0.8\]],
|
||||
[ln], [```py np.log(x) ```], [],
|
||||
[10er log], [```py np.log10(x) ```], [],
|
||||
)
|
||||
|
||||
|
||||
== Matrizen
|
||||
#table(columns: (0.3fr, 0.9fr, 0.5fr),
|
||||
[Array], [```py
|
||||
A = np.array([[1, 3, -1],
|
||||
[4, -2, 8]])
|
||||
|
||||
B = np.array([[-3, 9, 3],
|
||||
[-6, 6, 3]])
|
||||
```],[],
|
||||
[Addition], [```py
|
||||
C = A + B
|
||||
```],[```
|
||||
C = [[-2 12 2]
|
||||
[-2 4 11]]
|
||||
```],
|
||||
[Multiplikation], [```py
|
||||
C = A @ B
|
||||
D = -2 * B
|
||||
```],[```
|
||||
C = [[ 15 -3 24]
|
||||
[-52 92 -2]]
|
||||
|
||||
D = [[ 6 -18 -6]
|
||||
[ -8 4 -16]
|
||||
[ 12 -12 -6]]
|
||||
```],
|
||||
[Transposition], [```py
|
||||
C = A.T
|
||||
```],[```
|
||||
C = [[ 1 8]
|
||||
[ 3 -4]
|
||||
[-1 2]]
|
||||
```],
|
||||
[Inverse], [```py
|
||||
C = np.linalg.inv(B)
|
||||
```],[```
|
||||
```],
|
||||
[Rodrigues-Rotationsmatrizen], [```py
|
||||
def J(w):
|
||||
M = np.array([[0, -w[2], w[1]],
|
||||
[w[2], 0, -w[0]],
|
||||
[-w[1], w[0], 0]])
|
||||
return M
|
||||
def R(phi, n):
|
||||
nn = n/np.linalg.norm(n)
|
||||
M = np.eye(3) + (1-np.cos(phi)) * J(nn)@J(nn) + np.sin(phi)*J(nn)
|
||||
return M
|
||||
```],[```
|
||||
```],
|
||||
[Spur / trace], [```py
|
||||
s = np.trace(A)
|
||||
```],[```
|
||||
s = -3
|
||||
```],
|
||||
[Determinante], [```py
|
||||
d = np.linalg.det(A)
|
||||
```],[```
|
||||
```],
|
||||
[], [], [\ ],
|
||||
[Zeros], [```py
|
||||
A = np.zeros((2,3))
|
||||
```],[```
|
||||
[[0. 0. 0.]
|
||||
[0. 0. 0.]]
|
||||
```],
|
||||
[Ones], [```py
|
||||
A = np.ones((2,3))
|
||||
```],[```
|
||||
[[1. 1. 1.]
|
||||
[1. 1. 1.]]
|
||||
```],
|
||||
[Eye], [```py
|
||||
A = np.eye(2,3)
|
||||
```],[```
|
||||
[[1. 0. 0.]
|
||||
[0. 1. 0.]]
|
||||
```],
|
||||
[Diag], [```py
|
||||
d = np.array([1.,2.,3.])
|
||||
A = np.diag(d)
|
||||
```],[```
|
||||
[[1. 0. 0.]
|
||||
[0. 2. 0.]
|
||||
[0. 0. 3.]]
|
||||
```],
|
||||
[Diag rev.], [```py
|
||||
A = np.array([[1. 0. 0.],
|
||||
[0. 2. 0.],
|
||||
[0. 0. 3.]]
|
||||
B = np.diag(A)
|
||||
```],[```
|
||||
B = [1. 2. 3.]
|
||||
```],
|
||||
|
||||
)
|
||||
|
||||
|
||||
== Matplotlib
|
||||
#table(columns: (0.3fr, 0.9fr, 0.5fr),
|
||||
[Linien], [```py
|
||||
x = [1, 2, 3, 4]
|
||||
y = [1, 4, 9, 16]
|
||||
|
||||
plt.plot(x, y)
|
||||
plt.xlabel('Zeit (s)')
|
||||
plt.ylabel('Amplitude')
|
||||
plt.grid()
|
||||
plt.show()
|
||||
```], [#image("../img/python/matplotlib_linie.png", width: 100%)],
|
||||
|
||||
[Kreis], [```py
|
||||
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
|
||||
sizes = [15, 30, 45, 10]
|
||||
|
||||
plt.pie(sizes, labels=labels)
|
||||
plt.show()
|
||||
```], [#image("../img/python/matplotlib_kreis.png", width: 100%)],
|
||||
[Punktwolke / Scatterplot], [```py
|
||||
n = 100
|
||||
x = np.random.normal(0,1,n)
|
||||
y = np.random.normal(0,1,n)
|
||||
|
||||
plt.scatter(x, y)
|
||||
plt.title('Scatter Plot')
|
||||
plt.xlabel('x')
|
||||
plt.ylabel('y')
|
||||
plt.show()
|
||||
```], [#image("../img/python/matplotlib_punktewolke.png", width: 100%)],
|
||||
|
||||
[Säulendiagramme], [```py
|
||||
fruits = ['apple', 'blueberry', 'cherry', 'orange']
|
||||
counts = [40, 100, 30, 55]
|
||||
|
||||
bar_labels = ['red', 'blue', '_red', 'orange']
|
||||
bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']
|
||||
|
||||
plt.bar(fruits, counts, label=bar_labels, color=bar_colors)
|
||||
plt.ylabel('fruit supply')
|
||||
plt.title('Fruit supply by kind and color')
|
||||
plt.show()
|
||||
```], [#image("../img/python/matplotlib_säulendiagramme.png", width: 100%)],
|
||||
|
||||
[Säulendiagramme wagerecht], [```py
|
||||
fruits = ['apple', 'blueberry', 'cherry', 'orange']
|
||||
counts = [40, 100, 30, 55]
|
||||
|
||||
bar_labels = ['red', 'blue', '_red', 'orange']
|
||||
bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']
|
||||
|
||||
plt.barh(fruits, counts, label=bar_labels, color=bar_colors)
|
||||
plt.ylabel('fruit supply')
|
||||
plt.title('Fruit supply by kind and color')
|
||||
plt.show()
|
||||
```], [#image("../img/python/matplotlib_säulendiagramme_wagerecht.png", width: 100%)],
|
||||
|
||||
[Ausgabe als png], [```py
|
||||
plt.savefig("test.png", transparent=True) # transparent nur für png
|
||||
plt.savefig("test.png")
|
||||
plt.show() # savefig muss zwingend vor show()!
|
||||
```], [#image("../img/python/matplotlib_savefig.png", width: 100%)],
|
||||
[Ausgabe als pdf], [```py
|
||||
plt.savefig("test.pdf", pad_inches=0.1, bbox_inches="tight")
|
||||
# so ist der Rand um den plot schmaller.
|
||||
plt.savefig("test.pdf")
|
||||
plt.show() # savefig muss zwingend vor show()!
|
||||
```], [#image("../img/python/matplotlib_savefig_tight.png", width: 100%)],
|
||||
[Ausgabe als svg], [```py
|
||||
plt.savefig("test.svg")
|
||||
plt.show() # savefig muss zwingend vor show()!
|
||||
```], [svg ist eine Vektorgrafik],
|
||||
)
|
||||
|
62
src/python_wahlmodul.typ
Normal file
62
src/python_wahlmodul.typ
Normal file
@ -0,0 +1,62 @@
|
||||
== Python Wahlmodul
|
||||
=== Virtuall Envirements
|
||||
Python Umgebungen (Environments) sind isolierte Verzeichnisse, die eine spezifische Python-Version und Projektabhängigkeiten (Pakete) enthalten. Ihr Zweck ist die Trennung der Projekte voneinander, um Konflikte zu vermeiden und die Reproduzierbarkeit sicherzustellen. \
|
||||
*Environment erstellen* \ Normalerweise werden die Environments ".venv" genannt.
|
||||
#table(columns: 1fr, [```sh
|
||||
python -m venv /path/to/venv
|
||||
```])
|
||||
*Environment betretten* \ Dafür gibt es zwei methoden.
|
||||
#table(columns: 1fr, [```sh
|
||||
. ./path/to/venv/bin/activate
|
||||
# oder
|
||||
source ./path/to/venv/bin/activate
|
||||
```])
|
||||
=== Datentyp
|
||||
#table(columns: (0.7fr, 0.5fr, 1fr),
|
||||
[Ganzzahl],[```py int ```], [```py x: int = 4 ```],
|
||||
[Gleitkomma Zahl],[```py float ```], [```py x: float = 1.234 ```],
|
||||
[Text (String)],[```py str ```], [```py x: str = "Hallo" ```],
|
||||
[Wahr oder Falsch],[```py bool ```], [```py x: bool = True ``` \ ```py x: bool = False ```],
|
||||
[Liste (Array)],[```py list ```], [```py x: list = [1, 2, "abc", 1.23] ```],
|
||||
[Dicenary],[```py dict ```], [```py x: dict = {"a": 3, "b": 4} ```],
|
||||
// [Ganzzahl],[```py set ```], [```py x: int = 4 ```],
|
||||
)
|
||||
=== Operatoren
|
||||
#table(columns: (0.7fr, 1fr, 0.6fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Python-Operatoren], [Erklärung], [Operatoren],
|
||||
[Arithmetische Operatoren], [Verknüpfen zweier Zahlen zu einr neuen Zahl], [`+, -, *, /, //, %, **`],
|
||||
[Vergleichsoperatoren], [Vergleichen zweier Ausdrücke miteinander], [`<, >, ==, !=, <=, >=`],
|
||||
[Logische Operatoren], [Verknüpfen Ausdrücke im boolischen Kontext], [`and, or, not`],
|
||||
[Identitäts Operatoren], [Feststellen ob zwei Namen auf dasselbe Objekt verweisen], [`is, is not`],
|
||||
)
|
||||
*Anmerkungen zu den Operatoren:* \
|
||||
#table(columns: (0.4fr, 0.5fr, 0.5fr, 0.4fr, 1fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Ausdruck], [Name], [Beispiel], [Ergebnis], [Beschreibung],
|
||||
[`%`], [Modulo], [```py 7 % 3 ```], [1], [Gibt den Rest einer Division aus],
|
||||
[`//`], [Floor division], [```py 7 // 2 ```], [2], [Ergebnis wird immer zur nächsten kleineren Ganzzahl abgerundet],
|
||||
[`**`], [Hochrechnen], [```py 2**3 ```], [8], [Nichts anderes als: $2^3$],
|
||||
)
|
||||
=== Listen
|
||||
#table(columns: (0.5fr, 0.7fr, 1fr),
|
||||
fill: (x, y) => if y == 0 {gray.lighten(40%)},
|
||||
[Operation], [Beispiel], [Beschreibung],
|
||||
[Liste Zuweisen], [```py li = [10, 15, 20, 25, 30] ```], [Die Liste wurde der Variable "li" zugewiessen],
|
||||
[Ein Element ausgeben], [```py print(li[1]) ``` \ -> 15], [Es Wird "15" ausgeben da das erste Element den Index 0 hat.],
|
||||
[Das Letzte Element ausgeben], [```py print(li[-1]) ``` \ -> 30], [Mit dem "-" werden die Elemente von Hinten ausgeben. z.b. bei "-2" würde 25 ausgegeben werden],
|
||||
[Alles ab x ausgeben], [```py print(li[2:]) ``` \ -> `[20, 25, 30]`], [Da kein ende hinter dem Doppelpunk definiert ist wird alles ausgeben],
|
||||
[Alles bis x ausgeben], [```py print(li[:2]) ``` \ -> `[10, 15]`], [Es wird alles bis zum dritten Item ausgegeben],
|
||||
[Von x bis y ausgeben], [```py print(li[2:4]) ``` \ -> `[20, 25]`], [Es wird der Start und stop definiert],
|
||||
[Jedes x ausfeben], [```py print(li[::2]) ``` \ -> `[10, 20, 30]`], [Es wir jedes Zeite Item ausgegeben],
|
||||
[Jedes x ausfeben mit erstem beginnen], [```py print(li[1::2]) ``` \ -> `[15, 25]`], [Es wir jedes Zeite Item ausgegeben, dedoch mit dem ersten Item beginnend],
|
||||
)
|
||||
=== Runden
|
||||
#table(columns: (1fr, 1fr),
|
||||
[```py
|
||||
pi = 3.141592653589793
|
||||
print(round(pi, 2)
|
||||
```], [ -> 3.14]
|
||||
)
|
||||
Die "2" durch anzahl stellen ersetzen.
|
||||
|
Loading…
x
Reference in New Issue
Block a user