morphogen.laser.design¶
Design of laser-architectured sheets: the simulation of a case and the optimization of its laser path.
A SheetCase gathers the choices of a study: the base material and its
thickness, the treatment (hardening, or carburizing, nitriding, alloying in the melt
pool), the laser configuration (one beam, or two aligned beams on both faces), the
specimen and its mesh, and the pattern of the tracks. SheetCase.evaluate() runs
the chain: the path drawn on the parallel part of the specimen, the treatment at the
Gauss points of the mesh (morphogen.laser.process), the flow law of each point
and layer (morphogen.laser.materials), the tensile test
(morphogen.laser.mechanics), and the measures (MEASURES) — or, with the
loading cell, the periodic cell of the sheet treated all over and its homogenized
tensile tests (morphogen.laser.periodic).
Objectives (OBJECTIVES, maximized): strength_ductility the product of
the tensile strength and the uniform elongation (MPa, the balance of the “banana” chart
of AHSS), energy the work absorbed up to necking (MJ/m³, the area under the
engineering curve up to the maximum force), uniform_elongation,
tensile_strength, yield_strength; target: the opposite of the squared
relative distances to target measures. Constraints bound any measure, e.g. the
reinforced volume fraction, the yield strength, the smallest gap between tracks (their
neighbours temper them) or the smallest radius of curvature of a track (the
quasi-steady thermal cycles need radii larger than the heated width), the length of the
path in the specimen (the time and energy of the process); a violation adds a penalty.
Optimization (optimize()) of the parameters of the pattern and of the laser
(dotted names: pattern.amplitude, pattern.coefficients.1.0, beam.power,
bottom.power…), each between bounds, by grid (the full factorial of the
thesis’s parametric studies), nelder_mead, differential_evolution (SciPy),
genetic (morphogen.design.search.genetic_algorithm()) or bayesian: a
Gaussian process (Matérn 5/2, automatic relevance, hyperparameters by the marginal
likelihood) fitted to the penalized costs of a Latin hypercube of first designs, then
the design of largest expected improvement at each evaluation (Jones et al. 1998), for
the costly finite element evaluations.
- morphogen.laser.design.MEASURES = ('yield_strength', 'tensile_strength', 'uniform_elongation', 'energy', 'strength_ductility', 'failure_strain', 'ductility', 'bending_load', 'bending_stiffness', 'bending_load_at_deflection', 'bending_energy', 'volume_fraction', 'area_fraction', 'mean_hardness', 'max_hardness', 'melted_fraction', 'peak_temperature', 'path_length', 'laser_time', 'laser_energy', 'min_gap', 'min_radius', 'yield_anisotropy', 'strength_anisotropy', 'elongation_anisotropy', 'r_value', 'r_anisotropy', 'r_bar', 'delta_r', 'hill_f', 'hill_g', 'hill_h', 'hill_n')¶
of the tensile test (MPa, engineering strain, MJ/m³), of the bending test (N, N/mm, mJ), of the treated parallel part (fractions, HV, °C), of the process (mm, s, J), and with several directions the anisotropy (the spread of a measure over the directions over its mean); the measures of one direction
dtake the suffix_d(yield_strength_45).- Type:
Measures of a case
- morphogen.laser.design.OBJECTIVES = ('strength_ductility', 'energy', 'uniform_elongation', 'ductility', 'tensile_strength', 'yield_strength', 'bending_load_at_deflection', 'bending_energy', 'bending_load', 'isotropy', 'flow_isotropy', 'target')¶
measures,
isotropy(the opposite of the anisotropy of the yield strength),flow_isotropy(of the Lankford coefficient) andtarget(the opposite of the squared relative distances to target measures).- Type:
Objectives (maximized)
- morphogen.laser.design.LOADINGS = ('tension', 'bending', 'cell')¶
Load cases.
- morphogen.laser.design.CELL_KEYS = ('kind', 'vectors', 'element', 'along')¶
The keys of the loading
cellthat set the cell (the others go to its test).
- morphogen.laser.design.CELL_REACH = 5.0¶
the heat of the tracks.
- Type:
How far around the periodic cell its pattern is drawn (mm)
- morphogen.laser.design.METHODS = ('grid', 'nelder_mead', 'differential_evolution', 'genetic', 'bayesian')¶
Optimization methods.
- morphogen.laser.design.hill48(r_values: dict) dict[source]¶
Hill’s 1948 criterion of a sheet from its Lankford coefficients at 0°, 45° and 90° (
{direction: r}):F,G,H,Nnormalized byG + H = 1(F = r0 / (r90 (1 + r0)),G = 1/(1 + r0),H = r0/(1 + r0),N = (r0 + r90)(1 + 2 r45) / (2 r90 (1 + r0)); isotropy: 0.5, 0.5, 0.5, 1.5), the normal anisotropyr̄ = (r0 + 2 r45 + r90)/4and the planarΔr = (r0 − 2 r45 + r90)/2; NaN without the three directions.
- class morphogen.laser.design.SheetResult(path: LaserPath, treatment: TreatmentResult, tensile: TensileResult | None, measures: dict, time_s: float = 0.0, bending: BendingResult | None = None, directions: dict = <factory>)[source]¶
Bases:
objectThe evaluation of a case: its path, the treated sheet at the Gauss points (or at the fibres of the bending sections), the tensile test or the bending test, the measures; with several directions, the result of each (
directions, by angle), the others being those of the first.
- class morphogen.laser.design.SheetCase(material: SheetMaterial | str = 'annealed_ms1500', specimen: Specimen = <factory>, beam: Beam = <factory>, bottom: Beam | None = <factory>, configuration: str = 'symmetric', treatment: str = 'hardening', alloying: dict | None = None, layers: int = 4, pattern: dict = <factory>, pause: float = 30.0, element: float = 0.5, loading: dict = <factory>, ambient: float = 20.0, directions: tuple | None = None)[source]¶
Bases:
objectThe choices of a study (see the module).
beam: the beam of the upper face (and of both faces in thesymmetricconfiguration unlessbottomis given);pattern: the kind and parameters ofmake_pattern();element: the size of the elements (mm);loading: the load case,kindtension(the default; the other keys are options oftensile_test()) orbending(three-point bending of the strip:span,deflectionthe reference deflection,sectionsalong the span, the fibres across the width at aboutelement;three_point_bending()) orcell(the periodic cell of the sheet treated all over by the pattern repeated: its lattice from the pattern orvectors, its elements ofelementmm; the other keys are options ofcell_test(); the measures of the treatment over the cell, those of the path over the parallel part of the specimen);directions: angles (degrees) of the tensile axis from the x axis of the pattern (the rolling direction), a specimen for each (the pattern turned by the opposite angle; the cell is pulled in each direction instead): the measures are their means, each one’s with its suffix, and the anisotropies.- laser_treatment() LaserTreatment[source]¶
The treatment of the sheet (cached: its tabulated cycles are reused).
- with_values(values: dict) SheetCase[source]¶
A copy with parameters set by dotted names (
pattern.amplitude,beam.power,bottom.radius,specimen.width,layers…).
- evaluate(*, keep_fields: bool = False) SheetResult[source]¶
Run the chain (see the module), in each direction if several.
- cell()[source]¶
The periodic cell of the treated sheet (
PeriodicCell): the lattice of the pattern (its lengthalongstraight tracks from the loading if given), or thevectorsof the loading, its elements ofelementmm (or the loading’selement), centred on the parallel part of the specimen.
- morphogen.laser.design.case_measures(case: SheetCase, path: LaserPath, treat: TreatmentResult, tens: TensileResult | None, bend: BendingResult | None = None, *, inside=None) dict[source]¶
The measures (
MEASURES) of an evaluated case: those of the tensile or of the bending test (NaN for the other), and those of the treated parallel part (or of the pointsinside: the periodic cell) and of the path.
- class morphogen.laser.design.Parameter(name: str, low: float, high: float, integer: bool = False)[source]¶
Bases:
objectA design variable: a dotted name (see
SheetCase.with_values()), its bounds, whether it takes integer values.
- class morphogen.laser.design.OptimizationResult(values: dict, result: SheetResult | None, objective: float, feasible: bool, history: list, method: str, evaluations: int, time_s: float, settings: dict = <factory>)[source]¶
Bases:
objectThe best values found, their evaluation, the objective and the history of every evaluation (values, measures, objective, penalty, cost).
- morphogen.laser.design.optimize(case: SheetCase, parameters, *, objective: str = 'strength_ductility', constraints=None, target=None, method: str = 'bayesian', evaluations: int = 40, initial: int | None = None, levels=5, penalty: float = 100.0, seed: int = 0, callback=None, **options) OptimizationResult[source]¶
Optimize the parameters of a case (see the module).
parameters: a mapping of dotted names to[low, high]([low, high, true]for integers) orParameters;constraints: a mapping of measures to[low, high](None for no bound);target: the target measures of the objectivetarget;evaluations: the budget of evaluations (grid:levelsper parameter instead);initial: the first designs of the Bayesian optimization (Latin hypercube; default 2 d + 2);options: those of the SciPy methods.
- class morphogen.laser.design.GaussianProcess(x, y, *, seed: int = 0)[source]¶
Bases:
objectGaussian process regression of costs on the unit cube: a constant mean, a Matérn 5/2 kernel with a length scale per dimension, a nugget; the hyperparameters maximize the marginal likelihood (L-BFGS-B from a few starts).