Compare commits

...

23 Commits

Author SHA1 Message Date
Mars Ultor
b3354522b2 fixed main
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
2025-10-14 14:49:17 -05:00
Mars Ultor
c4e9ae358c final stuff 2025-05-20 23:13:19 -05:00
Mars Ultor
7f66b01d1d stuff circuits blah 2025-02-24 22:40:48 -06:00
Mars Ultor
5cc34003d9 hahah
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
2025-02-17 18:19:24 -06:00
Mars Ultor
589713ffd6 harmonics
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
2025-02-15 15:32:16 -06:00
Mars Ultor
b573aa6758 double slit final equations
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
2025-01-30 00:50:44 -06:00
Mars Ultor
be8aa993d3 double slit
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-30 00:38:52 -06:00
Mars Ultor
f44e1447ba broski 2025-01-28 22:19:10 -06:00
Mars Ultor
8b3a33a8cc deai-2
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-28 21:02:53 -06:00
Mars Ultor
6ead178ee5 deai
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-28 21:02:08 -06:00
Mars Ultor
86e62426ae megelomart
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-28 20:56:11 -06:00
Mars Ultor
f3834ca40d i'm going to fail this test
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-28 20:29:39 -06:00
Mars Ultor
4744fd878c starting oscilliations
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
2025-01-09 20:54:49 -06:00
Krishna
68125f4a15 first chapter of the book
Some checks are pending
Build and Test / build-and-test (macos-latest) (push) Waiting to run
Build and Test / build-and-test (ubuntu-latest) (push) Waiting to run
Build and Test / build-and-test (windows-latest) (push) Waiting to run
Build and Test / publish-tag (push) Waiting to run
2025-01-04 22:56:59 -06:00
Krishna
b4201be474 one entry 2024-12-24 16:11:29 -06:00
Krishna
6e1407b875 i'll sign the next one alr? 2024-11-19 20:23:53 -06:00
Krishna
ea16014711 something 2024-11-18 00:34:51 -06:00
Krishna
26cbd03bfc somehow works fsdofhlsdfa 2024-11-17 17:37:11 -06:00
Krishna
6f8841a542 bruh 2024-11-17 17:35:58 -06:00
Krishna
18d37cadc0 a bunch fo phys 2024-11-17 17:35:10 -06:00
Krishna
1967866480 quick fix on the closing of $ 2024-11-17 17:20:04 -06:00
Krishna
a6ba656aff thermo stuff 2024-11-17 17:18:58 -06:00
Krishna
963b623778 wiener law 2024-11-17 13:49:50 -06:00
11 changed files with 1205 additions and 5 deletions

View File

@@ -3,7 +3,3 @@ title: Welcome to the Warehouse
---
Welcome to the warehouse of the Thoughts of 0x6d617273756c746f72, Prime of the Faith, ranked Hacker on HTB, and the founder of a bunch of defunct projects on github. Average internet nerd/sysadmin/programmer. Move on, to either his cursed musings or with your day.
# Socials
- Matrix: [@lanre:envs.net](https://matrix.to/#/@lanre:envs.net)
- Bluesky: [krishna.ayyalasomayajula.net](https://bsky.app/profile/krishna.ayyalasomayajula.net)

View File

@@ -0,0 +1,16 @@
---
title: A Chess Engine to Defeat my Brother's
date: 2025-01-05
---
# Reason
If you're looking, this is the real pure CS thing on here so far. There should be more to follow. I'm doing this due to a combination of reasons. For one, a kid at school trash talked my skills by saying he could best any chess engine of my making. My brother also decided to make one, in hopes of proving his nonexistent supremacy.
# Logic
Not wanting to partake in this alpha-beta pruning nonsense, I'm going to take a specified depth, generate all boards until that depth, and then use my NVIDIA GPU to evaluate all the positions, and choose the best branch. Since no library or tool is off limits, I'm not going to hold back.
- GPU kernels: Rust-CUDA
- Chess Evaluation function: I'll start with material for now.

View File

@@ -0,0 +1,151 @@
---
title: Light Weight Video Streaming Server
date: 2024-12-24
---
> [!NOTE]
> This is another installation in my *magnum opus*, "Random-Things-I-Make-for-Absolutely-no-Reason".
# The Problem
I've picked up watching portions of shows and dropping them on a whim, but generally don't want to stream them thanks to the network load caused by my other projects[^1]. This requires downloading and hosting the files myself, perfectly feasible given my resources.
Hosting these files over the internet, however, would not be feasible due to the low outgoing upload speeds provided by my godforsaken ISP. The client, in cases would just be my phone or laptop. I will acknowledge, though, that options like Plex, Jellyfin, and others exist to manage almost the same requirements.
The sole reason I've chosen not to go with these is the resource overhead demanded. I spun up an instance of Jellyfin to prove this point. At idle, $\ge0.5$ GB of memory was used alongside a not insignificant CPU/GPU allocation.
Looking further into the processes involved, I found that servers like Jellyfin and Plex use the HSL video streaming paradigm, requiring server-side segmentation, encoding/decoding, and scaling. In my situation, bandwidth was an unlimited resource, so the overhead was unnecessary.
# The Solution
I really just had to write a script to present all the videos on a webserver in a drop-down list with a decent video player. Although there is nothing I hate more in the world than a Python network application, I'm too lazy to do anything else.
Flask python API/`html` proxy (`server.py`):
```python
from flask import Flask, jsonify, send_from_directory, render_template
import os
app = Flask(__name__)
# Get the current working directory (where the Python script is run from)
video_dir = os.getcwd() # Ensure this is where your .mp4 files and index.html are located
@app.route('/')
def serve_index():
"""Serve the index.html file."""
return send_from_directory(video_dir, 'index.html')
@app.route('/videos')
def list_videos():
"""Return a list of .mp4 files in the directory."""
files = [f for f in os.listdir(video_dir) if f.endswith('.mp4')]
return jsonify(files)
@app.route('/videos/<filename>')
def serve_file(filename):
"""Serve video files to the browser from the videos directory."""
return send_from_directory(video_dir, filename)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)
```
And the `html` front-end (`index.html`):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4K Video Player</title>
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f4f4f9;
}
h1 {
text-align: center;
}
select {
width: 100%;
padding: 10px;
margin-bottom: 20px;
}
.video-container {
max-width: 100%;
margin: 0 auto;
}
</style>
</head>
<body>
<h1>4K Video Player</h1>
<select id="videoList" onchange="loadVideo(this.value)">
<option value="">Select a video</option>
</select>
<div class="video-container">
<video id="player" class="video-js vjs-default-skin" controls>
<source id="videoSource" src="" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script>
var player = videojs('player', {
controls: true,
autoplay: false,
preload: 'auto',
width: '100%',
height: 'auto',
poster: 'path/to/your/poster-image.jpg', // Optional: add a thumbnail image for video preview
fluid: true, // Ensures responsive video sizing
playbackRates: [0.5, 1, 1.5, 2], // Allow the user to control playback speed
controlBar: {
playToggle: true,
volumePanel: { inline: false }, // Displays volume control as a separate panel
currentTimeDisplay: true,
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: true,
fullscreenToggle: true
},
sources: [{
type: 'video/mp4',
src: ''
}]
});
// Populate video dropdown list
const videoList = document.getElementById('videoList');
fetch('/videos')
.then(response => response.json())
.then(files => {
files.forEach(file => {
const option = document.createElement('option');
option.value = file;
option.textContent = file;
videoList.appendChild(option);
});
});
// Load the selected video into the player
function loadVideo(src) {
if (!src) return; // If no video selected, do nothing
const videoSource = document.getElementById('videoSource');
videoSource.src = '/videos/' + src.replace('.mkv', '.mp4'); // Set video source path
player.src({ type: 'video/mp4', src: '/videos/' + src.replace('.mkv', '.mp4') });
player.play(); // Start playback automatically after video is loaded
}
</script>
</body>
</html>
```
Resulting in:
![](maker-portfolio-1.png)
[^1]: I will write these up here at some point.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -0,0 +1,192 @@
---
title: Crazy Mix of Everything You Could Dread
date: 2025-02-15
---
# Electric Charge and Electric Field
## Laws?
1. *Law of Conservation of Electric Charge*: **the net amount of electric charge produced in any process is zero**.
2. I forgot
## Insulators and Conductors
This image should sum things up nicely.
![](swappy-20250215-165128.png)
## Coulomb's Law
$$
||\vec{F}||=k\frac{Q_1 Q_2}{r^2}
$$
$k$ is a random constant written in terms of a more definite constant such that:
$$
F=\frac{1}{r\pi\epsilon_0}\frac{Q_1 Q_2}{r_2}
$$
where
$$
\epsilon_0=\frac{1}{4\pi k}=8.85\times 10^{-12}\;\text{ C}^2/\mathrm{N}*\mathrm{m}^2
$$
It's important to consider here, that $r$ is the magnitude of distance, and $F$ always represents the magnitude of the force. Oppositely signed charges attract, and same-signed charges repel with the force computed by the formula.
# The Electric Field
$$
\vec{E}=\frac{\vec{F}}{q}
$$
- $q$ is the magnitude of the charge
- The electric field only reflects the *direction* of the magnetic field, not the intensity.
- The electric field $\vec{E}$ represents the force per unit charge, so really:
$$
\vec{E}=\lim_{q\to 0}{\vec{F}/q}
$$
The electric field has the units Newtons per Coulomb: N/C. The magnitude of the electric field vector $\vec{E}$, can be calculated as $E$:
$$
E=\frac{F}{q}=\frac{kqQ/r^2}{q} = k\frac{Q}{r^2}
$$
Notice that the vector field $\vec{E}$ is independent of the test charge $q$, only dependent on the parent charge $Q$ that produces the field. $\therefore$, the force experienced by a particle at a given position $r$ can be expressed by:
$$
\vec{F}=q\vec{E}
$$
If there are more than one parent charge $Q$, the experienced electric vector field is simply:
$$
\vec{E}=\vec{E_1}+\vec{E_2}+\vec{E_n}
$$
# Electric Potential Energy and Potential Difference
A fundamental law of physics is that $\Delta \textbf{PE} =-W$, while the change in kinetic energy is oppositely signed. The potential difference between any two points is $\textbf{PE}_b-\textbf{PE}_a$, while work is expressed like so:
$$
W=\int{F\mathrm{d}r}
$$
> [!NOTE]
> $r$ and $x$ are used interchangeably for displacement. $r$ is more commonly seen in multi-dimensional reference frames.
$\therefore$ the work done by electric field $\vec{E}$ is:
$$
W=Fd=-qEd
$$
$$\Delta \textbf{PE}=-qEd
$$
This is only true if the electric field is uniform. In reality, it never is.
## Potential Difference
**Electric Potential** is understood as the electric potential energy per unit charge. This variable is given the symbol $V$. At some displacement $a$ from the parent charge $Q$:
$$
V_a=\frac{\textbf{PE}_a}{q}
$$
Two balls at the same height are not meaningfully different in position, therefore only *potential difference* matters physically. In this case, between two points, $a$ and $b$. When the electric force does positive work on a charge, the kinetic energy increases in tandem with a decrease of that potential difference. Keeping in line with the rules laid out above:
$$
V_{ba}=V_b-V_a=\frac{\Delta \textbf{PE}_{ba}}{q}=\frac{-W_{ba}}{q}
$$
Just as the potential energy of a raised ball does not depend on the gravitational field of the ball, the electric potential of the test charge $q$ doesn't depend on the magnitude of the charge itself. This quantity is given the unit **Volt**, or $1\text{ V}=1\;\text{J}/\mathrm{C}$
# Circuits
### Ohms Law:
$$
V = IR
$$
- Voltage $V$ = Current $I$ × Resistance $R$
### Power in Circuits:
$$
P = IV
$$
- Power $P$ = Current $I$ × Voltage $V$
$$
P = I^2R
$$
- Power $P$ = Current squared $I^2$ × Resistance $R$
$$
P = \frac{V^2}{R}
$$
- Power $P$ = Voltage squared $V^2$ / Resistance $R$
### Series Circuits:
$$
R_{\text{total}} = R_1 + R_2 + \dots + R_n
$$
- Total Resistance $R_{\text{total}}$ = Sum of Individual Resistances
$$
V_{\text{total}} = V_1 + V_2 + \dots + V_n
$$
- Total Voltage $V_{\text{total}}$ = Sum of Individual Voltages
$$
I_{\text{total}} = I_1 = I_2 = \dots = I_n
$$
- Current $I_{\text{total}}$ is the same across all components
### Parallel Circuits:
$$
\frac{1}{R_{\text{total}}} = \frac{1}{R_1} + \frac{1}{R_2} + \dots + \frac{1}{R_n}
$$
- Total Resistance $R_{\text{total}}$ = Reciprocal Sum of Individual Resistances
$$
V_{\text{total}} = V_1 = V_2 = \dots = V_n
$$
- Voltage $V_{\text{total}}$ is the same across all components
$$
I_{\text{total}} = I_1 + I_2 + \dots + I_n
$$
- Total Current $I_{\text{total}}$ is the sum of individual currents
### Capacitance:
$$
Q = CV
$$
- Charge $Q$ = Capacitance $C$ × Voltage $V$
$$
C = \frac{\epsilon_0 A}{d}
$$
- Capacitance $C$ of a parallel plate capacitor: $\epsilon_0$ = permittivity of free space, $A$ = area of plates, $d$ = distance between plates
### Inductance:
$$
V = L \frac{di}{dt}
$$
- Voltage across an inductor $V$ = Inductance $L$ × Rate of change of current $\frac{di}{dt}$
### RL Time Constant:
$$
\tau = \frac{L}{R}
$$
- Time constant $\tau$ for an RL circuit
### Kirchhoffs Laws:
- **Kirchhoffs Current Law (KCL):** The sum of currents entering a junction equals the sum of currents leaving.
- **Kirchhoffs Voltage Law (KVL):** The sum of voltages around any closed loop equals zero.
---
#physics

101
content/physics/final.md Normal file
View File

@@ -0,0 +1,101 @@
> [!NOTE] A mass $m$ attached to a spring with constant $k$ oscillates on a frictionless surface. Derive an expression for the velocity $v$ as a function of displacement $x$.
>
> [!INFO]-
> Total mechanical energy in SHM is conserved:
> $$
> E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 = \frac{1}{2}kA^2
> $$
> Solving for $v$:
> $$
> v = \pm \sqrt{\frac{k}{m}(A^2 - x^2)}
> $$
> [!NOTE] A wave traveling along a rope is represented by $y(x,t) = 0.02\cos(40x - 600t)$. Determine the amplitude, wavelength, frequency, and speed of the wave.
>
> [!INFO]-
> The general wave form is $y = A\cos(kx - \omega t)$:
> - Amplitude $A = 0.02\ \mathrm{m}$
> - Wave number $k = 40 \Rightarrow \lambda = \frac{2\pi}{k} = \frac{2\pi}{40} = 0.157\ \mathrm{m}$
> - Angular frequency $\omega = 600 \Rightarrow f = \frac{\omega}{2\pi} = \frac{600}{2\pi} \approx 95.5\ \mathrm{Hz}$
> - Wave speed $v = f\lambda = 95.5 \times 0.157 \approx 15\ \mathrm{m/s}$
> [!NOTE] In Young's double slit experiment, fringes are formed on a screen 1.2 m away using light of wavelength $600\ \text{nm}$. The slits are separated by $0.2\ \text{mm}$. Calculate the distance between adjacent bright fringes.
>
> [!INFO]-
> Fringe spacing is given by:
> $$
> y = \frac{\lambda D}{d} = \frac{600 \times 10^{-9} \times 1.2}{0.2 \times 10^{-3}} = 3.6\ \text{mm}
> $$
> [!NOTE] A pendulum of length $0.5\ \mathrm{m}$ is displaced by a small angle. Determine its period and explain why amplitude does not affect the result.
>
> [!INFO]-
> The period is:
> $$
> T = 2\pi\sqrt{\frac{L}{g}} = 2\pi\sqrt{\frac{0.5}{9.8}} \approx 1.41\ \mathrm{s}
> $$
> In the small-angle approximation ($\theta < 10^\circ$), motion is independent of amplitude.
> [!NOTE] A charged particle $q$ moves through a uniform electric field $E$. Derive the expression for the work done on the charge and its change in potential energy.
>
> [!INFO]-
> Work done:
> $$
> W = qEd
> $$
> Change in potential energy:
> $$
> \Delta U = -qEd
> $$
> since electric potential energy decreases when the charge moves in the direction of the field.
> [!NOTE] A capacitor of $10\ \mu\mathrm{F}$ is charged to $5\ \mathrm{V}$. Calculate the energy stored in it.
>
> [!INFO]-
> $$
> E = \frac{1}{2}CV^2 = \frac{1}{2} \cdot 10 \times 10^{-6} \cdot 25 = 1.25 \times 10^{-4}\ \mathrm{J}
> $$
> [!NOTE] A coil of wire rotates in a magnetic field. Use Faradays law to derive the expression for the induced emf.
>
> [!INFO]-
> Faradays law:
> $$
> \mathcal{E} = -\frac{d\Phi}{dt}
> $$
> Magnetic flux $\Phi = B A \cos(\omega t)$, so:
> $$
> \mathcal{E} = B A \omega \sin(\omega t)
> $$
> [!NOTE] A wire carries a current of $3\ \mathrm{A}$ through a magnetic field of $0.5\ \mathrm{T}$ perpendicular to its length. The wire is $0.4\ \mathrm{m}$ long. Find the magnetic force.
>
> [!INFO]-
> $$
> F = ILB\sin\theta = 3 \cdot 0.4 \cdot 0.5 \cdot 1 = 0.6\ \mathrm{N}
> $$
> [!NOTE] Explain the effect of damping on the amplitude-frequency graph of a driven harmonic oscillator.
>
> [!INFO]-
> Damping reduces the peak amplitude and shifts the resonant frequency slightly lower. Greater damping broadens the curve and lowers the quality factor $Q$.
> [!NOTE] A mass-spring oscillator experiences light damping. Write the differential equation and general solution.
>
> [!INFO]-
> Equation:
> $$
> m\ddot{x} + b\dot{x} + kx = 0
> $$
> Solution:
> $$
> x(t) = A e^{-\gamma t} \cos(\omega' t + \phi)
> $$
> where $\gamma = \frac{b}{2m}$ and $\omega' = \sqrt{\omega_0^2 - \gamma^2}$.
> [!NOTE] A $0.2\ \mathrm{kg}$ object experiences a force due to gravity from Earth at a distance of $6.4 \times 10^6\ \mathrm{m}$. Calculate the force.
>
> [!INFO]-
> $$
> F = G\frac{Mm}{r^2} = 6.67 \times 10^{-11} \cdot \frac{5.97 \times 10^{24} \cdot 0.2}{(6.4 \times 10^6)^2} \approx 1.96\ \mathrm{N}
> $$

View File

@@ -0,0 +1,76 @@
---
title: Introduction to General Relativity
date: 2025-01-04
---
# The Introduction to the Introduction
I pulled all of this from a certain immensely helpful textbook[^1]. The need for special relativity arises from the limitations of Newton's theory of gravitation. We've all seen the following equation:
$$
\textbf{F}=-\frac{MmG}{r^3}\textbf{r}
$$
$\textbf{r}$ is the direction vector, or unit direction vector from masses $M$ and $m$. The problem is that most of these quantities vary over time. For example, if $M$ was a function of $t$:
$$
\textbf{F}(t)=-\frac{M(t)mG}{r^3}\textbf{r}
$$
> [!NOTE]
> $G$ is the gravitational constant.
The problem here is that a variation in mass creates a delayed reaction in gravitation, but our formula with Newtonian mechanics does not provide for that. Above, a variation in any quantity yields instant variation in force. In reality, gravity moves at the speed of light.
Why you can't just use $t-r/c$ as the parameter will be covered sometime later. For now, just know Einstien Enstiened here. Such remodeling of Newton's law was attempted and then met with failure. The intensity of the gravitational field at any distance $r$ from the center of mass and direction $\hat{r}$ is provided by:
$$
\textbf{g}=-\frac{GM}{r^2}\hat{r}
$$
This is not entirely accurate, since what is actually being described here is the gradient field of attractive forces, written so:
$$
\textbf{g}=-\nabla\phi, \phi(r)=-\frac{GM}{r}
$$
The function $\phi(r)$ is the gravitational *potential*, a scalar field. Each scalar value in the field represents the work needed to be done to move mass $m$ there from $r=0$. Specifically, this is the change in potential energy, meaning an upward motion out of the gravitational well caused by a mass $M$ results in a positive change in potential energy.
The potential $\phi$ satisfies field equations.
$$
\text{(Laplace, in a vacuum) } \nabla^2\phi=0
$$
$$
\text{(Poisson, with matter) } \nabla^2\phi=4\pi G \rho
$$
The field $\textbf{g}$ depends on $r$ but not $t$, meaning the partial derivative with respect to $r$ equals $0$.
## Equivalence Principle
> [!NOTE] definition
> **The Equivalence Principle states:** No experiment in mechanics can distinguish between a gravitational field and an accelerating frame of reference.
After reading this, I realized that the textbook has it worded horribly. It means that the two &mdash; gravity and acceleration are locally indistinguishable.
There are three relevant equations. The Force acting on an object:
$$
\vec{F}=m_i \vec{a}
$$
The above equation describes force opposite to inertia. The below equation describes force appeared to have been exerted by the gravitational field:
$$
\vec{F}=m_g \vec{g}
$$
Here, $m_g$ is the *gravitational mass* of the particle. Gravitational Mass is a measure of the response of a particle to the gravitational field. These are conceptually different things. The gravitational mass depends on the scalar gravitational potential field. Of course, there are several experiments to prove this, but the equation of note is as follows:
$$
\vec{a}=\frac{\vec{F}}{m_i}=\frac{m_g}{m_i}\vec{g}
$$
# Einstien's Train
[^1]: Ryder, L. (2009). Introduction to General Relativity. Singapore: Cambridge University Press.
#physics

View File

@@ -0,0 +1,527 @@
---
title: Less Simple Harmonic Motion
date: 2025-01-09
---
# Simple harmonic motion - Spring oscillations
When an object *vibrates* or *oscillates* back and forth, over the same path, each oscillation taking the same amount of time, the motion is **periodic.** The simplest form of periodic motion closely resemble this system, we will examine ... blah blah blah. Any spring at natural length is defined to be at its **equilibrium position.** If additional energy is imparted upon the system, either compressing or stretching said spring, a restoring force will occur to *restore* the initial position.
$$
F=\pm kx
$$
Terms, I guess:
- the distance from the equilibrium point is *displacement*
- Peak displacement is called the *amplitude*
- one *cycle* is the distance covered between the trough of the position curve over time and the peak of the same curve
- the *period* $T$ is the time required to complete one cycle's worth of motion
- the *frequency* $f$ is the number of complete cycles per second.
$$
f=\frac{1}{T} \text{ and } T=\frac{1}{f}
$$
# Energy in Simple Harmonic Motion
Please just go learn Lagrangian Mechanics already. The energy approach is obviously the most useful of them all. Elastic Potential energy:
$$
|\int{F\mathrm{d}x}|=\int{kx \mathrm{d}x}=\tfrac{1}{2}kx^2
$$
The total energy: $E=\textbf{KE}+\textbf{PE}$
$$
E=\tfrac{1}{2}mv^2 + \tfrac{1}{2}kx^2
$$
We all know what $x$ and $v$ are. SHM can only occur if friction and other external forces are approximately net zero. $A$ is defined as the absolute peak distance from equilibrium. When $x=\pm A$, the $\textbf{KE}=0$.
$$
\tfrac{1}{2}m0^2+\tfrac{1}{2}kA^2
$$
At equilibrium, velocity and therefore kinetic energy are the greatest, with $\textbf{PE}=0$:
$$
E=\tfrac{1}{2}m(v_{\text{max}})^2
$$
Since energy is always conserved in SHM:
$$
\tfrac{1}{2}mv^2 + \tfrac{1}{2}kx^2 = \tfrac{1}{2}kA^2
$$
Solving the system of equations for $v$:
$$
v^2 = \frac{k}{m}A^2(1-\frac{x^2}{A^2})
$$
Given $mv^2=kA^2$:
$$
v_{\text{max}}=\sqrt{\frac{k}{m}}A
$$
With another step of substitution:
$$
v=\pm v_{\text{max}}\sqrt{1-\frac{x^2}{A^2}}
$$
# The Period and the Sinusoidal Nature of SHM
The period of harmonic motion depends on the stiffness of the spring and the mass $m$ in question. It does not, however, depend on the amplitude ,$A$.
$$
T=2\pi\sqrt{\tfrac{m}{k}}
$$
Larger mass means more rotational inertial (we haven't gotten to this yet), so that part of it makes sense. It is also important that $k\propto F$
$$
f=\frac{1}{t}=\frac{1}{2\pi}\sqrt{\frac{k}{m}}
$$
Here's the expanded derivation with the characteristic equation and solution in a markdown format with LaTeX code blocks:
---
# Derivation of the Mass-Spring SHM Equation Using Lagrangian Mechanics
We start with the equation of motion derived from the Lagrangian approach:
$$
m \ddot{x} + kx = 0
$$
## Step 1: Rewrite as a Second-Order ODE
$$
\ddot{x} + \frac{k}{m}x = 0
$$
Let:
$$
\omega^2 = \frac{k}{m}
$$
Thus, the equation becomes:
$$
\ddot{x} + \omega^2 x = 0
$$
---
## Step 2: Characteristic Equation
To solve this second-order differential equation, assume a solution of the form:
$$
x(t) = e^{\lambda t}
$$
Substitute $ $x(t) = e^{\lambda t}$ into the differential equation:
$$
\lambda^2 e^{\lambda t} + \omega^2 e^{\lambda t} = 0
$$
Factoring out $ $e^{\lambda t}$ (which is never zero):
$$
\lambda^2 + \omega^2 = 0
$$
The characteristic equation is:
$$
\lambda^2 + \omega^2 = 0
$$
---
## Step 3: Solve for $ $\lambda$
Rearranging:
$$
\lambda^2 = -\omega^2
$$
Taking the square root:
$$
\lambda = \pm i\omega
$$
Thus, the general solution for $ $x(t)$ is a linear combination of exponential functions:
$$
x(t) = C_1 e^{i\omega t} + C_2 e^{-i\omega t}
$$
---
## Step 4: Convert to Real Solution
Using Euler's formula:
$$
e^{i\omega t} = \cos(\omega t) + i\sin(\omega t)
$$
$$
e^{-i\omega t} = \cos(\omega t) - i\sin(\omega t)
$$
The general solution becomes:
$$
x(t) = C_1 (\cos(\omega t) + i\sin(\omega t)) + C_2 (\cos(\omega t) - i\sin(\omega t))
$$
Grouping real and imaginary parts, let:
$$
A = C_1 + C_2, \quad B = i(C_1 - C_2)
$$
The solution can then be written as:
$$
x(t) = A \cos(\omega t) + B \sin(\omega t)
$$
---
## Step 5: Final General Solution
Alternatively, write the solution in amplitude-phase form:
$$
x(t) = C \cos(\omega t + \phi)
$$
where:
- $C = \sqrt{A^2 + B^2}$ (amplitude),
- $\phi = \tan^{-1}\left(\frac{B}{A}\right)$ (phase angle).
This is the general solution for the simple harmonic motion of a mass-spring system.
# Standing Waves
Standing waves form in a confined space due to wave interference, leading to **resonant frequencies** where the wave reinforces itself. The resonance conditions differ based on boundary conditions:
- **Both Ends Closed** (e.g., a string fixed at both ends or a closed pipe)
- **One End Closed, One End Open** (e.g., wind instruments like clarinets)
- **Both Ends Open** (e.g., wind instruments like flutes).
## **Both Ends Closed (Fixed String or Closed Pipe)**
- **Boundary conditions:** Nodes at both ends (zero displacement).
- **Wave pattern:** The tube must fit an integer number of **half-wavelengths**.
### **Resonance Condition:**
$$
L = n \frac{\lambda}{2}, \quad n = 1, 2, 3, \dots
$$
### **Frequency Formula:**
Using $ v = f \lambda $, solving for $ f $:
$$
f_n = \frac{n v}{2L}, \quad n = 1, 2, 3, \dots
$$
### **How to Calculate $ n $:**
Since $ n $ counts both nodes and antinodes:
$$
n = \text{total antinodes}
$$
---
## **One End Closed, One End Open (Pipe with One Closed End)**
- **Boundary conditions:** A node at the closed end (zero displacement) and an antinode at the open end (maximum displacement).
- **Wave pattern:** The tube must fit an **odd number of quarter-wavelengths**.
### **Resonance Condition:**
$$
L = n \frac{\lambda}{4}, \quad n = 1, 3, 5, 2k-1, \dots
$$
### **Frequency Formula:**
Using $ v = f \lambda $, solving for $ f $:
$$
f_n = \frac{n v}{4L}, \quad n = 1, 3, 5, 2k-1 , \dots
$$
### **How to Calculate $ n $:**
Since $ n $ counts both nodes and antinodes:
$$
n = \text{total nodes} + \text{total antinodes}-1
$$
The above is true only if you cound the starting node of the fixture of the air column. You do not subtract by $1$ otherwise.
---
## **Both Ends Open (Pipe Open at Both Ends)**
- **Boundary conditions:** Antinodes at both ends (maximum displacement).
- **Wave pattern:** The tube must fit an integer number of **half-wavelengths**, similar to the **both ends closed** case.
### **Resonance Condition:**
$$
L = n \frac{\lambda}{2}, \quad n = 1, 2, 3, \dots
$$
### **Frequency Formula:**
Using $ v = f \lambda$, solving for $ f $:
$$
f_n = \frac{n v}{2L}, \quad n = 1, 2, 3, \dots
$$
### **How to Calculate $ n $:**
Since $ n $ counts both nodes and antinodes:
$$
n = \text{total nodes} = \text{total antinodes} -1
$$
---
## **Summary Table: Resonance Conditions and Harmonics Calculation**
| Condition | Node-Antinode Pattern | Wavelength Relation | Frequency Formula | Harmonic Number Calculation |
|-----------------------------|------------------------------|--------------------------------------------|----------------------------|-----------------------------|
| **Both Ends Closed** | Node at both ends | $L = n \frac{\lambda}{2}$ | $f_n = \frac{n v}{2L}$ | $n = \text{antinodes}$ |
| **One End Closed, One Open**| Node at closed, antinode at open | $L = n \frac{\lambda}{4}$ | $f_n = \frac{n v}{4L}$ | $n = \text{nodes} + \text{antinodes}$ |
| **Both Ends Open** | Antinode at both ends | $L = n \frac{\lambda}{2}$ | $f_n = \frac{n v}{2L}$ | $n = \text{antinodes}$ |
Now the formulas **remain internally consistent with a fixed definition of $ n $** across all cases.
# Pendulum formulas
Here are the main pendulum formulas in general physics:
1. **Period of a simple pendulum** (small angle approximation):
$$
T = 2\pi \sqrt{\frac{L}{g}}
$$
Where:
- $T$ = period (time for one full swing)
- $L$ = length of the pendulum
- $g$ = acceleration due to gravity
2. **Frequency of a simple pendulum**:
$$
f = \frac{1}{T} = \frac{1}{2\pi} \sqrt{\frac{g}{L}}
$$
Where:
- $f$ = frequency (number of oscillations per second)
3. **Angular frequency** of a simple pendulum:
$
\omega = \sqrt{\frac{g}{L}}
$
Where:
- $\omega$ = angular frequency (rad/s)
4. **Displacement of a simple pendulum (for small angles)**:
$$
\theta(t) = \theta_0 \cos(\omega t)
$$
Where:
- $\theta(t)$ = angular displacement at time \(t\)
- $\theta_0$ = maximum displacement (amplitude)
5. **Energy of a simple pendulum**:
- **Potential Energy** at maximum displacement:
$$
PE = mgh
$$
Where:
- $m$ = mass of the pendulum bob
- $h$ = height relative to the lowest point
- **Kinetic Energy** at the equilibrium point:
$$
KE = \frac{1}{2}mv^2
$$
6. **Damped pendulum (under the influence of friction)**:
$$
\theta(t) = \theta_0 e^{-\gamma t} \cos(\omega t)
$$
Where:
- $\gamma$ = damping coefficient
7. **For a physical pendulum** (a rigid body swinging about a pivot):
$$
T = 2\pi \sqrt{\frac{I}{mgd}}
$$
Where:
- $I$ = moment of inertia of the object
- $d$ = distance from the pivot point to the center of mass
These are the key formulas for general pendulum motion, covering simple and physical pendulums, damped motion, and energy analysis.
# Dampened Springs
The damping coefficient, denoted by $\gamma$, quantifies the rate at which the amplitude of oscillation decreases over time due to resistive forces (like friction or air resistance) acting on the system. It depends on factors like the properties of the medium (air, fluid, etc.) and the characteristics of the object (shape, surface area, etc.).
The damping force is typically modeled as:
$$
F_{\text{damping}} = -\gamma v
$$
where:
- $F_{\text{damping}}$ is the damping force,
- $\gamma$ is the damping coefficient, and
- $v$ is the velocity of the oscillating mass.
The damping coefficient influences how quickly the system loses energy. The larger the damping coefficient, the faster the oscillations decay.
### Types of Damping:
1. **Underdamped**: If the damping is weak ($\gamma < \omega_0$), the system still oscillates, but with decreasing amplitude. The system's motion is described by:
$$
x(t) = A e^{-\gamma t} \cos(\omega' t + \phi)
$$
2. **Critically damped**: If the damping is strong enough to prevent oscillations, but not too strong to cause the system to return to equilibrium too slowly, we have the critical damping condition: $\gamma = \omega_0$.
3. **Overdamped**: If the damping is too strong ($\gamma > \omega_0$), the system returns to equilibrium without oscillating, but more slowly than in the critically damped case.
### Relation to Natural Frequency:
The **damped angular frequency** $\omega'$ is related to the natural frequency $\omega_0$ by:
$$
\omega' = \sqrt{\omega_0^2 - \gamma^2}
$$
This shows that as $\gamma$ increases, $\omega'$ decreases, meaning the system oscillates less rapidly. If $\gamma$ is large enough (in the overdamped case), there will be no oscillations at all.
In summary, the damping coefficient $\gamma$ plays a key role in determining the rate at which a mass-spring system loses energy and the nature of its oscillations.
### Snell's Law:
Snell's Law describes the relationship between the angles of incidence and refraction when a wave passes through the boundary between two media with different refractive indices. It is given by:
$$
n_1 \sin(\theta_1) = n_2 \sin(\theta_2)
$$
Where:
- $n_1$ and $n_2$ are the refractive indices of the two media,
- $\theta_1$ and $\theta_2$ are the angles of incidence and refraction, respectively, measured from the normal.
Snell's Law explains how light bends when it transitions from one medium to another (e.g., air to water). If the refractive index increases (e.g., from air to glass), the light slows down and bends towards the normal. Conversely, if the refractive index decreases (e.g., from water to air), light bends away from the normal.
### Doppler Effect:
The Doppler Effect refers to the change in frequency (or wavelength) of a wave as observed by someone moving relative to the wave source. For sound waves, the observed frequency $f'$ is given by:
$$
f' = f \left( \frac{v \pm v_{\text{observer}}}{v \pm v_{\text{source}}} \right)
$$
Where:
- $f'$ is the observed frequency
- $f$ is the emitted frequency,
- $v$ is the wave speed in the medium,
- $v_{\text{observer}}$ is the velocity of the observer relative to the medium,
- $v_{\text{source}}$ is the velocity of the source relative to the medium.
The sign conventions depend on whether the observer and source are moving towards or away from each other:
- Moving towards each other: use the "+" sign in the numerator and the "-" in the denominator.
- Moving apart: use the "-" sign in the numerator and the "+" in the denominator.
In the case of light, the relativistic Doppler shift formula is used, where the frequency shift is influenced by both the motion and the speed of light.
The Doppler Effect explains phenomena such as the change in pitch of a passing car or the redshift/blueshift observed in the light from stars and galaxies.
Sure! Here's a combined explanation of the **path difference** in the double-slit experiment, with the math expressed using LaTeX notation:
---
# Young's Experiment
In the **double-slit experiment**, light passes through two slits and creates an interference pattern on a screen. The **path difference** refers to the difference in the distances that the light waves travel from each of the two slits to a particular point on the screen.
### What is Path Difference?
1. **Two light waves** are emitted from the two slits, and they travel towards a point on the screen.
2. The distance traveled by the light from the first slit to that point is different from the distance traveled by the light from the second slit.
3. The **path difference** is simply the difference between these two distances.
### How Path Difference Affects the Interference Pattern:
- **Constructive Interference**: This occurs when the path difference is a **whole number multiple** of the wavelength, i.e.,
$$
\Delta y = m\lambda \quad \text{(where $m$ is an integer)}
$$
In this case, the waves arrive **in phase** and interfere **constructively**, creating a **bright fringe** on the screen.
- **Destructive Interference**: This happens when the path difference is an **odd multiple** of half the wavelength, i.e.,
$$
\Delta y = \left( m + \frac{1}{2} \right) \lambda \quad \text{(where $m$ is an integer)}
$$
Here, the waves arrive **out of phase** and interfere **destructively**, resulting in a **dark fringe**.
### Formula for Path Difference:
In the double-slit experiment, the path difference for a point on the screen at an angle \( \theta \) can be expressed as:
$$
\Delta y = d \sin \theta
$$
Where:
- $ \Delta y $ = path difference
- $ d $ = distance between the two slits
- $ \theta $ = angle between the central maximum (the center of the pattern) and the point on the screen
- $ \lambda $ = wavelength of the light
At the **central maximum** (the middle bright fringe), the path difference is zero because the light from both slits travels the same distance. As you move away from the center, the path difference increases, affecting the type of interference (constructive or destructive) at each point on the screen.
### How Path Difference Relates to Intensity:
The intensity of the light at a point on the screen in the double-slit experiment depends on the path difference. The intensity for constructive and destructive interference can be written as:
For constructive interference (bright fringes):
$$
I_m = I_0 \cos^2\left(\frac{m\pi d}{\lambda D}\right)
$$
For destructive interference (dark fringes):
$$
I = I_0 \cos^2\left(\frac{\pi \Delta y}{\lambda}\right)
$$
Where:
- $ I_m $ = intensity at the $ m $-th fringe
- $ I_0 $ = maximum intensity (at the central maximum)
- $ m $ = fringe order (1st, 2nd, etc.)
- $ \Delta y $ = path difference
- $ D $ = distance from the slits to the screen
### Summary:
- The **path difference** is the difference in the distances traveled by the two light waves from the slits to a point on the screen.
- If the path difference is a whole multiple of the wavelength, you get **constructive interference** (bright fringe), and if it's an odd multiple of half the wavelength, you get **destructive interference** (dark fringe).
- The **fringe width** depends on the wavelength and the geometry of the setup and can be calculated using:
$$
\beta = \frac{\lambda D}{d}
$$
Where:
- $ \beta $ = fringe width (distance between adjacent fringes)
- $ \lambda $ = wavelength of the light
- $ D $ = distance from the slits to the screen
- $ d $ = distance between the two slits
## Final equations
Time to combine everything together. We'll continue to use the variable definitions from above, but include $y_m$, or the distance between the center, $m=0$ and some bright fringe of order $m$. When calculating, it can also be assumed that (for small angles) $\sin\theta\approx\theta$.
$$
\boxed{d\sin\theta=m\lambda}
$$
$$
\boxed{y_md=Dm\lambda}
$$

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -25,7 +25,7 @@ When it comes to energy transfer and phase changes there are only two useful equ
These equations together describe the heat energy required for changing the temperature of a substance and for changing its phase.
**It is important to note the alternate arrangement of both:
**It is important to note the alternate arrangement of both**:
$$
Q=nc_{\mathrm{mol}}\Delta T = \Delta \textbf{KE}
$$
@@ -57,4 +57,145 @@ $$
Provides the power per unit area of the black body, from the interval $\left[\lambda, \lambda + \mathrm{d}\lambda\right]$, given that $\mathrm{d}\lambda$ is an infinitesimally small quantity.
## Wien's displacement law.
Wien's law states the wavelength of peak intensity at a given temperature in Kelvin $T$ is given by:
$$
\lambda_{\text{peak}}=\frac{b}{T}
$$
Where $b$ is Wien's displacement constant, equal to $2.897771955\cdot 10^{-3} \mathrm{m}\cdot\mathrm{K}$.
> [!NOTE]
> The material does not matter. All black bodies emit radiation over all wavelengths.
## Stefan Boltzmann Law of Radiation
This law describes the emissive power of a Black Body per unit area.
$$
E_b=\varepsilon \sigma\cdot T^4
$$
In the above equation,:
- $E_b$ is the **Emissive Power** of a black body, per unit time, per unit area.
- $\varepsilon$ is the emissivity of an object
- $\sigma$ is the Boltzmann constant, about $\approx 5.670374419\cdot 10^{-8} \mathrm{W}\cdot\mathrm{m}^{-2}\cdot \mathrm{K}^{-4}$
- A perfect black body has an emissivity of $1$, and an albedo of $0$
- always work in default SI units
If you desire the total power across the entirety of the surface:
$$
P_b=A\varepsilon \sigma\cdot T^4
$$
Where $A$ is the area of the exposed surface.
## Emissivity and Albedo
Emissivity $\varepsilon$ is given by :
$$
\varepsilon=\frac{P_{\text{obj}}}{P_b}
$$
Albedo is given by:
$$
\alpha=\frac{P_\text{reflected}}{P_{\text{incoming}}}
$$
This is where the Boltzmann law comes in to play. In order to calculate the emissivity of an object, you first need bot: the power of emissions from the target object, and the Power that would be emitted by a black body of the same temperature. This value can be procured using the Stefan Boltzmann Law of Radiation.
Albedo, however, is a far simpler quantity, relying only on the input and output energies of the object.
## Inverse Square Law and Apparent brightness
If $b$ is the Power experienced at a radius $r$:
$$
b=\frac{L}{4\pi r^2}
$$
The above is true when $L$ is procured from the source, most likely using the Boltzmann's law.
# Gas Laws and the Ideal Gas Law
## Ideal Gas Law
The **Ideal Gas Law** is a fundamental equation describing the behavior of ideal gases:
$$
PV = nRT
$$
Where:
- $P$ = Pressure (in atm, Pa, or another unit)
- $V$ = Volume (in liters or cubic meters)
- $n$ = Number of moles of gas
- $R$ = Ideal gas constant ($0.0821 \, \mathrm{L \cdot atm \cdot mol^{-1} \cdot K^{-1}}$)
- $T$ = Temperature (in Kelvin)
This equation relates the pressure, volume, temperature, and quantity of an ideal gas.
---
## Boyle's Law
**Boyle's Law** states that the pressure of a gas is inversely proportional to its volume when temperature and the number of moles are constant:
$$
P \propto \frac{1}{V} \quad \text{or} \quad P_1V_1 = P_2V_2
$$
### Key Points:
- As volume decreases, pressure increases.
- The relationship is hyperbolic.
---
## Charles's Law
**Charles's Law** states that the volume of a gas is directly proportional to its absolute temperature when pressure and the number of moles are constant:
$$
V \propto T \quad \text{or} \quad \frac{V_1}{T_1} = \frac{V_2}{T_2}
$$
### Key Points:
- As temperature increases, volume increases.
- Temperature must be in Kelvin.
---
## Gay-Lussac's Law
**Gay-Lussac's Law** states that the pressure of a gas is directly proportional to its absolute temperature when volume and the number of moles are constant:
$$
P \propto T \quad \text{or} \quad \frac{P_1}{T_1} = \frac{P_2}{T_2}
$$
### Key Points:
- As temperature increases, pressure increases.
- Temperature must be in Kelvin.
---
## Avogadro's Law
**Avogadro's Law** states that the volume of a gas is directly proportional to the number of moles when pressure and temperature are constant:
$$
V \propto n \quad \text{or} \quad \frac{V_1}{n_1} = \frac{V_2}{n_2}
$$
### Key Points:
- Adding more gas increases volume proportionally.
- This law explains why equal volumes of gases contain equal numbers of molecules at the same temperature and pressure.
---
## Combined Gas Law
The **Combined Gas Law** combines Boyle's, Charles's, and Gay-Lussac's Laws into one equation when the number of moles is constant:
$$
\frac{P_1V_1}{T_1} = \frac{P_2V_2}{T_2}
$$
This equation can be used to calculate changes in pressure, volume, or temperature of a gas sample.
---
Use these laws to analyze relationships between variables and predict gas behavior under different conditions!