Magnetic Actuator Topology Optimization
Overview
A magnetic actuator uses the force between a coil (or permanent magnet) and a magnetisable structure. MagneticActuatorTopOpt optimizes the layout of the deformable, magnetisable structure to maximize the output displacement, coupling mechanics to magnetostatics through the material’s permeability.
using RasmahA magnetically-pulled structure
Same template as the other actuators: ground one side, electrode the other, clamp the top/bottom, ask for maximum centre displacement.
m = tetrahedralize_box(1.0, 1.0, 1.0, 3, 3, 3)
nn = size(m.nodes, 2)
electrode = [i for i in 1:nn if m.nodes[1, i] < 1e-6]
ground = [i for i in 1:nn if m.nodes[1, i] > 0.999]
fixed_u = Int[]
for i in 1:nn
(m.nodes[2, i] < 1e-6 || m.nodes[2, i] > 0.999) && append!(fixed_u, 3i - 2, 3i - 1, 3i)
end
out = zeros(3nn)
out[3 * argmin(abs.(m.nodes[2, :] .- 0.5)) - 2] = 1.0
x, hist = solve(MagneticActuatorTopOpt(), m,
Material(youngs_modulus = 1e9, poisson_ratio = 0.3, relative_permeability = 4.0);
electrode = electrode, ground = ground, fixed_u = fixed_u, output = out,
V = 1.0, volfrac = 0.5, max_iter = 20)([0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001 … 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001], [-1.028392128651673e-6, -4.053171445232e-6, -6.115341673282266e-5, -0.0020483301251818897, -0.05621702832734428, -213.99180519564803, -222.46696464899892, -222.73899660513922, -223.65713972392604, -230.76265010955592, -231.53956372439717, -231.98061129436883, -233.74274709723724, -194.75959641159497, -217.45346766024323, -234.5560033898679, -221.6727874927535, -228.94987925861338, -234.16481262590617, -226.2599438198105])
Verification — the output displacement grows
println("objective: ", round(hist[1]; digits = 4), " → ", round(hist[end]; digits = 4))
println("displacement grows: ", hist[end] < hist[1])
println("density in [0,1]: ", all(0 .<= x .<= 1))objective: -0.0 → -226.2599
displacement grows: true
density in [0,1]: true
vtk(m; field = x, fieldname = "actuator density", edges = true)Next steps
- Magnetostatics — the magnetic field underneath.
- Magneto-elastic topology optimization — the coupled stiffness objective.
