{"id":31074422,"url":"https://github.com/ratwolfzero/chladni_figures","last_synced_at":"2025-09-16T02:46:11.486Z","repository":{"id":314313212,"uuid":"1055040734","full_name":"ratwolfzero/Chladni_Figures","owner":"ratwolfzero","description":"Chladni Figures Simulation","archived":false,"fork":false,"pushed_at":"2025-09-11T17:25:44.000Z","size":910,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T20:16:21.515Z","etag":null,"topics":["chladni","chladni-figures","chladni-patterns","chladni-plates"],"latest_commit_sha":null,"homepage":"https://github.com/ratwolfzero/Chladni_Figures","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratwolfzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T17:19:45.000Z","updated_at":"2025-09-11T17:39:19.000Z","dependencies_parsed_at":"2025-09-11T20:18:21.378Z","dependency_job_id":"a73e8dfc-4a87-41f6-beea-5c3506643d76","html_url":"https://github.com/ratwolfzero/Chladni_Figures","commit_stats":null,"previous_names":["ratwolfzero/chladni_figures"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ratwolfzero/Chladni_Figures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2FChladni_Figures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2FChladni_Figures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2FChladni_Figures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2FChladni_Figures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratwolfzero","download_url":"https://codeload.github.com/ratwolfzero/Chladni_Figures/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratwolfzero%2FChladni_Figures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275352821,"owners_count":25449498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chladni","chladni-figures","chladni-patterns","chladni-plates"],"created_at":"2025-09-16T02:46:06.216Z","updated_at":"2025-09-16T02:46:11.473Z","avatar_url":"https://github.com/ratwolfzero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chladni Figures Simulation\n\nThis Python code simulates the nodal line patterns known as **Chladni figures** by visualizing the resonant modes of a vibrating surface. This is a computational approximation that captures the essential visual phenomenon without simulating particle dynamics.\n\n![Chladni](Chladni_3.png)\n\n---\n\n## Table of Contents\n\n- [Chladni Figures Simulation](#chladni-figures-simulation)\n  - [Table of Contents](#table-of-contents)\n  - [Historical Context](#historical-context)\n  - [Physical Principles of Simulation](#physical-principles-of-simulation)\n  - [Simulation Implementation Principles](#simulation-implementation-principles)\n  - [Key Parameters](#key-parameters)\n  - [Frequency Scaling Factor *k*](#frequency-scaling-factor-k)\n  - [Damping Factor γ](#damping-factor-γ)\n  - [Mode Superposition and γ](#mode-superposition-and-γ)\n  - [Patterns for Different γ Values](#patterns-for-different-γ-values)\n  - [Usage](#usage)\n  - [Controls](#controls)\n  - [Limitations](#limitations)\n  - [References](#references)\n\n---\n\n## Historical Context\n\nErnst Chladni (1756–1827), often called the *father of acoustics*, studied how vibrating plates caused **particles like sand or powder to accumulate along nodal lines**—regions where the plate remains stationary. These patterns, now known as **Chladni figures**, visually reveal the **standing wave patterns** on the plate.\n\nIn his experiments:\n\n- A thin metal plate is fixed at its center or edges.\n- It is vibrated with a violin bow at different frequencies.\n- Fine particles move away from areas of high vibration and collect along **nodal lines**, producing beautiful geometric patterns.\n\nChladni figures were key in understanding **vibrational modes** and laid foundations for acoustics, wave physics, and modern mechanical engineering.\n\n---\n\n## Physical Principles of Simulation\n\nThe displacement field of a **single vibrational mode** \\$(m,n)\\$ on a rectangular plate of size \\$L\\_x \\times L\\_y\\$ is given by:\n\n$$\nZ_{mn}(x,y,t) = A \\sin\\left(\\frac{m \\pi x}{L_x}\\right) \\sin\\left(\\frac{n \\pi y}{L_y}\\right) \\cos(2 \\pi f_{mn} t)\n$$\n\nwhere:\n\n- \\$m, n \\in \\mathbb{N}\\$ are the number of nodal lines along the \\$x\\$ and \\$y\\$ axes, respectively.\n- \\$A\\$ is the amplitude of oscillation.\n- \\$f\\_{mn}\\$ is the eigenfrequency of the \\$(m,n)\\$ mode:\n\n$$\nf_{mn} = k \\sqrt{\\left(\\frac{m}{L_x}\\right)^2 + \\left(\\frac{n}{L_y}\\right)^2}\n$$\n\n- $k$ sets the overall frequency scale. In real plates it depends on material properties, but in this simplified simulation we take $k=1$.\n\nThe **nodal lines** of this mode, defined by where \\$Z\\_{mn}(x,y,t) = 0\\$, are where particles accumulate in real experiments to form the classic Chladni figures.\n\n---\n\n## Simulation Implementation Principles\n\nJust as a real violin bow applies a nearly single-frequency drive, the simulation uses a **single driving frequency** \\$f\\$, summing the response of all modes weighted by a resonance term (modulating the amplitude) that includes the damping factor \\$\\gamma\\$:\n\n$$\nZ(x,y; f) = \\sum_{m=1}^{M} \\sum_{n=1}^{N} \\frac{\\sin(m \\pi x) \\sin(n \\pi y)}{(f - f_{mn})^2 + \\gamma^2}.\n$$\n\nHere, \\$\\gamma\\$ controls the influence of each mode: small \\$\\gamma\\$ produces a sharp resonance, exciting primarily a single mode, while larger \\$\\gamma\\$ broadens the response, allowing multiple nearby modes to contribute.\n\n1. **Visualization:**\n   - The absolute displacement is visualized as colormap with|Z|^0.2 to enhance contrast of nodal lines.\n   Dark regions approximate nodal lines; bright regions are anti-nodes.\n\n   - The resulting superposition (modulated by γ) roughly captures the richness of real Chladni patterns.\n   While the simulation assumes a nearly single-frequency drive (like a bow), γ mimics real-world plate imperfections that broaden resonances, causing several nearby modes to be excited simultaneously.\n\n   - The title displays the current driving frequency and the eigenfrequency of the **closest resonant mode(s)**. **Important:** the resulting pattern is a *superposition* of all significantly excited modes at frequency `f`. A small `γ` results in a pattern dominated by one mode, while a large `γ` blends several modes into a more complex, often asymmetric pattern.\n\n2. **Approximation and Model Choice:**\n\n   - **Particles are not explicitly simulated**.\n   - The mathematical model uses an ideal flexible **membrane** (like a drumhead) under tension, with sinusoidal eigenfunctions and eigenfrequencies proportional to \\$\\sqrt{m^2 + n^2}\\$. This simplifies the physics of rigid **plates** with bending stiffness.\n   - The membrane model was chosen for **computational efficiency**, allowing real-time interactive exploration. This approach successfully captures the qualitative behavior and visual essence of modal patterns, reproducing the kinds of figures observed when a real plate is driven by a bow.\n\n---\n\n## Key Parameters\n\n| Parameter    | Description                          | Typical Effect                                                                                                                                          |\n| ------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `max_mode`   | Maximum mode numbers \\$M\\$ and \\$N\\$ | Higher values allow more complex patterns, slower computation                                                                                           |\n| `gamma`      | Damping factor in mode contributions | Small γ → sharp, symmetric patterns; large γ → broad, potentially asymmetric patterns; controls resonance width, lifts degeneracy, mimics imperfections |\n| `k`          | Frequency scaling factor             | Adjusts eigenfrequency scale                                                                                                                            |\n| `resolution` | Grid resolution                      | Higher → smoother visual patterns, slower computation                                                                                                   |\n| `init_freq`  | Initial driving frequency            | Starting frequency when simulation launches                                                                                                             |\n\n---\n\n## Frequency Scaling Factor *k*\n\nIn the eigenfrequency expression\n\n$$\nf_{mn} = k \\sqrt{\\left(\\frac{m}{L_x}\\right)^2 + \\left(\\frac{n}{L_y}\\right)^2},\n$$\n\nthe parameter **k** sets the **overall frequency scale** of the simulation.\n\n1. **Physical Meaning:**\n\n   - For a real membrane or plate, the eigenfrequency depends on **geometry** (plate dimensions) and **material properties** (tension, density, stiffness).\n   - These details are collapsed into a single proportionality constant. In this simplified model, that constant is represented by **k**.\n\n2. **Role in the Simulation:**\n\n   - **Larger k** → shifts all resonances to **higher frequencies**.\n   - **Smaller k** → shifts all resonances to **lower frequencies**.\n   - Importantly, **k does not change the shape of the modal patterns**—only their placement along the frequency axis.\n\n3. **Interpretation:**\n\n   - Think of **k** as a **tuning knob** that lets you control where in the frequency range the resonances appear.\n   - While **γ** governs how sharply modes appear and blend, **k** simply sets the “frequency scale” of the entire system.\n\n4. **Guidelines:**\n\n   - Adjust **k** to place resonances in a convenient range for exploration.\n   - Once chosen, k can usually remain fixed, while **γ** and the driving frequency `f` are varied interactively.\n\n---\n\n## Damping Factor γ\n\nIn the simulation, the total displacement field is computed as:\n\n$$\nZ(x,y; f) = \\sum_{m=1}^{M} \\sum_{n=1}^{N} \\frac{\\sin(m \\pi x) \\sin(n \\pi y)}{(f - f_{mn})^2 + \\gamma^2}\n$$\n\nHere, **γ** is the **damping factor**. The following graph illustrates its primary function: controlling the resonance width and amplitude peak. A smaller γ results in a sharper, taller response, meaning only frequencies very close to the resonant frequency $f_{mn}$ will excite that mode. A larger γ creates a broader, shorter response, allowing multiple nearby modes to contribute to the pattern simultaneously.\n\n![Chladni](Resonance_and_Damping_Factors_Graph.png)\n\nIts role in the simulation is multi-faceted:\n\n1. **Resonance Width:**\n    - Small γ → narrow resonance: only modes very close to \\$f\\$ contribute.\n    - Large γ → wide resonance: multiple modes contribute simultaneously.\n\n2. **Mode Superposition \u0026 Symmetry:**\n   In an ideal plate, some vibration modes are **degenerate** (same eigenfrequency), e.g., $f_{12} = f_{21}$ on a square plate. The **damping factor γ** controls how modes combine:\n\n    - **Very small γ** excites one mode or a degenerate pair nearly equally, producing **highly symmetric, patterns**.\n    - **Increasing γ** allows nearby non-degenerate modes to contribute, introducing **subtle asymmetries**.\n    - **Large γ** excites many overlapping modes, yielding **asymetric, complex patterns**\n\n3. **Mimicking Physical Imperfections:**\n    - Real plates have variations in thickness, material, or boundaries.\n    - Increasing γ reproduces the effect of these imperfections by broadening resonance peaks.\n\n4. **Amplitude Control:**\n    - Maximum mode contribution at resonance (\\$f=f\\_{mn}\\$) is \\$1/\\gamma^2\\$.\n    - Smaller γ → sharper nodal lines, higher amplitude.\n    - Larger γ → blended, lower-amplitude patterns.\n\n5. **Guidelines:**\n    - γ ≈ 0.01–0.03 → sharp, symmetric patterns\n    - γ ≈ 0.05–0.1 → slight asymmetry\n    - γ \u003e 0.1 → diffuse, asymmetric patterns\n\n---\n\n## Mode Superposition and γ\n\n| γ Regime               | Mode Contribution                                                                         | Resulting Pattern Description                                                                            |\n| ---------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |\n| **Small (≈0.01–0.03)** | Single dominant mode **or degenerate pair**                                               | Sharp, symmetric patterns with well-defined nodal lines.                                                 |\n| **Medium (≈0.05–0.1)** | Degenerate or near-degenerate modes blend; nearby non-degenerate modes start contributing | Slight asymmetry emerges; patterns begin to merge subtly.                                                |\n| **Large (\u003e0.1)**       | Multiple overlapping modes contribute significantly                                       | Diffuse, complex, asymmetric patterns; nodal lines are less distinct|\n\n\u003e This illustrates how nodal lines deform as γ increases, simulating physical imperfections in the plate.\n\n---\n\n## Patterns for Different γ Values\n\n| γ Range          | Description                                                                                                                               |\n| :--------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |\n| **γ ≈ 0.01–0.03** | Sharp, near-perfectly symmetric patterns. Idealized behavior of a perfect plate.                                                          |\n| **γ ≈ 0.05–0.1**  | Patterns start blending, showing slight asymmetry. Represents a plate with minor imperfections or energy loss.                            |\n| **γ \u003e 0.1**       | Strong superposition of modes results in diffuse, asymmetric nodal lines. Simulates a system with significant damping or strong imperfections. |\n\n\u003e **Tip:** Adjust γ in your simulation to see the transition from symmetric to complex, realistic patterns.\n\n---\n\n## Usage\n\n- Use the frequency slider to explore modes.\n- Experiment with damping γ to see symmetry/asymmetry effects.\n\n---\n\n## Controls\n\n| Control               | Function                       |\n| :-------------------- | :----------------------------- |\n| Frequency Slider      | Adjust driving frequency.      |\n| Next Resonance Button | Jump to next higher resonance. |\n| Scan Button           | Sweep frequency automatically. |\n| Stop Scan Button      | Stop automatic scanning.       |\n\n---\n\n## Limitations\n\n- Field-based simulation; **does not model particle dynamics**.\n- Only finite `max_mode` included.\n- Damping γ is uniform; real plates have non-uniform damping.\n- Geometry is idealized square plate.\n- Uses a membrane model for computational efficiency, which simplifies the physics of a true plate with bending stiffness.\n\n---\n\n## References\n\n- Paul Bourke, *Chladni Figures*, [http://paulbourke.net/geometry/chladni/](http://paulbourke.net/geometry/chladni/)\n- Wikipedia: [Chladni Patterns](https://en.wikipedia.org/wiki/Chladni_pattern)\n- Standard vibration theory for rectangular plates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratwolfzero%2Fchladni_figures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratwolfzero%2Fchladni_figures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratwolfzero%2Fchladni_figures/lists"}