Round design variables, objectives, and constraints to appropriate decimal precision based on physical units (4 decimals for mm, degrees, MPa). - Added _get_precision() method with unit-based precision mapping - Round design variables when sampled from Optuna - Round extracted results (objectives and constraints) - Added units field to objectives in config files - Tested: values now show 4 decimals instead of 17+ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.3 KiB
JSON
53 lines
1.3 KiB
JSON
{
|
|
"design_variables": [
|
|
{
|
|
"name": "tip_thickness",
|
|
"type": "continuous",
|
|
"bounds": [15.0, 25.0],
|
|
"units": "mm",
|
|
"initial_value": 20.0
|
|
},
|
|
{
|
|
"name": "support_angle",
|
|
"type": "continuous",
|
|
"bounds": [20.0, 40.0],
|
|
"units": "degrees",
|
|
"initial_value": 35.0
|
|
}
|
|
],
|
|
"objectives": [
|
|
{
|
|
"name": "minimize_max_stress",
|
|
"description": "Minimize maximum von Mises stress",
|
|
"extractor": "stress_extractor",
|
|
"metric": "max_von_mises",
|
|
"direction": "minimize",
|
|
"weight": 10.0,
|
|
"units": "MPa"
|
|
}
|
|
],
|
|
"constraints": [
|
|
{
|
|
"name": "max_displacement_limit",
|
|
"description": "Maximum allowable displacement",
|
|
"extractor": "displacement_extractor",
|
|
"metric": "max_displacement",
|
|
"type": "upper_bound",
|
|
"limit": 1.0,
|
|
"units": "mm"
|
|
}
|
|
],
|
|
"optimization_settings": {
|
|
"n_trials": 50,
|
|
"sampler": "TPE",
|
|
"n_startup_trials": 20,
|
|
"tpe_n_ei_candidates": 24,
|
|
"tpe_multivariate": true,
|
|
"comment": "20 random trials for exploration, then 30 TPE trials for exploitation"
|
|
},
|
|
"model_info": {
|
|
"sim_file": "C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\examples\\bracket\\Bracket_sim1.sim",
|
|
"note": "Stress minimization with displacement constraint (mass not available in OP2)"
|
|
}
|
|
}
|