# Optimization with 3 variables- how to find the values of each variable to minimize mass?

1 view (last 30 days)
Din N on 14 Mar 2023
I have an infrastructure where a metal sheet must be produced. An excavator, an electrolysis reactor, and a 3D printer must be used.
All this has to be performed in 3650 days. So, I am trying to kind of optimize it and find how many excavators, reactors, and 3D printers will give the smallest mass but will also be able to get the job done in 3650 days. I am not sure if and how a code can be written for that. Any help would be appreciated.
days_req=3650; %
m_sheet=linspace(100,10000,200); % mass of a metal sheet
% excavator
n_excav=1:1:200; % number of excavators
m_excav=67; % mass of each excavator
m_tot_excav=n_RASSORs*m_RASSOR; % mass for n excavators
excav_cap=n_excav*6536; % kg/day
days_excav=ceil(m_sheet./excav_cap./n_excav); % days to excavate
% electrolysis reactor
n_react=1:1:200; % number of reactors
m_react=2000; % mass of each reactor
m_tot_react=n_react*m_react; % mass for n reactors
prod_rate_react=7*24; % kg/day of regolith
days_react=ceil(m_sheet./prod_rate_react./n_react); % days to process m_sheet
% printer
n_printer=1:1:200; % number of printers
m_printer=3500; % mass of each printer
m_tot_printer=n_printer*m_printer; % mass for n printers
deposition_rate=n_printer*14.4; % kg/day
days_print=ceil(m_sheet./deposition_rate./n_printer); % days to print