From 39ca311d3fd6b52e749df3f581e48b77f9bcaf88 Mon Sep 17 00:00:00 2001 From: Bharat Medasani Date: Thu, 7 Dec 2023 10:35:37 +1100 Subject: [PATCH] Update strain_optimization.py Update some parameters in the strain optimization example. Give credit to Paul Huslage --- examples/2_Intermediate/strain_optimization.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/2_Intermediate/strain_optimization.py b/examples/2_Intermediate/strain_optimization.py index cb04ba2b7..5871c9c05 100755 --- a/examples/2_Intermediate/strain_optimization.py +++ b/examples/2_Intermediate/strain_optimization.py @@ -9,12 +9,14 @@ 86 (2020), doi:10.1017/S0022377820001208. The orientation of the tape is defined with respect to the Frenet-Serret Frame + +Authors: Paul Huslage, Elizabeth Paul """ import numpy as np from scipy.optimize import minimize from simsopt.geo import CoilStrain, LPTorsionalStrainPenalty, LPBinormalCurvatureStrainPenalty -from simsopt.geo import FrameRotation, FramedCurveFrenet, CurveXYZFourier +from simsopt.geo import FrameRotation, FramedCurveCentroid, CurveXYZFourier from simsopt.configs import get_hsx_data from simsopt.util import in_github_actions @@ -26,15 +28,15 @@ curve_scaled = CurveXYZFourier(curve.quadpoints, curve.order) curve_scaled.x = curve.x * scale_factor # scale coil to magnify the strains rot_order = 10 # order of the Fourier expression for the rotation of the filament pack -width = 1e-3 # tape width +width = 3e-3 # tape width curve_scaled.fix_all() # fix curve DOFs -> only optimize winding angle rotation = FrameRotation(curve_scaled.quadpoints, rot_order) -framedcurve = FramedCurveFrenet(curve_scaled, rotation) +framedcurve = FramedCurveCentroid(curve_scaled, rotation) -tor_threshold = 0.02 # Threshold for strain parameters -cur_threshold = 0.02 +tor_threshold = 0.002 # Threshold for strain parameters +cur_threshold = 0.002 Jtor = LPTorsionalStrainPenalty(framedcurve, p=2, threshold=tor_threshold) Jbin = LPBinormalCurvatureStrainPenalty(