👨‍💻

2D Truss Topology Optimization MATLAB Code solved by OC,MMA,fmincon

Date
TagsFEMMATLABStudyTopology Optimization
AuthorHenry
💡
In this post, topology optimization for a simple 2D Truss system is implemented with three common optimizers: OC, MMA, and fmincon.

This post aims to show how the same topology optimization problem can be solved by different optimizers. MATLAB codes are attached at the end.

Cantilever beam example

Number of DOFs 66 Number of elements 92

Obj: min Comp, s.t.: Vol<=Vmax

OC

Objective: 0.0124
iteration: 17
time: 0.026

fmincon

Objective: 0.0116
iteration: 179
time: 0.653

MMA

Objective: 0.0115
iteration: 77
time: 0.293

More details of these optimizers can be found in the related post.

OC

MMA

fmincon

Setup

Unzip the attached file, run TO_truss_Area_fmincon.m , TO_truss_Area_mma.m, TO_truss_Area_oc.m

The code is set to plot the design on every iteration, It is nice to see how the structure optimization process but drawing a plot will significantly increase the computation time. It can be turned off by changing the below line.

fmincon_opt.plotSwitch='on'; % 'off'

How do you like this Post

Attachment

Download code from below GitHub repo 👇, please give a five star 👆

https://github.com/hyhsuen/TO2DTrussOC_MMA_fmincon