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

This commit is contained in:
2025-01-09 20:54:49 -06:00
parent 68125f4a15
commit 4744fd878c
2 changed files with 103 additions and 0 deletions

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,87 @@
---
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_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}}
$$