clear clc clf M = csvread('Module2_Layout1_Config1_Story5main.csv',0,1); w_weight = 0.33; w_cost = 0.33; w_carbon = 0.33; weight_conc = 1; weight_steel = 1; cost_conc = 0.022; cost_steel = 0.75; cost_mom = 750; carbon_conc = 0.25; carbon_steel = 3.37; carbon_mom = 0; [n,m] = size(M); Resultstemp = zeros(n,3); % [Weight, Cost, Embodied Carbon, Objective Function] for i = 1:n Resultstemp(i,1) = ((M(i,7))*weight_conc) + ((M(i,8))*weight_steel); Resultstemp(i,2) = ((M(i,7))*1000*cost_conc) + ((M(i,8))*1000*cost_steel) + ((M(i,9))*cost_mom); Resultstemp(i,3) = ((M(i,7))*1000*carbon_conc) + ((M(i,8))*1000*carbon_steel) + ((M(i,9))*carbon_mom); end YResults_weight = zeros(n,1); YResults_cost = zeros(n,1); YResults_carbon = zeros(n,1); XResults_weight = zeros(n,1); XResults_cost = zeros(n,1); XResults_carbon = zeros(n,1); ZResults_weight = zeros(n,1); ZResults_cost = zeros(n,1); ZResults_carbon = zeros(n,1); for i = 1:n YResults_weight(i,1) = Resultstemp(i,1); YResults_cost(i,1) = Resultstemp(i,2); YResults_carbon(i,1) = Resultstemp(i,3); end weight_std = std(YResults_weight); weight_mean = mean(YResults_weight); cost_std = std(YResults_cost); cost_mean = mean(YResults_cost); carbon_std = std(YResults_carbon); carbon_mean = mean(YResults_carbon); for i = 1:n XResults_weight(i,1) = ((YResults_weight(i,1) - weight_mean)/weight_std); XResults_cost(i,1) = ((YResults_cost(i,1) - cost_mean)/cost_std); XResults_carbon(i,1) = ((YResults_carbon(i,1) - carbon_mean)/carbon_std); end weight_minX = min(XResults_weight); cost_minX = min(XResults_cost); carbon_minX = min(XResults_carbon); for i = 1:n ZResults_weight(i,1) = XResults_weight(i,1) + abs(weight_minX); ZResults_cost(i,1) = XResults_cost(i,1) + abs(cost_minX); ZResults_carbon(i,1) = XResults_carbon(i,1) + abs(carbon_minX); end weight_max = max(ZResults_weight); cost_max = max(ZResults_cost); carbon_max = max(ZResults_carbon); weight_min = min(ZResults_weight); cost_min = min(ZResults_cost); carbon_min = min(ZResults_carbon); x = zeros(n,1); % Total Number of Moment Frames y = zeros(n,1); % Total Number of Braced Frames z = zeros(n,1); % Total Number of Shear Walls Results_weight = zeros(n,1); Results_cost = zeros(n,1); Results_carbon = zeros(n,1); XResults_objective = zeros(n,1); YResults_objective = zeros(n,1); ZResults_objective = zeros(n,1); Results_objective = zeros(n,1); for i = 1:n x(i,1) = M(i,9); y(i,1) = (M(i,2)) + 2*(M(i,4)); z(i,1) = (M(i,3)) + 2*(M(i,5)); Results_weight(i,1) = ((ZResults_weight(i,1)) - weight_min)/(weight_max - weight_min); Results_cost(i,1) = ((ZResults_cost(i,1)) - cost_min)/(cost_max - cost_min); Results_carbon(i,1) = ((ZResults_carbon(i,1)) - carbon_min)/(carbon_max - carbon_min); XResults_objective(i,1) = (Results_weight(i,1)*w_weight) + (Results_cost(i,1)*w_cost) + (Results_carbon(i,1)*w_carbon); end objective_std = std(XResults_objective); objective_mean = mean(XResults_objective); for i = 1:n YResults_objective(i,1) = ((XResults_objective(i,1) - objective_mean)/objective_std); end objective_minX = min(YResults_objective); for i = 1:n ZResults_objective(i,1) = YResults_objective(i,1) + abs(objective_minX); end objective_max = max(ZResults_objective); objective_min = min(ZResults_objective); for i = 1:n Results_objective(i,1) = ((ZResults_objective(i,1)) - objective_min)/(objective_max - objective_min); end %plot_type = input('Enter plot type. 1 = weight, 2 = cost, 3 = carbon, 4 = objective function: '); %if plot_type == 1 figure(1) subplot(2,2,1) hold on for i=1:n scatter3(x(i),y(i),z(i),'o', 'markerfacecolor',[1-Results_weight(i,1) 1-Results_weight(i,1) 1-Results_weight(i,1)]) end title('Contour Map of Structural Weight') xlabel('Total Number of Moment Frames') % x-axis label ylabel('Total Number of Braced Frames') % y-axis label zlabel('Total Number of Shear Walls') % z-axis label %end %if plot_type == 2 figure(1) subplot(2,2,2) hold on for i=1:n scatter3(x(i),y(i),z(i),'o', 'markerfacecolor',[1-Results_cost(i,1) 1-Results_cost(i,1) 1-Results_cost(i,1)]) end title('Contour Map of Cost') xlabel('Total Number of Moment Frames') % x-axis label ylabel('Total Number of Braced Frames') % y-axis label zlabel('Total Number of Shear Walls') % z-axis label %end %if plot_type == 3 figure(1) subplot(2,2,3) hold on for i=1:n scatter3(x(i),y(i),z(i),'o', 'markerfacecolor',[1-Results_carbon(i,1) 1-Results_carbon(i,1) 1-Results_carbon(i,1)]) end title('Contour Map of Embodied Carbon') xlabel('Total Number of Moment Frames') % x-axis label ylabel('Total Number of Braced Frames') % y-axis label zlabel('Total Number of Shear Walls') % z-axis label %end %if plot_type == 4 figure(1) subplot(2,2,4) hold on for i=1:n scatter3(x(i),y(i),z(i),'o', 'markerfacecolor',[1-Results_objective(i,1) 1-Results_objective(i,1) 1-Results_objective(i,1)]) end title('Contour Map of Objective Function') xlabel('Total Number of Moment Frames') % x-axis label ylabel('Total Number of Braced Frames') % y-axis label zlabel('Total Number of Shear Walls') % z-axis label %end