-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strain optimization #346
Strain optimization #346
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #346 +/- ##
==========================================
- Coverage 91.07% 90.93% -0.14%
==========================================
Files 70 72 +2
Lines 12367 12681 +314
==========================================
+ Hits 11263 11532 +269
- Misses 1104 1149 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
…metries/simsopt into strain_optimization_cu
f2 = J.J() | ||
errf = np.abs((f1-f2)/(2*eps) - df) | ||
errf_old = errf | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we add a test that checks whether the cost functions vanish for a circular coil.
Is this PR ready for another review? If so can you merge master in and resolve merge conflicts? |
@landreman Yes, it is ready. I have merged in master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Since StrainOpt
was not intended to be used as an objective function in optimization, the Opt
in the name might be confusing to users. So I took the liberty of renaming it to CoilStrain
, and adding to the docs to clarify. Hope that's ok. Feel free to merge whenever you're ready.
Thanks, Matt! |
This PR is based on work by @phuslage for the optimization of coil curves and the HTS winding angle to reduce torsional and hard-way bending strain as defined in :
The orientation of the HTS tape normal is defined by the FramedCurve class, which is inherited by FramedCurveFrenet or FramedCurveCentroid. The FramedCurve defines a curve and an orthonormal frame, where the tangent vector is aligned with the curve tangent. The frame can be rotated by an angle alpha with respect to the Frenet or centroid reference frames. The FramedCurve class evaluates geometric properties of the frame, such as the torsion and binormal curvature. This class is also used to set up a multi-filament coil using the CurveFilament class.
The strains are evaluated in the StrainOpt class, which is defined by a FramedCurve and a tape width. The objective functions LPTorsionalStrainPenalty and LPBinormalCurvatureStrainPenalty can be used for optimization with respect to the coil or rotation dofs.
An example of optimization with respect to the rotation dofs is provided in strain_optimization_simple.py