Skip to content

Conversation

@jcdoll
Copy link
Collaborator

@jcdoll jcdoll commented Feb 2, 2026

Generalize cantilever gap handling to support spatially varying width for both piezoresistors and beam mechanics.

This PR introduces a GapConfig dataclass to unify gap definitions. It refactors the existing piezoresistor air_gap_width into this new system and, more significantly, adds a beam_gap_config. This beam_gap_config allows for modeling a reduction in the cantilever's structural width in the root region, which is crucial for accurate Rayleigh-Ritz frequency calculations for designs like tuning forks, addressing a previous limitation where air_gap_width only affected piezoresistor geometry.


Slack Thread

Open in Cursor Open in Web

- Add GapConfig dataclass for configuring gap geometry with:
  - Absolute gap width (m)
  - Fractional gap (as fraction of nominal width)
  - Gap extent from root (m)

- Add piezoresistor gap configuration (gap_config property):
  - Maintains backward compatibility via air_gap_width property
  - Adds effective_pr_width_at(x) for spatially varying PR width

- Add beam gap configuration (beam_gap_config property):
  - Reduces effective beam width in root region
  - Affects stiffness via _calculate_stiffness_with_beam_gap()
  - Affects effective mass via _calculate_effective_mass_with_beam_gap()
  - Affects resonant frequency via _omega_vacuum_with_beam_gap()

- Update calculateEnergies() to support spatially varying width
  for Rayleigh-Ritz frequency calculations

- Add comprehensive tests for all gap configurations

This addresses PZ-12: Generalize gap handling for cantilever beam
multi-turn models.

Co-authored-by: jcdoll <[email protected]>
@cursor
Copy link

cursor bot commented Feb 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@jcdoll jcdoll closed this Feb 2, 2026
@jcdoll
Copy link
Collaborator Author

jcdoll commented Feb 2, 2026

Needs a fresh approach after rework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants