import { calculateWindPressure, getKz } from './src/utils/windLogic'; import { calculateSeismicDesign, getFa, getFv } from './src/utils/seismicLogic'; console.log('--- Verification Script ---'); // Wind Verification const windTest = () => { const speed = 100; const exposure = 'C'; const height = 30; // Expected: Kz ~ 0.98 for 30ft Exp C (simplified logic result needed) // Formula implemented: Kz = 2.01 * (z/zg)^(2/alpha) // For C: alpha=9.5, zg=900. z=30. // Kz = 2.01 * (30/900)^(2/9.5) = 2.01 * (0.0333)^0.2105 = 2.01 * 0.488 ~= 0.98. const kz = getKz(height, exposure); console.log(`Wind: Height=${height}, Exposure=${exposure} -> Kz=${kz} (Expected ~0.98)`); const qz = calculateWindPressure(speed, exposure, height); // qz = 0.00256 * Kz * 1.0 * 0.85 * 100^2 // qz = 0.00256 * 0.98 * 0.85 * 10000 = 21.32 console.log(`Wind: Speed=${speed} -> qz=${qz.toFixed(2)} (Expected ~21.32)`); }; // Seismic Verification const seismicTest = () => { const ss = 0.2; const s1 = 0.1; const siteClass = 'D'; const { sds, sd1 } = calculateSeismicDesign(ss, s1, siteClass); // Logic: // Fa for Site Class D, Ss=0.2 -> 1.6 // Fv for Site Class D, S1=0.1 -> 2.4 const fa = getFa(siteClass, ss); const fv = getFv(siteClass, s1); console.log(`Seismic: Site=${siteClass}, Ss=${ss}, S1=${s1} -> Fa=${fa}, Fv=${fv} (Expected 1.6, 2.4)`); // Sds = 2/3 * Fa * Ss = 2/3 * 1.6 * 0.2 = 0.2133 // Sd1 = 2/3 * Fv * S1 = 2/3 * 2.4 * 0.1 = 0.16 console.log(`Seismic: Sds=${sds.toFixed(4)} (Expected 0.2133)`); console.log(`Seismic: Sd1=${sd1.toFixed(4)} (Expected 0.1600)`); }; windTest(); seismicTest();