Skip to content

Improve physics accuracy and enhance dark UI theme#87

Merged
5 commits merged intomainfrom
claude/improve-physics-logic-ui
Mar 5, 2026
Merged

Improve physics accuracy and enhance dark UI theme#87
5 commits merged intomainfrom
claude/improve-physics-logic-ui

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 5, 2026

The simulations used oversimplified physics (simple Euler integration, linear plastic models) and the UI had visibility issues (overlapping elements, insufficient contrast, heavy visual effects).

Physics Improvements

Integration Method

  • Replaced forward Euler with Velocity Verlet in physics.js for 2nd-order accuracy and better energy conservation
  • Added stepEuler() for backwards compatibility

Material Behavior Models (material-physics.js)

  • Ludwik-Hollomon power law: σ = K·εⁿ for realistic strain hardening
  • Ramberg-Osgood equation for elastic-plastic transitions
  • Considère criterion for necking with actual cross-section area reduction
  • Euler buckling analysis using critical load Pcr = π²EI/(KL)² with slenderness checks
  • Basquin fatigue life with Goodman mean stress correction

Simulation Integration

  • Tensile test: Newton-Raphson solver for strain from stress using Ludwik-Hollomon
  • Compression test: Buckling triggers when F > Pcr instead of arbitrary thresholds
  • Necking now updates crossSectionArea affecting stress calculations

Example from sim-tensile.js:

// Old: oversimplified plastic modulus
const plasticStrain = (stress - yield) / (E * 0.1);

// New: realistic strain hardening
const stressFromStrain = (strain) => MaterialPhysics.ludwikHollomonStress(strain, material);
// Newton-Raphson to find strain that produces current stress

UI Enhancements

Dark Theme

  • Backgrounds: #08090b (was #0c0d10)
  • Borders: opacity 0.05 (was 0.06)
  • Accent: emerald #10b981 (was bright green #22c55e)
  • Removed backdrop-filter: blur() for performance

Layout Fixes

  • Notification container uses calc() for dynamic positioning below info-popup
  • Mobile spacing increased to 20px (was 10px)
  • Specimen-info constrained with max-width: calc(50% - 30px)
  • CSS variables added for collision prevention

Visual Simplification

  • Flattened buttons and panels (reduced shadows)
  • Cleaner borders and transitions
  • Consistent spacing via CSS variables

@Claude Claude AI assigned Claude and ghost Mar 5, 2026
Claude AI and others added 4 commits March 5, 2026 10:49
- Replace simple Euler with Velocity Verlet for better accuracy
- Add material-physics.js with advanced models (Ramberg-Osgood, Ludwik-Hollomon)
- Enhance dark theme with deeper colors and flatter design
- Fix UI overlaps with dynamic positioning
- Improve mobile layout spacing

Co-authored-by: ovtdadt <264236209+ovtdadt@users.noreply.github.com>
- Use Ludwik-Hollomon for realistic strain hardening
- Implement proper necking with Considère criterion
- Add accurate Euler buckling analysis for compression
- Update all simulation HTMLs to load material-physics.js

Co-authored-by: ovtdadt <264236209+ovtdadt@users.noreply.github.com>
- Apply deeper backgrounds and flatter design to all simulations
- Update color gradients (emerald instead of bright green)
- Remove backdrop-filter blur effects
- Flatten yield indicators and buttons
- Update index.css with new theme variables

Co-authored-by: ovtdadt <264236209+ovtdadt@users.noreply.github.com>
- Add material-physics.js to remaining HTML files (torsion, shear, fatigue)
- Fix duplicate script tag in fatica-termica.html
- All 7 mechanical simulations now have advanced physics
- Enhanced dark theme applied across all pages
- UI overlaps fixed with dynamic positioning

Co-authored-by: ovtdadt <264236209+ovtdadt@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Improve site's physics logic and rewrite UI for better usability Improve physics accuracy and enhance dark UI theme Mar 5, 2026
Claude finished work on behalf of ghost March 5, 2026 10:56
@ghost ghost marked this pull request as ready for review March 5, 2026 11:05
@ghost ghost merged commit 98e205b into main Mar 5, 2026
3 checks passed
@ghost ghost deleted the claude/improve-physics-logic-ui branch March 5, 2026 11:05
This pull request was closed.
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.

1 participant