diff --git a/src/cheatsheets/Digitaltechnik.typ b/src/cheatsheets/Digitaltechnik.typ index 688e720..8958d3e 100644 --- a/src/cheatsheets/Digitaltechnik.typ +++ b/src/cheatsheets/Digitaltechnik.typ @@ -1,8 +1,10 @@ -#import "../lib/common_rewrite.typ" : * #import "@preview/mannot:0.3.1" #import "@preview/cetz:0.4.2" #import "@preview/zap:0.5.0" + +#import "../lib/common_rewrite.typ" : * #import "../lib/truthtable.typ" : * +#import "../lib/fetModel.typ" : * #show math.integral: it => math.limits(math.integral) #show math.sum: it => math.limits(math.sum) @@ -565,10 +567,7 @@ (cycle_start,signal_hight), (cycle_time*(t_setup + 2), signal_hight), (cycle_time*(t_setup + 2) + switch_offset, 0), (cycle_end + switch_offset, 0), stroke: signal_storke ) - - }) - ] diff --git a/src/cheatsheets/Schaltungstheorie.typ b/src/cheatsheets/Schaltungstheorie.typ index 186cc16..cd5a139 100644 --- a/src/cheatsheets/Schaltungstheorie.typ +++ b/src/cheatsheets/Schaltungstheorie.typ @@ -108,7 +108,63 @@ #bgBlock(fill: colorAllgemein)[ #subHeading(fill: colorAllgemein)[Verschaltung] + $1/x_"ges" = 1/x_1 + 1/x_2 + 1/x_3 + ...$ + $x_1 parallel x_2 = 1/(1/x_1 + 1/x_2) = (x_1 x_2)/(x_1 + x_2)$ + + $x_1 parallel x_2 parallel x_3 = (x_1 x_2 x_3)/(x_1 x_2 + x_2 x_3 + x_1 x_3)$ + + #table( + columns: (1fr, 1fr), + fill: (x, y) => if calc.rem(x, 2) == 1 { tableFillLow } else { tableFillHigh }, + + [*Serie*], + [*Reihe/Parrallel*], + + + align( + horizon+center, + scale(100%, + zap.circuit({ + import zap : * + + resistor("R1", (0,0.375), (1.5,0.375), fill: none, width: 1, height: 0.4) + resistor("R2", (1.5,0.375), (3,0.375), fill: none, width: 1, height: 0.4) + }) + ) + ), + align( + horizon+center, + scale( + 100%, + zap.circuit({ + import zap : * + + resistor("R1", (0,0), (2,0), fill: none, width: 1, height: 0.4) + resistor("R2", (0,0.75), (2,0.75), fill: none, width: 1, height: 0.4) + wire("R1.in", "R2.in") + wire("R1.out", "R2.out") + + node("N2", (0,0.375)) + node("N3", (2,0.375)) + + wire("N2", (rel: (-0.3, 0))) + wire("N3", (rel: (0.3, 0))) + }), + ) + ), + + + + $R_"ges" = R_1+R_2$, + $R_"ges" = R_1 parallel R_2$, + $G_"ges" = G_1 parallel G_2$, + $G_"ges" = G_1 + G_2$, + $L_"ges" = L_1 + L_2$, + $L_"ges" = L_1 parallel L_2$, + $C_"ges" = C_1 parallel C_2$, + $C_"ges" = C_1 + C_2$, + ) ] // Quell Wandlung @@ -133,8 +189,6 @@ ) ] - #colbreak() - // Quell Wandlung #bgBlock(fill: colorEineTore)[ #subHeading(fill: colorEineTore)[Quelle Wandlung] @@ -785,13 +839,14 @@ *Levi's Lustig Leistung* - $underline(S) = underline(U) dot underline(I)^*$\ + $(P =) space underline(S) = underline(U) dot underline(I)^*$\ #table( columns: (auto, 1fr, auto), - [Scheinleitsung], [$abs(underline(S))$], [$["VA"]$], - [Wirkleistung], [$P = "Real"(underline(S)) $], [$["W"]$], - [Blindleistung], [$Q = "Imag"(underline(S))$], [$["var"]$] + fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillLow } else { tableFillHigh }, + [Scheinleitsung], [$(P_s =) space abs(underline(S))$], [$["VA"]$], + [Wirkleistung], [$(P_w =) space P = "Real"(underline(S)) $], [$["W"]$], + [Blindleistung], [$(P_b =) space Q = "Imag"(underline(S))$], [$["var"]$] ) ] @@ -829,6 +884,8 @@ columns: (auto, auto, auto, auto), inset: 2mm, align: horizon, + fill: (x, y) => if calc.rem(y, 2) == 1 { rgb("#c5c5c5") } else { white }, + table.header([], [*Ein-Tor*], [*Zwei-Tor*], [*Reaktive Elemente*]), [*passiv*\ (nimmt Energie auf)\ $not$aktiv], [$forall (u,i) in cal(F): u dot i >= 0$], diff --git a/src/lib/circuit.typ b/src/lib/circuit.typ index f09b286..c5efbb3 100644 --- a/src/lib/circuit.typ +++ b/src/lib/circuit.typ @@ -13,7 +13,7 @@ ctx.zap.style.insert("einTor", ( scale: auto, - fill: auto, + fill: none, height: 3mm, width: 6mm, )) diff --git a/src/lib/common_rewrite.typ b/src/lib/common_rewrite.typ index 8272635..e19e38f 100644 --- a/src/lib/common_rewrite.typ +++ b/src/lib/common_rewrite.typ @@ -27,6 +27,9 @@ align(left, block(e)) } +#let tableFillHigh = white +#let tableFillLow = color.lighten(gray, 30%) + #let sinTable = [ #let data = json("../sintable.json") #table( @@ -34,10 +37,11 @@ rows: data.keys().len(), stroke: none, table.hline(stroke: (thickness: 0.3mm)), - fill: (x, y) => if (calc.rem(y, 2) == 0) { color.lighten(gray, 50%) } else { white }, + fill: (x, y) => if (calc.rem(y, 2) == 0) { tableFillLow } else { tableFillHigh }, - ..for (label) in data.keys() { - ([*#eval(label, mode: "math")*], ) + table.vline(), + ..for (i, label) in data.keys().enumerate() { + ([*#eval(label, mode: "math")*], if i > 0 { table.vline() } else { table.vline(stroke: none) }) }, table.hline(stroke: (thickness: 0.3mm)), @@ -46,6 +50,7 @@ for (col) in data.keys() { (eval(data.at(col).at(i), mode: "math"),) } - } + }, + table.hline(stroke: (thickness: 0.3mm)), ) ] \ No newline at end of file diff --git a/src/lib/fetModel.typ b/src/lib/fetModel.typ new file mode 100644 index 0000000..6661e0d --- /dev/null +++ b/src/lib/fetModel.typ @@ -0,0 +1,242 @@ +#import "@preview/zap:0.5.0" + +#set page(width: auto, height: auto) + +#let FetModelSubstrate = zap.circuit({ + import zap: * + import cetz.draw: * + + rect( + (0, 0), + (12, 4), + fill: rgb("#ffb1b1"), + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + content("substrate", [Bulk], anchor: "north", padding: 0.2) +}) + +#let FetModel1 = zap.circuit({ + import zap: * + import cetz.draw: * + + rect( + (0, 0), + (12, 4), + fill: rgb("#ffb1b1"), + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + rect((2.75, 3), (5.25, 4), fill: rgb("#61ff9f"), name: "kanal1", radius: ( + south: 0.2, + )) + rect((6.75, 3), (9.25, 4), fill: rgb("#61ff9f"), name: "kanal2", radius: ( + south: 0.2, + )) + + content("kanal1", [n+], anchor: "center", padding: 0.2) + content("kanal2", [n+], anchor: "center", padding: 0.2) + content("substrate", [Bulk], anchor: "north", padding: 0.2) +}) + +#let FetModel2 = zap.circuit({ + import zap: * + import cetz.draw: * + + rect( + (0, 0), + (12, 4), + fill: rgb("#ffb1b1"), + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + rect((2.75, 3), (5.25, 4), fill: rgb("#61ff9f"), name: "kanal1", radius: ( + south: 0.2, + )) + rect((6.75, 3), (9.25, 4), fill: rgb("#61ff9f"), name: "kanal2", radius: ( + south: 0.2, + )) + + content("kanal1", [n+], anchor: "center", padding: 0.2) + content("kanal2", [n+], anchor: "center", padding: 0.2) + content("substrate", [Bulk], anchor: "north", padding: 0.2) + + + rect((0, 4), (12, 4.5), fill: rgb("#fffc61"), name: "isolator") + content("isolator.west", [Isolator ($"SiO"_2$)], anchor: "west", padding: .2) +}) + +#let FetModel3 = zap.circuit({ + import zap: * + import cetz.draw: * + + rect( + (0, 0), + (12, 4), + fill: rgb("#ffb1b1"), + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + rect((2.75, 3), (5.25, 4), fill: rgb("#61ff9f"), name: "kanal1", radius: ( + south: 0.2, + )) + rect((6.75, 3), (9.25, 4), fill: rgb("#61ff9f"), name: "kanal2", radius: ( + south: 0.2, + )) + + content("kanal1", [n+], anchor: "center", padding: 0.2) + content("kanal2", [n+], anchor: "center", padding: 0.2) + content("substrate", [Bulk], anchor: "north", padding: 0.2) + + + rect((0, 4), (3, 4.5), fill: rgb("#fffc61"), name: "isolator2") + rect((5, 4), (7, 4.5), fill: rgb("#fffc61")) + rect((9, 4), (12, 4.5), fill: rgb("#fffc61"), name: "isolator") + + rect((3, 4), (5, 4.25), fill: gray) + rect((7, 4), (9, 4.25), fill: gray) + rect((5.1, 4.5), (6.9, 4.75), fill: gray) + + content("isolator", [$"SiO"_2$]) + content("isolator2", [Isolator]) +}) + +#let FetModel(type: "N", s: 100%) = zap.circuit({ + import zap: * + import cetz.draw: rect, content + + cetz.draw.scale(s) + + let pTypeFill = rgb("#ffb1b1"); + let pTypeFill = rgb("#ffb1b1"); + let nTypeFill = rgb("#61ff9f") + + rect( + (0, 0), + (12, 4), + fill: if(type == "N") { pTypeFill } else { nTypeFill }, + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + wire((13, 5.5), (13, 0), mark: (end: ">")) + node("n-r1", (13, 5.75)) + + wire((6, 4.5), (6, 5.75)) + node("n-g1", (6, 5.75)) + wire("n-g1", "n-r1") + + node("n-s1", (4, 5)) + wire("n-s1", (4, 4.25)) + + node("n-d1", (8, 5)) + wire("n-d1", (8, 4.25)) + + rect((0, 4), (3, 4.5), fill: rgb("#fffc61"), name: "isolator2") + rect((5, 4), (7, 4.5), fill: rgb("#fffc61")) + rect((9, 4), (12, 4.5), fill: rgb("#fffc61"), name: "isolator") + + rect((3, 4), (5, 4.25), fill: gray) + rect((7, 4), (9, 4.25), fill: gray) + rect((5.1, 4.5), (6.9, 4.75), fill: gray) + + content("n-g1", [*G*\ate], anchor: "south", padding: 0.2, auto-scale: true) + content("n-s1", [*S*\ource], anchor: "south", padding: 0.2) + content("n-d1", [*D*\rain], anchor: "south", padding: 0.2, auto-scale: true) + content("substrate", [Bulk], anchor: "north", padding: 0.2, auto-scale: true) + content("p", if type == "N" [p] else [n], auto-scale: true) + content("isolator", [$"SiO"_2$], auto-scale: true) + + content("isolator2", [Isolator], auto-scale: true) + + rect((2.75, 3), (5.25, 4), fill: if(type == "N") { nTypeFill } else { pTypeFill }, name: "kanal1", radius: ( + south: 0.2, + )) + rect((6.75, 3), (9.25, 4), fill: if(type == "N") { nTypeFill } else { pTypeFill }, name: "kanal2", radius: ( + south: 0.2, + )) + + content("kanal1", if type == "N" [n+] else [p+], anchor: "center", padding: 0.2, auto-scale: true) + content("kanal2", if type == "N" [n+] else [p+], anchor: "center", padding: 0.2, auto-scale: true) +}) + +#let FetModelConducting = zap.circuit({ + import zap: * + import cetz.draw: * + + rect( + (0, 0), + (12, 4), + fill: rgb("#ffb1b1"), + name: "p", + ) + rect((0, -0.05), (12, -0.05), stroke: 3pt, name: "substrate") + earth("g1", (11.5, 0)) + + wire((13, 5.5), (13, 0), mark: (end: ">")) + node("n-r1", (13, 5.75)) + + wire((6, 4.5), (6, 5.75)) + node("n-g1", (6, 5.75)) + wire("n-g1", "n-r1") + + node("n-s1", (4, 5)) + wire("n-s1", (4, 4.25)) + + node("n-d1", (8, 5)) + wire("n-d1", (8, 4.25)) + + rect((0, 4), (3, 4.5), fill: rgb("#fffc61"), name: "isolator2") + rect((5, 4), (7, 4.5), fill: rgb("#fffc61")) + rect((9, 4), (12, 4.5), fill: rgb("#fffc61"), name: "isolator") + + rect((3, 4), (5, 4.25), fill: gray) + rect((7, 4), (9, 4.25), fill: gray) + rect((5.1, 4.5), (6.9, 4.75), fill: gray) + + content("n-g1", [*G*\ate], anchor: "south", padding: 0.2) + content("n-s1", [*S*\ource], anchor: "south", padding: 0.2) + content("n-d1", [*D*\rain], anchor: "south", padding: 0.2) + content("substrate", [Bulk], anchor: "north", padding: 0.2) + content("p", [p]) + content("isolator", [$"SiO"_2$]) + content("isolator2", [Isolator]) + + rect((2.75, 3), (5.25, 4), fill: rgb("#61ff9f"), name: "kanal1", radius: ( + south: 0.2, + )) + rect((6.75, 3), (9.25, 4), fill: rgb("#61ff9f"), name: "kanal2", radius: ( + south: 0.2, + )) + rect((5.20, 3.99), (6.8, 3.9), fill: rgb("#61ff9f"), stroke: none) + + content("kanal1", [n+], anchor: "center", padding: 0.2) + content("kanal2", [n+], anchor: "center", padding: 0.2) + + rect((0.5, -1), (1, -0.70), fill: gray, stroke: none, name: "metal") + content("metal", [metal], anchor: "west", padding: 0.3) + + rect((0.5, -1.2), (1, -1.5), fill: rgb("#61ff9f"), stroke: none, name: "n") + content("n", [n+], anchor: "west", padding: 0.3) + + rect( + (2.5, -1), + (3, -0.7), + fill: rgb("#ffb1b1"), + stroke: none, + name: "p-substrate", + ) + content("p-substrate", [p], anchor: "west", padding: 0.3) + + rect((2.5, -1.2), (3, -1.5), fill: rgb("#fffc61"), stroke: none, name: "siO2") + content("siO2", [oxide], anchor: "west", padding: 0.3) +})