Appendix A. MATLAB Scripts

Script 1: Solving single-objective optimization problems of objectives A and T, respectively, in the pyramid example.
objfun_s.mfunction f = objfun_s(x)f = 2∗x(1)∗sqrt((0.5∗x(1)) ˆ 2+x(2) ˆ 2);objfun_t.mfunction f = objfun_t(x)
f = 2∗x(1)∗sqrt((0.5∗x(1)) ˆ 2+x(2) ˆ 2)+x(1) ˆ 2;
confun.mfunction [c, ceq] = confun(x)% Nonlinear inequality constraintsc = 1500-x(1) ˆ 2∗x(2)/3;% Nonlinear equality constraintsceq = [];x0 = [10,10]; % Make a starting guess at the solutionoptions = optimset('Algorithm','active-set');[x_s,fval_s] = fmincon(@objfun_s,x0,[],[],[],[],[],[],@confun, options);[x_s,fval_s]       % Print results.[x_t,fval_t] = fmincon(@objfun_t,x0,[],[],[],[],[],[],@confun, options);[x_t,fval_t]       % Print results. ...

Get Design Theory and Methods using CAD/CAE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.