App website: www.smartlameparameters.space
Last updated: December 04, 2025
Author & Developer: Paul Namalomba
- SESKA Computational Engineer
- Software Developer
- PhD Candidate (Civil Engineering Spec. Computational and Applied Mechanics)
Version: 1.0.3 (Dec 2025)
Contact: kabwenzenamalomba@gmail.com
A production-ready React (TypeScript, React, Vite and Tailwind CSS) web application that smartly cross-calculates linear isotropic material parameters from any two independent inputs. Deployed at www.smartlameparameters.space.
- Smart Lamé Parameters Calculator
- Real-time calculation from any 2 independent elastic parameters (λ, μ, E, K, ν)
- Unit conversion between Pa, kPa, MPa, and GPa
- Parameter locking to fix values during recalculation
- Consistency checking for contradictory inputs
- Derivation trace showing which formulas were used
- Export results as JSON or CSV
- Permalink generation for sharing calculations
- Fully accessible with ARIA attributes and keyboard navigation
- Responsive design with Tailwind CSS
- 100% TypeScript with comprehensive type safety
- 80%+ test coverage with Jest and React Testing Library
- CI/CD pipeline with GitHub Actions
- Multiple deployment options: Netlify, Vercel
This tool implements standard relationships from linear isotropic elasticity theory. For an isotropic material, only 2 independent elastic constants are needed to determine all others.
- λ (lambda): Lamé's first parameter
- μ (mu) or G: Shear modulus
- E: Young's modulus
- K: Bulk modulus
- ν (nu): Poisson's ratio
- ρ (rho): Density (optional, not involved in elastic calculations)
The following formulas are implemented in src/calculations.ts:
For stable isotropic materials:
- μ > 0 (shear modulus must be positive)
- K > 0 (bulk modulus must be positive)
- E > 0 (Young's modulus must be positive)
- -1 < ν < 0.5 (Poisson's ratio bounds)
- Most common materials: 0 < ν < 0.5
- Auxetic materials (rare): ν < 0
- Incompressible materials: ν → 0.5, K → ∞
- Node.js 18.x or 20.x
- npm or yarn
# Clone the repository
git clone https://github.com/paulnamalomba/SmartLameParameters.git
cd SmartLameParameters
# Install dependencies
npm install# Start development server (http://localhost:3000)
npm run dev# Create production build
npm run build
# Preview production build
npm run preview# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage# Run ESLint
npm run lint
# Format code with Prettier
npm run format
# Type-check without building
npm run type-checkSmartLameParameters/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI/CD pipeline
├── src/
│ ├── components/
│ │ ├── Header.tsx # App header
│ │ ├── Footer.tsx # App footer
│ │ ├── InputField.tsx # Reusable input with unit selector & lock
│ │ ├── ResultsPanel.tsx # Display computed results
│ │ ├── DerivationTrace.tsx # Show formulas used
│ │ └── ValidationPanel.tsx # Display errors/warnings
│ ├── calculations.ts # Pure calculation functions
│ ├── calculations.test.ts # Calculation unit tests
│ ├── validators.ts # Input validation & bounds checking
│ ├── validators.test.ts # Validator unit tests
│ ├── useMaterialCalculator.ts # Custom React hook for state management
│ ├── types.ts # TypeScript type definitions
│ ├── App.tsx # Main application component
│ ├── main.tsx # Entry point
│ ├── index.css # Global styles (Tailwind)
│ ├── setupTests.ts # Jest setup
│ └── vite-env.d.ts # Vite type declarations
├── index.html # HTML template
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
├── jest.config.js # Jest configuration
├── tailwind.config.js # Tailwind CSS configuration
├── netlify.toml # Netlify deployment config
├── vercel.json # Vercel deployment config
├── LICENSE # MIT License
└── README.md # This file
The core calculation functions in src/calculations.ts are pure functions that can be reused in other projects (Node.js, Python via WASM, etc.).
Computes all material parameters from any two independent inputs.
Input:
interface MaterialParameters {
lambda?: number // Lamé's first parameter (Pa)
mu?: number // Shear modulus (Pa), also called G
E?: number // Young's modulus (Pa)
K?: number // Bulk modulus (Pa)
nu?: number // Poisson's ratio (dimensionless)
rho?: number // Density (kg/m³) - optional
}Output:
interface CalculationResult {
parameters: MaterialParameters // All computed parameters
derivations: string[] // Formulas used
warnings: string[] // Any warnings
}Example:
import { calculateAllParameters } from './calculations'
const result = calculateAllParameters({ E: 210e9, nu: 0.3 })
console.log(result.parameters.mu) // 80769230769.23077
console.log(result.derivations) // ['μ = E / (2(1 + ν))', ...]Checks if provided parameters are mathematically consistent.
Example:
import { checkConsistency } from './calculations'
const inconsistencies = checkConsistency({
lambda: 1e9,
mu: 1e9,
E: 10e9 // Wrong!
})
console.log(inconsistencies) // ['E inconsistent with λ and μ: ...']All pairwise combinations are implemented:
// From lambda and mu
calculateE_from_lambda_mu(lambda: number, mu: number): number
calculateNu_from_lambda_mu(lambda: number, mu: number): number
calculateK_from_lambda_mu(lambda: number, mu: number): number
// From E and nu
calculateMu_from_E_nu(E: number, nu: number): number
calculateLambda_from_E_nu(E: number, nu: number): number
calculateK_from_E_nu(E: number, nu: number): number
// ... and 15+ more combinationsSee src/calculations.ts for the complete API.
-
Install Netlify CLI:
npm install -g netlify-cli
-
Build the project:
npm run build
-
Deploy:
netlify deploy --prod --dir=dist
-
Configure custom domain:
- In Netlify dashboard, go to Domain settings
- Add custom domain:
www.smartlameparameters.space - Configure DNS records as instructed
-
Install Vercel CLI:
npm install -g vercel
-
Deploy:
vercel --prod
-
Configure custom domain:
- In Vercel dashboard, add domain
www.smartlameparameters.space - Update DNS records
- In Vercel dashboard, add domain
-
Build:
npm run build
-
Upload to S3:
aws s3 sync dist/ s3://www.smartlameparameters.space --delete
-
Configure CloudFront:
- Create CloudFront distribution pointing to S3 bucket
- Set default root object to
index.html - Configure custom error responses for SPA routing
- Add custom domain and SSL certificate
-
Update DNS:
- Point
www.smartlameparameters.spaceto CloudFront distribution
- Point
Comprehensive unit tests cover:
- ✅ All pairwise input combinations (λ+μ, E+ν, E+K, μ+ν, K+ν, K+μ, etc.)
- ✅ Edge cases (ν near 0.5, negative ν, zero moduli)
- ✅ Consistency conflict detection
- ✅ Input validation and bounds checking
- ✅ Real material examples (steel, aluminum, rubber)
Run tests:
npm testView coverage:
npm run test:coverage
open coverage/lcov-report/index.htmltest('Steel: E=210GPa, nu=0.3', () => {
const result = calculateAllParameters({ E: 210e9, nu: 0.3 })
expect(result.parameters.mu).toBeCloseTo(80.769e9, -7)
expect(result.parameters.lambda).toBeCloseTo(121.154e9, -7)
expect(result.warnings.length).toBe(0)
})Input:
- λ = 1e9 Pa (1 GPa)
- ν = 0.3
Expected Output:
- μ ≈ 1.154e9 Pa
- E ≈ 3.000e9 Pa
- K ≈ 1.769e9 Pa
Input:
- E = 210 GPa
- ν = 0.3
Expected Output:
- λ ≈ 121.154 GPa
- μ ≈ 80.769 GPa
- K ≈ 175 GPa
Input:
- λ = 1e9 Pa
- μ = 1e9 Pa
- ν = 0.45 (inconsistent!)
Expected Output:
- Error: "ν inconsistent with λ and μ: expected 0.25, got 0.45"
- Suggestion to use least-squares resolution (future feature)
- All calculations use double precision (Float64)
- Division-by-zero guards with tolerance
ε = 1e-12 - Relative error tolerance for consistency checks:
1e-6
For each pair of inputs, we:
- Use direct algebraic formulas when available
- Solve quadratic equations when necessary (e.g., λ + E → μ)
- Check for negative discriminants and singular denominators
- Return errors with actionable messages
- Least-squares solver for overdetermined systems
- Support for anisotropic materials
- Wave velocity calculations (P-wave, S-wave)
- Material database with presets
- 3D visualization of stress-strain relationships
- Export to PDF with derivations
This project is licensed under the MIT License. See LICENSE for details.
MIT License
Copyright (c) 2025 Paul Namalomba
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Paul Namalomba
- GitHub: @paulnamalomba
- Website: www.smartlameparameters.space
- Mathematical formulas based on standard continuum mechanics references
- Built with React, TypeScript, Vite, and Tailwind CSS
- Testing with Jest and React Testing Library
- CI/CD with GitHub Actions
- Hosted on Netlify/Vercel
- ✅
npm run buildproduces static site indist/ - ✅ All unit tests pass (
npm test) - ✅ CI/CD pipeline configured (
.github/workflows/ci.yml) - ✅ Netlify configuration (
netlify.toml) - ✅ Vercel configuration (
vercel.json) - ✅ Custom domain instructions provided
- ✅ README with complete documentation
- ✅ LICENSE file (MIT)
- ✅ TypeScript strict mode enabled
- ✅ ESLint and Prettier configured
- ✅ 80%+ test coverage achieved
- ✅ Accessibility features (ARIA, keyboard navigation)
- ✅ Responsive design (mobile-first)
- ✅ Export functionality (JSON, CSV, permalink)