Composipy Optimization Functions#
This page contains functions used to optimize the composite plate. Optimization algorithms are gradient based and they use Scipy as optimization engine.
Since optimization is continuous they result in Lamination Parameters as output. Lamination Parameters are then supposed to be converted into stacking sequences by the user.
The two minimize functions address different failure modes independently. To size a panel, run both and take the result with the larger thickness T — that is the governing constraint.
Maximize Buckling Load#
- composipy.optimize.maximize_buckling_load(a, b, T, E1, E2, v12, G12, Nxx=0, Nyy=0, Nxy=0, m=7, n=7, panel_constraint='PINNED', options=None, tol=None, plot=False, points_to_plot=30, penalty=True)[source]#
- Parameters
a (float) – Plate dimension a
b (float) – Plate dimension b
E1 (float) – Young Modulus direction 1
E2 (float) – Young Modulus direction 2
v12 (float) – Poisson ratio
G12 (float) – Shear Modulus
Nxx (float, default 0) – Normal load in x direction
Nyy (float, default 0) – Normal load in y direction
Nxy (float, default 0) – Normal load in xy direction
m (float, dafault 7) – Size of shape function along x axis
n (float, default 0) – Size of shape function along y axis
panel_constraint (composipy constraints format) – Plate boundary constraints
options (scipyminimize optiions) –
tol (scipy minimize tol) –
plot (bool, default False) – Plot optimization function
points_to_plot (float, default 30) – Number of points to plot
penalty (bool, default True) – Applies boundary conditions into the feasible region. If penalty is True, the boundary condition is the triangle the delimits 0, 45, 90° If penalty is False, the boundary conditions is the parabola that defines the natural constraints.
- Returns
res
- Return type
scipy minimize result
Minimize Panel Weight (Buckling)#
- composipy.optimize.minimize_panel_weight(a, b, E1, E2, v12, G12, Nxx=0, Nyy=0, Nxy=0, m=7, n=7, x0=[0.1, 0.0, 0.0], panel_constraint='PINNED', options=None, tol=None)[source]#
- Parameters
a (float) – Plate dimension a
b (float) – Plate dimension b
E1 (float) – Young Modulus direction 1
E2 (float) – Young Modulus direction 2
v12 (float) – Poisson ratio
G12 (float) – Shear Modulus
Nxx (float, default 0) – Normal load in x direction
Nyy (float, default 0) – Normal load in y direction
Nxy (float, default 0) – Normal load in xy direction
m (float, dafault 7) – Size of shape function along x axis
n (float, default 0) – Size of shape function along y axis
x0 (list, default [0.1, 0.0, 0.0]) – Initial value
panel_constraint (composipy constraints format) – Plate boundary constraints
options (scipyminimize optiions) –
tol (scipy minimize tol) –
plot (bool, default False) – Plot optimization function
points_to_plot (float, default 30) – Number of points to plot
- Returns
res
- Return type
scipy minimize result
Minimize Panel Weight (Strain)#
- composipy.optimize.minimize_panel_weight_strain(a, b, E1, E2, v12, G12, Nxx=0, Nyy=0, Nxy=0, epsilon_allow=-0.0035, x0=None, panel_constraint='PINNED', options=None, tol=None)[source]#
Minimizes composite panel weight subject to a minimum principal midplane strain constraint.
The optimization problem is:
minimize T subject to epsilon_min(T, xi1, xi3) >= epsilon_allow (strain)
xi3 + 2*xi1 + 1 >= 0 (LP feasibility g1) xi3 - 2*xi1 + 1 >= 0 (LP feasibility g2) T > 0, -1 <= xi1 <= 1, -1 <= xi3 <= 1
where epsilon_min is the minimum (most compressive) principal strain at the laminate midplane, computed via Mohr’s circle from the applied membrane loads.
The objective is T (not T^3) because the membrane stiffness A scales linearly with thickness, making T the natural objective for strain-driven sizing. Compare with
minimize_panel_weightwhich uses T^3 because bending stiffness D scales with T^3 for buckling-driven sizing.This function addresses the strain failure mode independently from buckling. To also check buckling, run
minimize_panel_weightseparately and compare the two results — the governing (thicker) solution drives the final design.- Parameters
a (float) – Plate dimension along x axis (mm or consistent length unit).
b (float) – Plate dimension along y axis.
E1 (float) – Young modulus in the fibre direction.
E2 (float) – Young modulus transverse to the fibre.
v12 (float) – Poisson ratio.
G12 (float) – In-plane shear modulus.
Nxx (float, default 0) – Membrane load in x direction (N/mm or consistent force/length unit).
Nyy (float, default 0) – Membrane load in y direction.
Nxy (float, default 0) – Membrane shear load.
epsilon_allow (float, default -3500e-6) – Minimum principal strain allowable (negative for compression). The constraint enforces epsilon_min >= epsilon_allow. Default is -3500 microstrain, a typical industry value for composite laminates under compression-dominated loading.
x0 (list or None, default None) – Initial guess [T, xi1, xi3]. If None, defaults to [0.1, 0.0, 0.0].
panel_constraint (str or dict, default 'PINNED') – Plate boundary conditions in composipy format. Kept for API consistency with other optimization functions; not used in the strain calculation (strains depend only on ABD and loads, not plate geometry or BCs).
options (dict or None) – Options passed directly to
scipy.optimize.minimize.tol (float or None) – Tolerance passed directly to
scipy.optimize.minimize.
- Returns
res – Optimization result. Key fields: -
res.x-> [T_opt, xi1_opt, xi3_opt] -res.fun-> optimized objective T -res.success-> True if converged- Return type
scipy.optimize.OptimizeResult
Notes
The minimum principal strain is computed at the laminate midplane using the membrane loads only (moments = 0). For bending-dominated cases a more detailed through-thickness analysis would be needed.
The strain allowable
epsilon_allowshould be provided as a dimensionless strain value (e.g. -3500e-6, not -3500). Typical aerospace industry values for carbon/epoxy laminates range from -3000e-6 to -4000e-6 for compression.To obtain the final panel design, run both this function and
minimize_panel_weight(buckling) and take the result with the larger thickness T — that is the governing constraint.Examples
>>> from composipy.optimize import minimize_panel_weight_strain >>> res = minimize_panel_weight_strain( ... a=500, b=250, ... E1=128000, E2=13000, v12=0.3, G12=6400, ... Nxx=-200, Nyy=0, Nxy=0, ... epsilon_allow=-3500e-6, ... ) >>> T_opt, xi1_opt, xi3_opt = res.x