Pipe Assembly Lab v1.3: four power-piping research sections, FE operators and validation
b71ad8d verified Download example_power.cjs from HaomingLuo/AgentFEM-Pipe-ROM: direct link, hf CLI and curl.
- Browser
- Download file 959 Bytes
-
https://huggingface.co/HaomingLuo/AgentFEM-Pipe-ROM/resolve/main/example_power.cjs
- Command line
-
hf download hf://HaomingLuo/AgentFEM-Pipe-ROM/example_power.cjs
-
curl -L -o example_power.cjs https://huggingface.co/HaomingLuo/AgentFEM-Pipe-ROM/resolve/main/example_power.cjs
959 Bytes
| // Run from the downloaded model repository: node example_power.cjs | |
| const fs=require('node:fs'),path=require('node:path'),{solve}=require('./solver.js'); | |
| const library=JSON.parse(fs.readFileSync(path.join(__dirname,'data/catalog.json'))); | |
| for(const family of library.powerFamilies){ | |
| const ids=[`power-${family.id}-straight-r8`,`power-${family.id}-elbow-r3`,`power-${family.id}-straight-r8`]; | |
| const components=ids.map(id=>JSON.parse(fs.readFileSync(path.join(__dirname,'data',id+'.json')))); | |
| const input={components,deltaT:family.temperature,supports:[{node:0,fixed:[0,1,2,3,4,5]},{node:3,spring:[0,0,100000,0,0,0]}]}; | |
| const r=solve(input); | |
| const h=solve({...input,harmonic:{node:3,axis:1,force:1000,frequency:r.frequency[0],zeta:.02,damper:{node:3,axis:1,c:10000}}}).harmonic; | |
| console.log(JSON.stringify({family:family.id,mass_kg:r.mass,max_displacement_mm:1000*r.maxDisplacement,f1_Hz:r.frequency[0],probe_with_damper_mm:1000*h.current.amplitude})); | |
| } | |