Add OrcaFlex + PyGAD GA workflow for black-box ED optimization#1
Open
Add OrcaFlex + PyGAD GA workflow for black-box ED optimization#1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
config.pyto centralize model path, object/result names, variable bounds, GA settings, damping-mode options (same,fixed_axial,separate), and helpersbuild_gene_space/decode_solutionfor gene ordering and decoding.orcaflex_runner.pywhich encapsulates OrcFxAPI usage: loadsbase.dat, updatesTurretmass, centre-of-mass Z, sets geometry to three equal cylinder segments, writes added-mass/damping (with resilient attribute lookup), callsCalculateStatics()andRunSimulation(), snapshots simulation, and returns anEvalResult(stress or error).metrics.pyto robustly extract a line time history forVon Mises Stress, take the time-series maximum, and convert units to MPa when appropriate.run_ga.pyas the GA driver usingpygad.GA: constructs gene space fromconfig.py, decodes solutions to parameters, evaluates each candidate viaOrcaFlexRunner, computes a penalized fitness (minimizemax_t(stress)-> maximize1/(stress+penalty)), logs per-evaluation records, prints per-eval and per-generation summaries, and writesresults/best_solution.jsonandresults/eval_log.csv.results/cases, failed simulations are converted to a very poor fitness via an infinite-stress/large-penalty mapping, and damping writing supports configurable modes (same/fixed/separate).Testing
python -m py_compile config.py metrics.py orcaflex_runner.py run_ga.py, which completed successfully.Codex Task