Add README.md and MEMORY.md for project context and AI agent guidance

This commit is contained in:
deamonkai
2026-04-04 18:05:14 -05:00
parent 92639a2562
commit ec05107d15
2 changed files with 154 additions and 0 deletions

97
MEMORY.md Normal file
View File

@@ -0,0 +1,97 @@
# AI Agent Memory — HaydenProject
> AI agents working in this repo: read this file first for context, then update it when you make significant changes.
---
## Project Identity
- **Repo:** https://git.molloyhome.net/mmolloy/haydenproject.git
- **Branch:** main
- **Owner:** Michael Molloy (dad) assisting Hayden Molloy (student)
- **Course:** AERO3220 — Aerospace Engineering, undergraduate
- **Assignment:** HW4, due 18 Feb 2026
---
## What This Project Contains
| File | Description |
|---|---|
| `AERO3220_HW4.m` | Hayden's MATLAB script — solves a coupled two-mass spring-damper system across 5 parameter cases using `ode45` and plots results |
| `AERO3220_HW4.pdf` | Professor's original assignment PDF (image-compressed, not OCR-extractable) |
| `AERO3220_HW4_block_diagram.md` | Block diagram document created by AI agent — see section breakdown below |
| `.gitignore` | MATLAB + macOS ignores: `.DS_Store`, `*.pdf.png`, `*.asv`, `*.m~`, `slprj/`, `*.mex*`, `profile_results/` |
---
## Physics Summary (AERO3220 HW4)
Two-mass spring-damper system. State vector: `x = [z1, z1dot, z2, z2dot]`.
Equations of motion:
- Mass 1 (top, unforced): `m1*z1ddot + k1*(z1-z2) = 0`
- Mass 2 (bottom, forced): `m2*z2ddot + b*z2dot + (k1+k2)*z2 - k1*z1 = u(t)`
Parameters:
- `k1 = 100 N/m`, `k2 = 50 N/m`, `m1 = 500 kg`, `m2 = 250 kg`
- Time: `t = 0` to `200 s`, `dt = 0.01 s`
- Initial conditions: all zero
Five simulation cases varying damping `b` and forcing `F`:
| Case | b (N·s/m) | Force u(t) |
|---|---|---|
| 1 | 100 | 100 N constant |
| 2 | 100 | 100 sin(0.25t) N |
| 3 | 0 | 100 sin(0.25t) N |
| 4 | 100 | 100 sin(0.50t) N |
| 5 | 0 | 100 sin(0.50t) N |
---
## Block Diagram File Sections
`AERO3220_HW4_block_diagram.md` contains:
1. **Program Flow Block Diagram** — Mermaid flowchart of the MATLAB script execution (setup → 5 cases → 5 plots)
2. **ODE Model** — LaTeX equations for z1ddot and z2ddot
3. **System Equations Block Diagram** — Mermaid diagram of coupled dynamics signal flow (not a flowchart)
4. **Transfer Function Block Diagram Form** — Mermaid diagram with explicit gain blocks, integrator `1/s` blocks, and summation nodes. Includes Laplace-domain relations Z1(s) and Z2(s).
5. **Coupled State Space Form** — LaTeX `xdot = Ax + Bu` with full A and B matrices
6. **Assignment-Style Block Diagram** — Mermaid flowchart with a loop over cases (submission-oriented)
7. **Solver Subsystem** — Mermaid diagram zoomed into `eom_two_mass` internals
---
## Known Mermaid Rendering Constraints
The repo viewer (Gitea at git.molloyhome.net) uses a strict Mermaid parser. These constructs **break rendering**:
- Square brackets `[...]` inside node labels (e.g. vector notation) — use plain text or parentheses-free descriptions
- Parentheses `(...)` inside `[...]` node labels — replace with plain text equivalents
- Math superscripts like `^T` inside labels — write out in words
Always test Mermaid node labels with plain alphanumeric text and spaces only inside `[...]` blocks.
---
## Conversation History Summary
1. Michael shared the PDF (assignment) and `.m` file (Hayden's code).
2. AI read the MATLAB file and created `AERO3220_HW4_block_diagram.md` as a Mermaid flowchart of program flow.
3. Repo repointed to `https://git.molloyhome.net/mmolloy/haydenproject.git` (no prior remote existed), committed and pushed.
4. `.gitignore` added for MATLAB/macOS artifacts, committed and pushed.
5. Several Mermaid parse errors fixed iteratively (square brackets, parentheses in labels).
6. Hayden clarified: he wanted a **system equations** block diagram, not a program flowchart.
7. Added system-equations diagram, state-space form, and transfer-function block diagram with `1/s` integrator blocks and gain blocks.
8. This `MEMORY.md` and `README.md` created and pushed.
---
## Agent Update Instructions
- After any meaningful change (new diagram, physics correction, new file), update the **Conversation History Summary** and **Block Diagram File Sections** tables above.
- If Mermaid parse errors are encountered, add the pattern to **Known Mermaid Rendering Constraints**.
- Do not remove prior history entries — append new ones.

57
README.md Normal file
View File

@@ -0,0 +1,57 @@
# HaydenProject — AERO3220 HW4
Aerospace Engineering undergraduate homework project by **Hayden Molloy**.
---
## Assignment
**Course:** AERO3220
**HW:** 4
**Topic:** Coupled two-mass spring-damper system — numerical simulation and analysis
The system models two vertically stacked masses connected by springs and a damper, with an external forcing function applied to the bottom mass. Five parameter cases are simulated by varying damping coefficient and forcing frequency.
---
## Files
| File | Description |
|---|---|
| `AERO3220_HW4.m` | MATLAB simulation script |
| `AERO3220_HW4.pdf` | Professor's original assignment |
| `AERO3220_HW4_block_diagram.md` | System block diagrams including transfer-function form and state-space form |
| `MEMORY.md` | AI agent context file — read before making changes |
| `.gitignore` | MATLAB and macOS artifact exclusions |
---
## Block Diagrams
`AERO3220_HW4_block_diagram.md` contains several views of the system:
- **Transfer Function Block Diagram** — gain blocks and `1/s` integrators showing the coupled dynamics
- **System Equations Diagram** — signal flow of the coupled differential equations
- **State Space Form** — `ẋ = Ax + Bu` with explicit A and B matrices
- **Program Flow Diagram** — how the MATLAB script executes
- **Solver Subsystem** — internals of the `eom_two_mass` function
---
## Physics
Two coupled second-order ODEs:
$$\ddot{z}_1 = -\frac{k_1}{m_1}z_1 + \frac{k_1}{m_1}z_2$$
$$\ddot{z}_2 = \frac{k_1}{m_2}z_1 - \frac{k_1+k_2}{m_2}z_2 - \frac{b}{m_2}\dot{z}_2 + \frac{1}{m_2}u(t)$$
Solved numerically with MATLAB `ode45` over `t = [0, 200]` seconds for 5 forcing/damping cases.
---
## For AI Agents
> **Before making any changes, read [`MEMORY.md`](MEMORY.md) for full session context**, including physics details, file descriptions, known rendering constraints for the Mermaid diagrams, and conversation history.
>
> After completing significant changes, **update `MEMORY.md`** — specifically the *Conversation History Summary* and any relevant sections — so future agents have accurate context.