thermal stress optimization - fmincon

1 visualizzazione (ultimi 30 giorni)
Jaejin Jeon
Jaejin Jeon il 8 Giu 2019
Commentato: Matt J il 9 Giu 2019
Hi,
I'm using fmincon for stress optimization but there are errors.
The script looks messy due to complicated parameters but the functions are simple.
% file name: thermalstressobj.m
function f = thermalstressobj(x)
l = linspace(0,x,100);
E_1=8.5E10; nu_1=0.34; G_1=3.17e10;CTE_1=1.7e-5;
E_2=2.2e9; nu_2=0.26; G_2=900e8; CTE_2=3.2e-5;
h_1 = 1e-3; h_2 = 1e-4;
D_1 = E_1*h_1^3/(12*(1-nu_1^2)); D_2 = E_2*h_2^3/(12*(1-nu_2^2));
D=D_1+D_2;
lambda_1=(1-nu_1^2)/(E_1*h_1); lambda_2=(1-nu_2^2)/(E_2*h_2);
lambda = lambda_1+lambda_2+(h_1+h_2)^2/(4*D);
kappa_1 = 2*(1+nu_1)*h_1/(3*E_1); kappa_2 = 2*(1+nu_2)*h_2/(3*E_2);
kappa = kappa_1+kappa_2;
large_K = 1/(((1-nu_1^2)*h_1/E_1 + (1-nu_2^2)*h_2/E_2));
small_K = sqrt(lambda/kappa);
mu = (h_1*D_2-h_2*D_1)/(2*D);
alpha = (large_K*D/(4*D_1*D_2))^(1/4);
epsilon = D/(D_1*D_2)*mu^2/lambda;
q_0 = -2/3*(2-epsilon)*alpha^4*small_K^2-((1+epsilon)/3*small_K^2)^3;
q_1 = 4/3*alpha^4+((1+epsilon)/3*small_K^2)^2;
small_d = q_0^2+q_1^3;
small_a = (-q_0+sqrt(small_d))^(1/3); small_b = -(abs(-q_0-sqrt(small_d)))^(1/3);
mu_1 = -(small_a+small_b)/2 + (1+epsilon)/3*small_K^2; mu_2 = sqrt(3)*(small_a-small_b)/2;
zeta_1 = small_a+small_b;
gamma_1 = sqrt(1/2*(sqrt(mu_1^2+mu_2^2)+mu_1)); gamma_2 = sqrt(1/2*(sqrt(mu_1^2+mu_2^2)-mu_1));
beta_1 = sqrt(zeta_1 + (1+epsilon)/3*small_K^2);
u = beta_1*x; v_1 = gamma_1*x; v_2 = gamma_2*x;
D_0 = (gamma_1 + 3/2*zeta_1/mu_2*gamma_2 + (gamma_2-3/2*zeta_1/mu_2*gamma_1)*sin(2*v_2)/sinh(2*v_1))*tanh(u)-beta_1*(coth(2*v_1)-cos(2*v_2)/sinh(2*v_1));
C_1 = -(CTE_2-CTE_1)*150/(kappa*D_0)*(coth(2*v_1)-cos(2*v_2)/sinh(2*v_1))/cosh(u);
C_3 = (CTE_2-CTE_1)*150/(kappa*D_0)*(sin(v_2)/sinh(v_1) + 3/2*zeta_1/mu_2*cos(v_2)/cosh(v_1))*tanh(u);
C_5 = (CTE_2-CTE_1)*150/(kappa*D_0)*(cos(v_2)/cosh(v_1) - 3/2*zeta_1/mu_2*sin(v_2)/cosh(v_1))*tanh(u);
tau = abs(C_1*sinh(beta_1*l) + C_3*cosh(gamma_1*l).*sin(gamma_2*l)+C_5*sinh(gamma_1*l).*cos(gamma_2*l));
f = max(tau);
and
% file name: thermalstressconstr.m
function [c, ceq] = thermalstressconstr(x)
R_th1 = 1e-3/(401*10e-3^2)+1e-4/(58.7*10e-3^2);
R_th2 = (1/((1e-3)/(401*(2*x).^2) + 1/(1e-3)/(3*(10e-3^2-(2*x).^2))))^-1 + (1/((1e-4)/(58.7*(2*x).^2) + 1/(1e-4)/(3*(10e-3^2-(2*x).^2))))^-1;
c = R_th2/R_th1-1.2;
ceq = [];
end
A maximum stress does not occur in specific points like edge or vertex, so linspace and max(tau) are used.
The constraint is ratio of initial thermal resistance to optimized one.
Actually I'm not familiar with MATLAB so I used optimization tool but I cannot find optimized value.
How can I fix the erroe?
  7 Commenti
Walter Roberson
Walter Roberson il 8 Giu 2019
You cannot expect fmincon to be able to converge on any function that uses max(). The mathematics that fmincon uses to find the minima is not valid on functions that use max() or min()
Matt J
Matt J il 9 Giu 2019
That's right. You would need to use fminimax. But even then, it seems way overkill for a 1D function minimization.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by