Using opti.variable inside asb.Aerobuildup #156
-
I want to create an optimization environment, where i define a flying wing in 10 total segments. Every segment, corresponds to an asb.XSec and has different dihedral angle and twist angle. The goal is to choose the best combination of dihedral and twist angle for every segment using asb.Aerobuildup and minimizing aero["CD"]. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, that should work! You will want to define these as Then, put that On a more conceptual note rather than a computational one: don't forget to set reasonable other constraints (e.g., lift constraint, zero-moment, span constraint), otherwise you may accidentally create an unbounded or impractical optimization problem. Setting upper and lower bounds on the twist and dihedral can also help, as the solver will use this information to scale the optimization problem to be better-conditioned. |
Beta Was this translation helpful? Give feedback.
Yes, that should work! You will want to define these as
opti.variable()
during the geometry creation. To put in dihedral, you will need to modify thexyz_le
of theasb.WingXSec
objects within the wing (as the cross sections are parameterized by position, not dihedral angle).Then, put that
asb.Wing
into anasb.Airplane
, and you can callasb.AeroBuildup
on it. From there, you can doopti.minimize()
on the resulting CD, and set up your optimization problem.On a more conceptual note rather than a computational one: don't forget to set reasonable other constraints (e.g., lift constraint, zero-moment, span constraint), otherwise you may accidentally create an unbounded or impractical optimiz…