From 83a024e72edaf1008fdc4d724eba3ea0c00c6059 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Thu, 10 Mar 2022 17:54:08 +0100 Subject: [PATCH] feat: add some electricity --- .obsidian/app.json | 3 + .obsidian/appearance.json | 3 + .obsidian/community-plugins.json | 1 + .obsidian/core-plugins.json | 15 + .obsidian/hotkeys.json | 1 + .../obsidian-latex-environments/main.js | 525 ++++++++++++++++++ .../obsidian-latex-environments/manifest.json | 10 + .../obsidian-latex-environments/styles.css | 1 + .obsidian/workspace | 112 ++++ Areas/electricity/basics.md | 69 ++- .../current-voltage-characteristic.svg | 1 + Areas/electricity/diode-voltage-graph.svg | 65 +++ Areas/electricity/glossary.md | 32 ++ Areas/electricity/led.md.md | 11 + .../voltage-divider-load-example-2.svg | 1 + .../voltage-divider-load-example.svg | 1 + Areas/electricity/voltage-divider-load.svg | 1 + Areas/electricity/voltage-divider.svg | 1 + Areas/electricity/voltage-dividers.md | 66 +++ Areas/films/index.md | 5 + 20 files changed, 914 insertions(+), 10 deletions(-) create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/community-plugins.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/hotkeys.json create mode 100644 .obsidian/plugins/obsidian-latex-environments/main.js create mode 100644 .obsidian/plugins/obsidian-latex-environments/manifest.json create mode 100644 .obsidian/plugins/obsidian-latex-environments/styles.css create mode 100644 .obsidian/workspace create mode 100644 Areas/electricity/current-voltage-characteristic.svg create mode 100644 Areas/electricity/diode-voltage-graph.svg create mode 100644 Areas/electricity/glossary.md create mode 100644 Areas/electricity/led.md.md create mode 100644 Areas/electricity/voltage-divider-load-example-2.svg create mode 100644 Areas/electricity/voltage-divider-load-example.svg create mode 100644 Areas/electricity/voltage-divider-load.svg create mode 100644 Areas/electricity/voltage-divider.svg create mode 100644 Areas/electricity/voltage-dividers.md create mode 100644 Areas/films/index.md diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..8362611 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,3 @@ +{ + "legacyEditor": false +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..990f337 --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "baseFontSize": 16 +} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..ab1d511 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,15 @@ +[ + "file-explorer", + "global-search", + "switcher", + "graph", + "backlink", + "page-preview", + "note-composer", + "command-palette", + "editor-status", + "markdown-importer", + "word-count", + "open-with-default-app", + "file-recovery" +] \ No newline at end of file diff --git a/.obsidian/hotkeys.json b/.obsidian/hotkeys.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/hotkeys.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-latex-environments/main.js b/.obsidian/plugins/obsidian-latex-environments/main.js new file mode 100644 index 0000000..e4a522a --- /dev/null +++ b/.obsidian/plugins/obsidian-latex-environments/main.js @@ -0,0 +1,525 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/main.ts +__export(exports, { + default: () => LatexEnvironments +}); +var import_obsidian3 = __toModule(require("obsidian")); + +// src/settings.ts +var LatexEnvironmentsSettings = class { + constructor() { + this.defaultEnvironment = "multline"; + this.customEnvironments = []; + } +}; +function ensureSettings(loaded) { + var _a, _b; + const settings = new LatexEnvironmentsSettings(); + settings.defaultEnvironment = (_a = loaded.defaultEnvironment) != null ? _a : settings.defaultEnvironment; + settings.customEnvironments = (_b = loaded.customEnvironments) != null ? _b : settings.customEnvironments; + return settings; +} + +// src/search.ts +var SearchCursor = class { + constructor(text, regex, _originalCaret) { + this.text = text; + this._originalCaret = _originalCaret; + if (regex instanceof RegExp) { + this.regex = regex; + } else { + this.regex = new RegExp(regex); + } + this.reset(); + } + reset() { + this._from = this._originalCaret; + this._to = this._originalCaret; + this._caret = this._originalCaret; + } + findNext() { + const text = this.text.slice(this._caret); + const match = text.match(this.regex); + if ((match == null ? void 0 : match.index) == null) { + return void 0; + } + this._from = this._caret + match.index; + this._to = this._caret + match.index + match[0].length; + this._caret = this._to; + return match; + } + findPrevious() { + const reverseRegex = new RegExp(`(?${this.regex.source})(?!.*[\\r\\n]*.*\\k)`, this.regex.flags); + const text = this.text.slice(0, this._caret); + const lastMatch = text.match(reverseRegex); + if ((lastMatch == null ? void 0 : lastMatch.index) == null || (lastMatch == null ? void 0 : lastMatch.groups) == null) { + return void 0; + } + this._from = lastMatch.index; + this._to = lastMatch.index + lastMatch.groups.full.length; + this._caret = this._from; + return lastMatch; + } + to() { + return this._to; + } + from() { + return this._from; + } +}; + +// src/mathblock.ts +var MathBlock = class { + constructor(text, cursor) { + this.text = text; + const searchCursor = new SearchCursor(text, "\\$\\$", cursor); + this.startPosition = searchCursor.findPrevious() != null ? searchCursor.to() : 0; + searchCursor.reset(); + this.endPosition = searchCursor.findNext() != null ? searchCursor.from() : text.length; + } + getEnclosingEnvironment(cursor) { + const beginEnds = new BeginEnds(this.text, this.startPosition, this.endPosition); + const environments = Array.from(beginEnds); + if (beginEnds.isOpen) { + throw new Error("unclosed environments in block"); + } + const start = environments.filter((env) => env.type === "begin" && env.from < cursor).pop(); + if (start === void 0) { + return void 0; + } + const after = environments.filter((env) => env.from > start.to); + let open = 1; + let end; + for (const env of after) { + if (env.type === "begin") { + open++; + } else { + open--; + if (open === 0) { + end = env; + break; + } + } + } + if (end === void 0) { + throw new Error("current environment is never closed"); + } + if (end.to < cursor) { + return void 0; + } + return { + name: start.name, + begin: start, + end, + contents: this.text.slice(start.to, end.from) + }; + } + static isMathMode(_cursor, _editor) { + return true; + } +}; +var BeginEnds = class { + constructor(text, start, end) { + this.text = text; + this.start = start; + this.end = end; + this.openEnvs = []; + this.search = this.getEnvCursor(this.start); + } + reset() { + this.search = this.getEnvCursor(this.start); + } + getEnvCursor(start) { + return new SearchCursor(this.text, /\\(?begin|end){\s*(?[^}]+)\s*}/m, start); + } + get isOpen() { + return this.openEnvs.length > 0; + } + [Symbol.iterator]() { + this.reset(); + return this; + } + next() { + const match = this.search.findNext(); + const to = this.search.to(); + if ((match == null ? void 0 : match.groups) == null || to > this.end) { + return { done: true, value: null }; + } + switch (match.groups.beginEnd) { + case "begin": { + const current = { + name: match.groups.name, + type: "begin", + from: this.search.from(), + to: this.search.to() + }; + this.openEnvs.push(current); + return { + done: false, + value: current + }; + } + case "end": { + const current = this.openEnvs.pop(); + if (current === void 0) { + throw new Error("closing environment which was never opened"); + } + if (current.name !== match.groups.name) { + throw new Error("environment not closed properly"); + } + return { + done: false, + value: { + name: match.groups.name, + type: "end", + from: this.search.from(), + to: this.search.to() + } + }; + } + } + throw new Error(`regex returned unexpected result ${match[1]}`); + } +}; + +// src/envmodal.ts +var import_obsidian = __toModule(require("obsidian")); + +// src/environmentNames.ts +var DISPLAY_EQUATIONS = [ + "equation", + "equation*", + "gather", + "gather*", + "multline", + "multline*", + "split", + "align", + "align*", + "flalign", + "flalign*", + "alignat", + "alignat*" +]; +var MATRICES = [ + "matrix", + "pmatrix", + "bmatrix", + "Bmatrix", + "vmatrix", + "Vmatrix", + "smallmatrix" +]; +var SUB_ENVIRONMENTS = ["multlined", "gathered", "aligned", "cases"]; +var DEFAULT_ENVIRONMENTS = [ + ...DISPLAY_EQUATIONS, + ...MATRICES, + ...SUB_ENVIRONMENTS +]; + +// src/envmodal.ts +var EnvModal = class extends import_obsidian.FuzzySuggestModal { + constructor(app, settings, name, callback) { + super(app); + this.settings = settings; + this.name = name; + this.callback = callback; + this.matched = false; + this.setInstructions([ + { command: "\u2191\u2193", purpose: "to navigate" }, + { command: "\u21B5", purpose: "to select" }, + { command: "esc", purpose: "to dismiss" } + ]); + this.setPlaceholder("environment name"); + } + getItems() { + return Array.from(new Set([this.settings.defaultEnvironment].concat(this.settings.customEnvironments, DEFAULT_ENVIRONMENTS))); + } + getItemText(item) { + this.matched = true; + return item; + } + onNoSuggestion() { + this.matched = false; + } + onChooseItem(item, _evt) { + if (this.matched) { + this.callback(item); + } else { + this.callback(this.inputEl.value); + } + } + static callback(app, settings, defaultName, call) { + new EnvModal(app, settings, defaultName, call).open(); + } +}; + +// src/latexEnvironmentsSettingsTab.ts +var import_obsidian2 = __toModule(require("obsidian")); +var LatexEnvironmentsSettingTab = class extends import_obsidian2.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl("h2", { text: "Settings for latex environments" }); + new import_obsidian2.Setting(containerEl).setName("Default environment").setDesc("The default environment to insert").addText((text) => text.setPlaceholder("environment").setValue(this.plugin.settings.defaultEnvironment).onChange((value) => __async(this, null, function* () { + this.plugin.settings.defaultEnvironment = value; + yield this.plugin.saveData(this.plugin.settings); + }))); + new import_obsidian2.Setting(containerEl).setName("Extra environments").setDesc("Environment names to be suggested for completion (one per line)").addTextArea((area) => { + area.setValue(this.plugin.settings.customEnvironments.join("\n")).onChange((value) => __async(this, null, function* () { + this.plugin.settings.customEnvironments = value.split("\n").map((x) => x.trim()).filter((x) => x.length > 0); + yield this.plugin.saveData(this.plugin.settings); + })); + }); + } +}; + +// src/actions/action.ts +var Action = class { + constructor(doc) { + this.doc = doc; + } + suggestName() { + return void 0; + } + get needsName() { + return true; + } +}; + +// src/environment.ts +function newEnvironment(name, cursor, contents = "") { + const pad = getPad(contents); + return { + replaceSelection: `\\begin{${name}}${pad}${contents}${pad}\\end{${name}}`, + selection: { + from: { + ch: 0, + line: cursor.line + 1 + } + } + }; +} +function unwrapEnvironment(environment, doc) { + return { + changes: [ + { + text: trim(environment.contents), + from: doc.offsetToPos(environment.begin.from), + to: doc.offsetToPos(environment.end.to) + } + ], + selection: { from: doc.getCursor() } + }; +} +function changeEnvironment(environment, doc, name) { + const change = { + text: `\\begin{${name}}${environment.contents}\\end{${name}}`, + from: doc.offsetToPos(environment.begin.from), + to: doc.offsetToPos(environment.end.to) + }; + return { + changes: [change], + selection: { from: doc.getCursor() } + }; +} +function getPad(text) { + if (text.length > 0 && text.match(/^[ \t]*$/) != null) { + return ""; + } + return "\n"; +} +function trim(text) { + if (text.length === 0) + return text; + const start = text.startsWith("\n") ? 1 : 0; + const end = text.endsWith("\n") ? text.length - 1 : text.length; + return text.slice(start, end); +} + +// src/actions/wrapAction.ts +var WrapAction = class extends Action { + constructor(doc, addWhitespace = true) { + super(doc); + this.addWhitespace = addWhitespace; + } + prepare() { + return this; + } + transaction(envName) { + return newEnvironment(envName, this.doc.getCursor(), this.doc.getSelection()); + } +}; + +// src/actions/insertAction.ts +var InsertAction = class extends Action { + prepare() { + if (this.doc.somethingSelected()) { + return new WrapAction(this.doc).prepare(); + } + return this; + } + transaction(envName) { + return newEnvironment(envName, this.doc.getCursor()); + } +}; + +// src/actions/changeAction.ts +var ChangeAction = class extends Action { + suggestName() { + return this.name; + } + prepare() { + const cursor = this.doc.posToOffset(this.doc.getCursor()); + const block = new MathBlock(this.doc.getValue(), cursor); + this.current = block.getEnclosingEnvironment(cursor); + if (this.current === void 0) { + return new WrapAction(this.doc, block.startPosition === block.endPosition); + } + this.name = this.current.name; + return this; + } + transaction(envName) { + if (this.current !== void 0) { + return changeEnvironment(this.current, this.doc, envName); + } + return {}; + } +}; + +// src/actions/deleteAction.ts +var DeleteAction = class extends Action { + get needsName() { + return false; + } + prepare() { + const cursor = this.doc.getCursor(); + const block = new MathBlock(this.doc.getValue(), this.doc.posToOffset(cursor)); + this.current = block.getEnclosingEnvironment(this.doc.posToOffset(cursor)); + return this; + } + transaction(_envName) { + if (this.current !== void 0) { + return unwrapEnvironment(this.current, this.doc); + } + return {}; + } +}; + +// src/main.ts +var LatexEnvironments = class extends import_obsidian3.Plugin { + constructor() { + super(...arguments); + this.settings = new LatexEnvironmentsSettings(); + } + onload() { + return __async(this, null, function* () { + const settings = yield this.loadData(); + if (settings !== null) { + this.settings = ensureSettings(settings); + } + this.addCommand({ + id: "insert-latex-env", + name: "Insert LaTeX environment", + checkCallback: this.mathModeCallback(InsertAction) + }); + this.addCommand({ + id: "change-latex-env", + name: "Change LaTeX environment", + checkCallback: this.mathModeCallback(ChangeAction) + }); + this.addCommand({ + id: "delete-latex-env", + name: "Delete LaTeX environment", + checkCallback: this.mathModeCallback(DeleteAction) + }); + this.addSettingTab(new LatexEnvironmentsSettingTab(this.app, this)); + }); + } + mathModeCallback(ActionType) { + return (checking) => { + const leaf = this.app.workspace.activeLeaf; + if (leaf.view instanceof import_obsidian3.MarkdownView) { + const editor = leaf.view.editor; + const cursor = editor.posToOffset(editor.getCursor()); + if (!MathBlock.isMathMode(cursor, editor)) { + return false; + } + if (!checking) { + try { + const action = new ActionType(editor.getDoc()).prepare(); + this.withPromptName(editor, action); + } catch (e) { + new import_obsidian3.Notice(e.message); + } + } + return true; + } + return false; + }; + } + withPromptName(editor, action) { + const call = (envName) => { + editor.transaction(action.transaction(envName)); + editor.focus(); + }; + if (action.needsName) { + const suggested = action.suggestName(); + EnvModal.callback(this.app, this.settings, suggested !== void 0 ? suggested : this.settings.defaultEnvironment, call); + } else { + call("*"); + } + } +}; diff --git a/.obsidian/plugins/obsidian-latex-environments/manifest.json b/.obsidian/plugins/obsidian-latex-environments/manifest.json new file mode 100644 index 0000000..02074b5 --- /dev/null +++ b/.obsidian/plugins/obsidian-latex-environments/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-latex-environments", + "name": "Latex Environments", + "version": "0.3.0", + "description": "Allows to quickly insert and change latex environments within math environments.", + "author": "Zach Raines", + "authorUrl": "https://github.com/raineszm/obsidian-latex-environments", + "minAppVersion": "0.11.11", + "isDesktopOnly": false +} diff --git a/.obsidian/plugins/obsidian-latex-environments/styles.css b/.obsidian/plugins/obsidian-latex-environments/styles.css new file mode 100644 index 0000000..8537307 --- /dev/null +++ b/.obsidian/plugins/obsidian-latex-environments/styles.css @@ -0,0 +1 @@ +Not Found \ No newline at end of file diff --git a/.obsidian/workspace b/.obsidian/workspace new file mode 100644 index 0000000..9e46aeb --- /dev/null +++ b/.obsidian/workspace @@ -0,0 +1,112 @@ +{ + "main": { + "id": "b5edcffa82772ae7", + "type": "split", + "children": [ + { + "id": "bc097db78015bcba", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Areas/electricity/led.md.md", + "mode": "source", + "source": false + } + } + }, + { + "id": "cabeee83977cea84", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Areas/electricity/led.md.md", + "mode": "preview", + "source": false + } + } + } + ], + "direction": "vertical" + }, + "left": { + "id": "960bd0ae12708602", + "type": "split", + "children": [ + { + "id": "240323277b6ea277", + "type": "tabs", + "children": [ + { + "id": "018891641805eabd", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": {} + } + }, + { + "id": "180e37f00da590d0", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "c57c7700d46038dd", + "type": "split", + "children": [ + { + "id": "aa758b15486a27c3", + "type": "tabs", + "children": [ + { + "id": "a47b8cf2ccebc103", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Areas/electricity/led.md.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "active": "bc097db78015bcba", + "lastOpenFiles": [ + "Areas/electricity/led.md.md", + "Areas/electricity/glossary.md", + "Untitled 1.md", + "Areas/electricity/basics.md", + "Areas/electricity/voltage-dividers.md", + "Areas/electricity/index.md", + "Areas/electricity/voltage-divider.svg" + ] +} \ No newline at end of file diff --git a/Areas/electricity/basics.md b/Areas/electricity/basics.md index a35876e..11ecdf9 100644 --- a/Areas/electricity/basics.md +++ b/Areas/electricity/basics.md @@ -10,7 +10,12 @@ Electrons can escape the atom and bind to a new Atom. Copper is used in wires because it has 29 Electrons, with one in the outer (Valence) Shell. This Atom can easily escape and switch places. -Normally an atom has the same amount of protons and electrons, when this is not the case the atoms has a charge. + +## Ohms Law + +V = I * R; + +I = V / R; ## Voltage is like the pressure in Cable, it forces the Electrons to move. @@ -23,19 +28,63 @@ When the current is to high, the cable breaks ## Circuit A electric circuit is a closed loop through which electrons flow. -Normally in a copper wire the atoms randomly exchange electrons. +## How to find resistance of resistors in series? +Just add them up -When there is a force applied to some side, the electrons move in a specific way +## How to find the resistance of resistors in parallel? -## Voltage is how much these electrons want to move -## Resistance is how hard it is for them to move -## Current is how many electrons are moving in a specified time +When each of the resistors provides a new way to reach ground, then + +1/R = 1/R1 + 1/R2 + 1/R3; + +**Example:** + +R1 = 4 Ohm +R2 = 5 Ohm +R3 = 20 Ohm + +1/R = 1/4 + 1/5 + 1/20; +1/R = 0.5 | * R; +1 = 0.5R | * 2; +2 = R; + +10 Ohm +23 Ohm +17 Ohm + +1/R = 0.20230179 | * R +1 = 0.20230179R | / 0.20230179 +4.94 = R; + +## Test + +Input: 50v +Current: 2A +Resistors: 19Ohm + +Ohms Law = V = I*R; +50 = 2*(19+R); +50 = 38+2R | - 38; +12 = 2R; +6 = R; + +R = V / I; + +Ohms law only works for D/C and NOT A/C; + +5V in + +1/R = 1/100+1/1000; +1/R = 0.011; +1 = 0.011R; +90.90909 = R; + +I = V / R; +I = 5 / 90.909090 +I = 0.055; +I = 5.5mA -## Ohms Law -Voltage = Current * Resistance -Resistance = Voltage / Current -Current = Voltage / Resistance ## Watts ## Volts diff --git a/Areas/electricity/current-voltage-characteristic.svg b/Areas/electricity/current-voltage-characteristic.svg new file mode 100644 index 0000000..8bc5cf5 --- /dev/null +++ b/Areas/electricity/current-voltage-characteristic.svg @@ -0,0 +1 @@ +current–voltage-characteristic (universaldenker.org) diff --git a/Areas/electricity/diode-voltage-graph.svg b/Areas/electricity/diode-voltage-graph.svg new file mode 100644 index 0000000..bdc7da6 --- /dev/null +++ b/Areas/electricity/diode-voltage-graph.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + 10 + + + 1 + + + 2 + + + 3 + + + 4 + + + Forward voltage (V) + + + Infrared + + + Red + + + Orange + + + Blue + + + Cathode current (mA) + + + 30 + + + 40 + + + 50 + + + 20 + + + diff --git a/Areas/electricity/glossary.md b/Areas/electricity/glossary.md new file mode 100644 index 0000000..1edeeca --- /dev/null +++ b/Areas/electricity/glossary.md @@ -0,0 +1,32 @@ +# Glossary + +## Volts +Voltage + +## Amperes +Current + +## Ohms +Resistance + +## Ohms Law +$$ +V = \frac{I}{R} +$$ + +## Impedance +## Polarity +Means if a component is symmetric or not +Polarised means that a component is not symmetric + +## Voltage Divider +## LED + +Anode - The shorter Leg +Cathode - The longer Leg + +## Diode +## Anode +The positive end of a diode +## Cathode +The negative end of a diode \ No newline at end of file diff --git a/Areas/electricity/led.md.md b/Areas/electricity/led.md.md new file mode 100644 index 0000000..51dbf93 --- /dev/null +++ b/Areas/electricity/led.md.md @@ -0,0 +1,11 @@ +# Led + +Leds have polarity, that means they only allow current to flow in one direction. That means LED's are diodes. + +While in resistors the relations of voltage to current is linear: + +![](./current-voltage-characteristic.svg) + +that is not the case for leds + +![](./diode-voltage-graph.svg) \ No newline at end of file diff --git a/Areas/electricity/voltage-divider-load-example-2.svg b/Areas/electricity/voltage-divider-load-example-2.svg new file mode 100644 index 0000000..c8d5676 --- /dev/null +++ b/Areas/electricity/voltage-divider-load-example-2.svg @@ -0,0 +1 @@ +10060ReR1V5 \ No newline at end of file diff --git a/Areas/electricity/voltage-divider-load-example.svg b/Areas/electricity/voltage-divider-load-example.svg new file mode 100644 index 0000000..cbb2158 --- /dev/null +++ b/Areas/electricity/voltage-divider-load-example.svg @@ -0,0 +1 @@ +100100150R1R2RL5V \ No newline at end of file diff --git a/Areas/electricity/voltage-divider-load.svg b/Areas/electricity/voltage-divider-load.svg new file mode 100644 index 0000000..f1de015 --- /dev/null +++ b/Areas/electricity/voltage-divider-load.svg @@ -0,0 +1 @@ +3.3mA3.3mA1k1k1kR1R2RL1.7V5V \ No newline at end of file diff --git a/Areas/electricity/voltage-divider.svg b/Areas/electricity/voltage-divider.svg new file mode 100644 index 0000000..f71d899 --- /dev/null +++ b/Areas/electricity/voltage-divider.svg @@ -0,0 +1 @@ +2.5mA2.5mA1k1k2.5 V \ No newline at end of file diff --git a/Areas/electricity/voltage-dividers.md b/Areas/electricity/voltage-dividers.md new file mode 100644 index 0000000..85d6f89 --- /dev/null +++ b/Areas/electricity/voltage-dividers.md @@ -0,0 +1,66 @@ +# Voltage Divider + +## Simple Voltage Divider + +This is sort of unrealistic because there is no current flowing out of the voltage divider on the right side: + +![Voltage Divider](./voltage-divider.svg) + +#### Equation + +$$ +\begin{flalign} +Vout & =\text{Vin }x*(\frac{R2}{R1+R2})&\\ +\end{flalign} +$$ + +## Voltage Divider with Load + +When the output of the voltage divider is connected to something the current drops on the output, as that something uses some of it. + +![Voltage Divider](./voltage-divider-load.svg) + +The load is connected in parallel to R2, so we can calculate it as a parallel resistor. + +The new Equation: + +$$ +\begin{flalign} +Vout & =\text{Vin }x*(\frac{R2 || RL}{R1+R2 || RL})&\\ +\end{flalign} +$$ + +### Example + +Lets calculate the current in this circuit: + +![Voltage Divider Load Example](./voltage-divider-load-example.svg) + +1. We calculate the Resistance in the subcircuit (R2 and RL) as they are connected in parallel which means + +$$ +\begin{align} +\frac{1}{Re}&=\frac{1}{R2}+\frac{1}{RL} &\textit{Replace Variables}\\ +\frac{1}{Re}&=\frac{1}{100}+\frac{1}{150} &\textit{Add Fractions}\\ +\frac{1}{Re}&=\frac{1}{60} &\textit{* Re}\\ +1&=\frac{Re}{60} &\textit{* 60}\\ +60&=Re \\ +\end{align} +$$ + +The simplified circuit now looks like this; + +![Voltage Divider Load Example](./voltage-divider-load-example-2.svg) + +Now we can easily calculate the Resistance in the circuit + +With the resistance we can now calculate the current inside the load circuit by using the simple voltage divider equation: + +$$ +\begin{flalign} +Vout &=\text{Vin }x*(\frac{Re}{R1+Re})&\\ +Vout &=5*(\frac{60}{100+60})&\\ +Vout &=5*(\frac{60}{100+60})&\\ +Vout &=1.875v +\end{flalign} +$$ \ No newline at end of file diff --git a/Areas/films/index.md b/Areas/films/index.md new file mode 100644 index 0000000..7c8c330 --- /dev/null +++ b/Areas/films/index.md @@ -0,0 +1,5 @@ +# Movies + +To Watch: + +https://en.wikipedia.org/wiki/Roma_(2018_film)