-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnonLinearUpper.m
More file actions
41 lines (31 loc) · 989 Bytes
/
nonLinearUpper.m
File metadata and controls
41 lines (31 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
%clear all; clc;
function [opt,C11,C12,S11,S22] = nonLinearUpper(odf)
n = 388; %number of independent nodes
INVALID = 10000;
% max yield
% subject to: 0<=S11<=0.15
% 0<=S22<=0.10
% 0<=C11<=175
% 0<=C12<=75
load linprog_yield_node
yield = propmat;
load alphatitaniummedium;
odf = odf';%transpose of odf for multiplying with compliance and yield matrices
Cvector = stiffness*odf;
Cmatrix = reshape(Cvector,6,6);
C11 = Cmatrix(1,1); % constraint
C12 = Cmatrix(1,2); % constraint
Smatrix = inv(Cmatrix);
S11 = Smatrix(1,1); % constraint
S22 = Smatrix(2,2); % constraint
stress = yield*odf; % Yield stress averaging
opt = stress; % In this case the opt is stress
if C11<0 || C11>175 ||C12<0||C12>75 || S11<0 || S11>0.15 || S22<0 || S22>0.10
opt = INVALID;
end
println(opt)
println(S11)
println(S22)
println(C11)
println(C12)
opt = -opt % negating as we are trying to maximize