Ps1 CG Solution
Ps1 CG Solution
Ps1 CG Solution
Problem Statement
Motivation
The design of a spacecraft power subsystem is an important driver for the mass, size, and
capability of the spacecraft. Every other spacecraft subsystem is affected by the power
subsystem, and in particular, important issues such as communications bandwidth,
thermal regulation, and structural design are largely influenced by the capabilities and
limitations of the power system. The motivation for this problem is the broad
applicability of a power-system design tool to a wide range of future design problems.
Requirements
Given time histories of the power load and power source, design a power subsystem that
optimizes with respect to some specified cost function. The power source profile can be
specified directly, or determined from constituent information such as time histories of
the sunlight intensity and the changing angle of a solar panel as a spacecraft rotates with
respect to the sun. The design space for the power subsystem should contain several
types of power generation devices, such as photovoltaic arrays and radioisotope
thermoelectric generators; and several types of energy storage devices, such as batteries
and flywheels. From this design space, a system that minimizes the cost function should
be selected.
Problem Solution
The approach taken to the problem is to create a set of modular functions that are
combined to achieve a solution. The primary advantage to using this approach is that
small, simple blocks of code can be validated more easily than large, complex blocks.
Inputs
Required user inputs include the following quantities:
- Load power as a function of time in Watts, sampled at constant time steps.
- Source power as a function of time in Watts, sample at constant time steps. This can
be supplied either directly as a power profile, or indirectly as constituent data such as
the time histories of incident sunlight intensity and angle of solar array with respect
to the sun.
Outputs
Outputs from the design module include the following quantities:
- The mass of the power system in kilograms, including the mass of the energy storage
system (batteries or flywheel) and power generation system (solar array or RTGs).
This mass does not include other components of the system such as power
conditioning electronics.
- The cost of the energy storage and power generation systems in millions of dollars.
- The time history of the state of charge of the energy storage system, in Joules.
- The time indices at which the energy storage capacity was insufficient to meet
- The time history of excess thermal energy that must be dissipated, in Joules.
- The remaining life in the storage system as a fraction of the original lifespan.
Emax ≥ E (t ) ≥ 0
The fraction of the lifetime lost due to a particular discharge/charge cycle on a chemical
battery can be determined using the following formula, where ∆Li is the fraction lost, di is
the depth of discharge, b is the intercept, and m is the slope. This equation was derived
from Fig. 11-11 in SMAD.
⎛ d −b ⎞
−⎜ i ⎟
∆Li = −10 ⎝ m ⎠
The remaining lifetime fraction as a function of time can then be determined by summing
the fractions lost due to each cycle. In the following equation, the lifetime fraction is L0
at time t0.
n
L (tn − t0 ) = L0 + ∑ ∆L
i =0
i
These equations summarize many of the major interactions between elements of the
power subsystem.
Files
The following files, listed in alphabetical order, are used in the calculation of the optimal
power system and the validation of components of the power system model. The main
function is masterloop.m; all of the other functions, with the exception of the
validation functions, are called from within the function masterloop. A simplified
flow diagram for the module is shown in Figure 1.
masterloop.m
Design Vector
PowerDesignResult.m
yes yes
SolarArrayPerArea.m RTGPower.m
×
Surface Area
battery_profile.m
Design Vector
battery_profile.m
- Calculates the time profiles of the energy storage device state of charge and excess
thermal energy. Determines if the power and energy devices are sufficient to handle
the applied load.
- Calculates the cumulative effect of individual discharge/charge cycles on the device
lifetime.
- Inputs include the properties of the energy storage device and the time histories of
the source and load power.
EffectivePowerIntensity.m
- Used to compute the effective solar radiation intensity based on the incident angle
between the line of radiation and a vector normal to the solar array surface.
- As the incident angle is a function of time, the resulting effective power intensity is
also a function of time.
masterloop.m
- The main function, from which the other functions are called. Operates with a set of
nested ‘for’ loops, which are used to test all possible combinations of designs.
MER_sol4.m
MER_sol4_input_data.xls
- A spreadsheet containing data points from MER_sol4_power_profile.png.
Used for validation of the function battery_profile.
MER_sol4_power_profile.png
- A bitmap screen capture of the energy balance plot for MER A sol 4 egress
operations, taken from the MER Mission Plan. Used for validation of the function
battery_profile.
plot_battery_dod_cycles.m
- Used to visualize the effect of a single discharge/charge cycle on the lifetime of a
battery. Creates a plot of depth of discharge as a function of fraction of lifetime lost
for all types of chemical batteries being considered. This function can be run from
the command line without any additional inputs.
PowerDesignResult.m
- Given the design requirements and the specification of the power source and energy
storage devices, PowerDesignResult.m computes the overall mass and cost,
the power available from the power source as a function of time, and the state of
charge of the energy storage device as a function of time.
- The function may also return a set of time instances at which the stored energy was
insufficient to handle the power load. Furthermore, it computes the energy storage
device’s remaining life and required energy dissipation.
- Depends on SolarPowerPerArea.m and battery_profile.m to compute
the aforementioned information.
power_read_xls.m
RTGPower.m
- Used to compute the power an RTG can generate. The power an RTG can generate
depends on the specific model of the RTG.
slope_intercept.m
- Given a particular set of energy storage device properties, calculates the slope and
intercept of the plot of depth of discharge as a function of cycle life. The slope is
considered constant, based on the limited data available from SMAD and external
sources.
SolarPowerPerArea.m
- Used to determine the amount of power that can be generated from a unit area of a
solar array, based on the type of the solar array and the effective illumination
intensity. It takes into account the degradation of the array over the time period, the
efficiency of the solar array, and the inherent degradation (i.e. degradation of the
solar array system due to the temperature and shadowing effects) [SMAD].
- Depends on EffectivePowerIntensity.m for computing the effective power
intensity.
TestPowerDesignResult.m
TestSolarArray.m
Module Validation
Energy Storage for MER
Several of the functions used in the module are validated individually. Among these is
the battery_profile function, which is validated using data from the MER Mission
Plan, as shown in Figure 2. The function MER_sol4.m reads the source and load power
profiles from an Excel spreadsheet, parses the data, and passes the power profiles to
battery_profile, which generates the Battery SOC and Excess Power profiles. The
top plot is taken from the MER Mission Plan, the middle plot shows the inputs to and
outputs from the function battery_profile, and the bottom plot shows these inputs
and outputs overlaid on the MER Mission Plan data. Although some discrepancy can be
seen in the battery state of charge profile, the shape of the profile is generally correct, and
the beginning and ending values are accurate.
Energy balance for MER A egress (Sol 4) from MER Mission Plan
Load power
Source power
Excess power
Battery SOC
120
80 60
60
40
40
20
20
0 0
0 6 12 18 24
Time [Mars hours]
120
Battery state of charge [% ]
80
100
Power [W]
80 60
60
40
40
20
20
0 0
0 6 12 18 24
Time [Mars hours]
Figure 2. Validation of battery_profile.m using MER Mission Plan data and MER_sol4.m.
Depth of discharge and cycle lifetime
The issue of battery lifetime dependence on depth of discharge and number of cycles is
addressed by treating each discharge/charge cycle as an individual event, and tracking the
cumulative effect of the individual events. Data in SMAD and elsewhere were used to
create the relationships between depth of discharge and degradation of lifetime shown in
Figure 3. The slopes of the lines are considered constant, based on data in SMAD. This
figure may be plotted using plot_battery_dod_cycles.m.
70
60
50
40
30
20
10
0
0 -1 -2 -3 -4 -5 -6 -7 -8
Fraction of life lost in one charge/discharge cycle [log
10
(x)]
Figure 3. Relationship between depth of discharge and reduction in lifetime for chemical batteries.
Solar Arrays
The test function TestSolarArray.m is used to validate SolarPowerPerArea.m
and EffectivePowerIntensity.m within a specific scenario. This scenario
assumes a satellite in a low Earth circular orbit. The satellite has a fixed solar array, that
is, the incident angle of the solar array with respect to the line of solar radiation varies in
between -π and π. We also assume that the solar array is double sided and is never
eclipsed by Earth. Figure 4 is the output generated by TestSolarArray.m.
Figure 4. Solar array power intensity for a simulated low Earth orbit without an eclipse.
The blue lines represent the solar radiation intensity, which is approximately 1367 W/m2.
The green line is the effective radiation intensity the solar panels can absorb. Note that
the effective solar radiation is periodic due to the periodicity of the incident angle. The
red line represents the total power generated by the solar array. As shown by the plot on
the left, this line tracks the effective solar radiation (green), but with lower magnitude due
to the efficiency of the solar array. The plot on the right with larger time scale exhibits
the degradation of the solar array as expected. Given a solar array, the power generated
by the solar array is:
where η is the efficiency, Id is the inherent degradation, Ieff is the effective radiation
intensity, A is the surface area exposed to the radiation, D0 is the initial degradation, D is
the rate of degradation, t is the current time, and t0 is the initial time. While the harsh
environment (e.g. thermal cycling and micrometeoroid strikes) causes degradation/rate of
degradation, the inherent degradation is caused by design inefficiencies (e.g. shadowing).
P = P0 ⋅ e −kt ,
where k is 1/87.74 [1/years] for Pu-238 that is typically used for an RTG.
Module Results
The module was run using the input power profile and incident angle profile shown in
Figure 6 and Figure 7, respectively. The profile was chosen to approximate a Low Earth
Orbit to a very crude level. The fraction of life span remaining at the start of the period
was chosen to be one, and a maximum energy storage capacity of 161280 J was chosen, a
factor of ten less than the capacity of the Mars Exploration Rover batteries. The initial
energy in the batteries was selected as 60% of this amount.
Figure 6. Input power profile.
The solar array input vector was chose to range from one to four meters in increments of
one meter. After running masterloop, Figure 8 and Figure 9 were generated from the
module outputs. Figure 8 illustrates the mass and costs for various designs in the design
vector. The red dots indicate designs where the energy in the system dropped below zero,
indicating that the energy storage capacity is insufficient. These designs are therefore
invalid, and are not considered part of the final answer. The blue dots indicate designs
where energy conditions were successfully met. The data can be seen as 14 “columns” of
data, which correspond to the 14 different storage designs. The flywheel storage design
is the 2nd column from the right. The bottom four dots per column that are grouped
diagonally represent the range of solar array sizes for a specific solar array type.
Depending on the power input and incidence angle profiles, the number of valid and
invalid designs can change. For some profiles, all flywheel designs were determined to
be invalid. Figure 8 shows an example outcome for a solar-array based system.
Figure 8. Mass and Costs for Design vector according to the input Power profile for a solar array
source system.
Figure 9 illustrates the mass and cost for an RTG and storage system. There are only
eight discrete RTG designs, and this results in eight regions, each centered about one
RTG design. If more RTG data were incorporated, a more distinct Pareto front could be
achieved; however, the results show that for certain RTG designs, the higher-mass
options become invalid.
Figure 9. Mass and Costs for Design vector according to the input Power profile for an RTG source
system
Future Work
There are several ways to expand this module. The database of storage devices and
source devices could be expanded. We have included several types of secondary
batteries and eight RTGs; however, the design space could benefit from a larger selection
of solar array types. The current module implemented only three types of solar arrays to
keep computation times down while running the module. One type of flywheel3 was
included in the design space; however, if additional flywheel storage devices emerge,
they should be added to the design space. Additional storage and source types such as
fuel cells, nuclear generators, and thermoelectric converters could add to the design space,
but the more options added, the slower computation will be.
Additional work includes incorporating the mass and power draw from power
distribution systems, such as a Direct Energy Transfer (DET) or Peak Power Tracker
(PPT) system.
The spreadsheet of sources and storage devices includes the sizes of the storage units,
however they were not used. A future design could include this data and output the size
of the storage units. This could be used by a possible structures module. The heat
generated by the power system consists of additional calculations that could be made to
link up with a possible thermal subsystem.
Subsystems which would act as inputs to this power module include orbits, and
environment. Environment already has an input, the form of the Solar Intensity, but
additional data could be added. The Orbits subsystem has an effect on the Effective
Intensity, and on the Power Input profile.
References
1. Wertz, J., and Larson, W., Space Mission Analysis and Design, Third Edition.
Torrance, CA: Microcosm Press, 1999.
2. Ludwinski, J., et. al., “Mars Exploration Rover (MER) Project Mission Plan,”
Pasadena, CA: Jet Propulsion Laboratory, April 24, 2002, JPL-D19659.
3. Designfax, http://www.manufacturingcenter.com/dfx/archives/0701/0701fly.asp,
Sept. 16, 2003.
4. Eagle-Picher, http://www.epcorp.com/EaglePicherInternet/, Sept. 16, 2003
Source Code
Following are the full contents of the Matlab and Excel source code used in this
assignment.
battery_profile.m
function [energy,invalid,dissipation,life] = battery_profile(nsteps, dt, load, source, e_init, e_max, life_init, efficiency, slope, intercept)
%[ENERGY, INVALID, DISSIPATION, LIFE]
% = BATTERY_PROFILE(NSTEPS,DT,LOAD,SOURCE,E_INIT,E_MAX,LIFE_INIT,EFFICIENCY,SLOPE,INTERCEPT)
%
% Inputs:
% NSTEPS The number of uniformly-spaced time values
% DT [s] The separation between the time values
% LOAD [W] The time profile of the power load
% SOURCE [W] The time profile of the power source
% E_INIT [J] The initial stored energy in the storage device
% E_MAX [J] The capacity of the energy storage device
% LIFE_INIT The fraction of the device’s usable life as of the start of the period
% EFFICIENCY The fraction of the input energy that is recoverable
% SLOPE The slope of the depth of discharge vs log life fraction plot
% INTERCEPT The y-intercept of the depth of discharge vs log life fraction plot
%
% Outputs:
% ENERGY [J] The time profile of the energy stored in the device
% INVALID Indices of times at which the stored energy is negative (!)
% DISSIPATION [W] The time profile of excess energy to be dissipated
% LIFE The fraction of the device’s usable life as of the end of the period
%
% Note that if LENGTH(INVALID)>0, the capacity of the energy storage device is insufficient
% to meet demand, and this is an invalid design. Any function calling BATTERY_PROFILE(...)
% should verify that INVALID is empty before proceeding with further calculations.
%
end
if energy(i)>e_cap
% records the excess energy that won’t fit in the storage device
dissipation(i) = (energy(i)-e_cap)/dt;
% depth of discharge
dod = (e_max-energy(temp))/e_max;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MER_sol4.m
% Reads in the solar array input power and the load power for the Mars Exploration Rover
% egress scenario (data are from the MER Mission Plan, JPL/NASA). Requires the Excel
% profile of the battery state of charge given the load and source power profiles,
% Outputs:
[data,clocks] = xlsread(’MER_sol4_input_data.xls’);
val = data(:,1);
val = val(find(val(:,1)>=0));
times = clocks(:,1);
times = times(1:length(val));
time = t2ms(times);
val = data(:,3);
val = val(find(val(:,1)>=0));
times = clocks(:,3);
times = times(1:length(val));
time = t2ms(times);
if (sum(tA-tL)~=0)
error(’Error! Load and input power profiles have different time vectors.’);
end
% battery properties
efficiency = 1.0;
slope = -0.28;
intercept = 1.67;
% change to a percentage
E = EE/energy_max;
h=figure(1);
subplot(311)
subplot(312)
subplot(313)
hmargin = 0;
vmargin = 0;
orient tall;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
function plot_results(what, t, L, A, E, W)
if strcmp(what,’original’) | strcmp(what,’all’)
ax(1) = newplot;
set(gcf,’nextplot’,’add’)
h1 = image(img);
set(ax(1),’visible’,’off’);
set(ax(1),’box’,’off’)
pos(3) = 0.8*pos(3);
set(ax(1),’position’,pos);
end
if strcmp(what,’original’)
% create a dummy axis on which to make a legend
dummyax = axes(’position’,[1 1 1/0.8 1].*get(ax(1),’position’));
% make dummy plots with the colors we will use for the real data
plot(-1,-1,’b-’,-1,-1,’g-’,-1,-1,’m-’,-1,-1,’r-’);
axis([0 1 0 1]);
set(dummyax,’color’,’none’,’box’,’off’,’XTick’,[],...
’XTickLabel’,[],’YTick’,[],’YTickLabel’,[])
title(’Energy balance for MER A egress (Sol 4) from MER Mission Plan’);
return;
end
if strcmp(what,’ourdata’)
ax(2) = newplot;
pos = get(ax(2),’position’);
pos(3) = 0.7*pos(3);
set(ax(2),’position’,pos);
else
ax(2) = axes(’position’,get(ax(1),’position’));
end
if strcmp(what,’ourdata’) | strcmp(what,’all’)
% the source, load and excess powers, and a line to make the top look nice
h2 = plot(t, A, ’g-’, t, L, ’b-’, t, W, ’m-’, [0 24],[140 140],’k-’);
if strcmp(what,’ourdata’)
set(ax(2),’xgrid’,’off’,’ygrid’,’off’,’box’,’off’);
else
set(ax(2),’color’,’none’,’xgrid’,’off’,’ygrid’,’off’,’box’,’off’);
end
set(gcf,’nextplot’,’add’)
axis([0 24 0 140]);
set(ax(2),’XTick’,[]);
ylabel(’Power [W]’)
set(ax(3),’YAxisLocation’,’right’,’color’,’none’, ...
’xgrid’,’off’,’ygrid’,’off’,’box’,’off’);
axis([0 24 0 100]);
set(ax(3),’XTick’,[0 6 12 18 24]);
end
set(gcf,’nextplot’,’replace’);
xlabel(’Time [Mars hours]’);
if strcmp(what,’ourdata’)
title(’Simulation data. Outputs are battery SOC and excess power.’);
else
title(’Simulation data overlayed on MER mission plan data’);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
for i=1:length(times)
corner_times(i) = t2m(times{i});
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
% creates a power profile given corner values. corner_times must be integers.
function [t,L] = create_profile(corner_times, corner_values, initial)
L(1) = initial;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
div = find(time==’:’);
if length(div)~=1
plot_battery_dod_cycles.m
function plot_battery_dod_cycles(varargin)
% PLOT_BATTERY_DOD_CYCLES
% PLOT_BATTERY_DOD_CYCLES(FIGNUM)
% PLOT_BATTERY_DOD_CYCLES(AXES_HANDLE)
%
% Plots the depth of discharge (DOD) as a function of cycle repetition lifetime
% Creates a new figure, or plots to figure number FIGNUM.
else
washold = ishold;
colors = ’bgrmcy’;
points = ’ox+sd<>’;
% initialize
types{1} = ’’;
legstr = [];
count = 0;
for i=1:slen
types{count+1} = storage(i).Type;
continue;
else
% add on the the string that we will eval for the legend
legstr = [legstr ’,’’’ storage(i).Type ’ (’ storage(i).PartNumber ’)’ ’’’’];
y=slope*x+intercept;
end
hold on;
end
end
% negatize the x ticks, since we’re looking at the inverse of the plotted value
h=gca;
ticks = str2num(get(h,’XTickLabel’));
set(h,’XTickLabel’,num2str(-ticks));
% create a legend
legstr = legstr(2:length(legstr));
eval([’legend(’ legstr ’)’]);
power_read_xls.m
storage = [];
generation = [];
solar = [];
names = fieldnames(storage);
i_offset = size(txt,1) - size(num,1);
j_offset = size(txt,2) - size(num,2);
for i=1:size(txt,1)
for j=3:size(txt,2)
if i<=i_offset
eval([’storage(j-2).’,names{i},’= ’’’,txt{i,j}, ’’’;’]);
else
eval([’storage(j-2).’,names{i},’= num(i-i_offset,j-j_offset);’]);
end
end
end
for i=1:size(txt,1)
generation = setfield(generation, txt{i,1}, []);
end
names = fieldnames(generation);
i_offset = size(txt,1) - size(num,1);
j_offset = size(txt,2) - size(num,2);
for i=1:size(txt,1)
for j=3:size(txt,2)
if i<=i_offset
eval([’generation(j-2).’,names{i},’= ’’’,txt{i,j}, ’’’;’]);
else
eval([’generation(j-2).’,names{i},’= num(i-i_offset,j-j_offset);’]);
end
end
end
for i=1:size(txt,1)
solar = setfield(solar, txt{i,1}, []);
end
names = fieldnames(solar);
i_offset = size(txt,1) - size(num,1);
j_offset = size(txt,2) - size(num,2);
for i=1:size(txt,1)
for j=3:size(txt,2)
if i<=i_offset
eval([’solar(j-2).’,names{i},’= ’’’,txt{i,j}, ’’’;’]);
else
eval([’solar(j-2).’,names{i},’= num(i-i_offset,j-j_offset);’]);
end
end
end
slope_intercept.m
% Returns the slope and intercept of a plot of the depth of discharge as a function
% Inputs:
% Outputs:
if (dod>1 | dod<0)
% any device that does not exhibit changes in lifetime with depth of discharge.
if cycles==0
slope = 0;
intercept = 0;
% from y = m * log10(x) + b
intercept = dod-slope*log10(cycles);
end
MER_sol4_input_data.xls
8:01 124 11:45 132
0:0 3 0:0 0 9:00 124 12:00 132
4:38 3 5:50 0 9:01 58 12:15 132
4:39 59 6:15 6 10:25 58 12:30 131
4:53 63 6:30 13 10:26 67 12:45 130
4:54 124 6:45 18 10:55 67 13:00 126
4:59 124 7:00 26 10:56 58 13:15 123
5:00 63 7:15 32 10:59 58 13:30 120
5:01 59 7:30 45 11:00 124 13:45 117
5:02 3 7:45 53 11:57 124 14:00 111
6:42 3 8:00 60 11:58 58 14:15 105
6:43 75 8:15 70 13:19 58 14:30 100
6:49 75 8:30 78 13:20 67 14:45 94
6:50 22 8:45 85 13:45 67 15:00 86
7:15 22 9:00 90 13:46 58 15:15 80
7:16 98 9:15 100 13:50 58 15:30 70
7:17 98 9:30 105 13:51 124 15:45 65
7:18 76 9:45 110 14:47 124 16:00 55
7:24 76 10:00 115 14:51 3 16:15 50
7:25 59 10:15 119 16:00 3 16:30 40
7:29 59 10:30 123 16:01 64 16:45 30
7:30 112 10:45 125 16:15 64 17:00 21
7:56 112 11:00 127 16:16 124 17:15 13
7:57 56 11:15 130 16:21 124 17:30 6
8:00 56 11:30 131 16:22 3 17:45 3
8:01 124 11:45 132 24:00 3 18:00 0
9:00 124 12:00 132 24:00 0
PowerDesignVector.xls
PartNumber text RNH30-9 RNH81-5 RNH160-3 INCP77 MSP01 INCP95 SZHR25 SZHR25
Company text Eagle-Picher Eagle-Picher Eagle-Picher Lithion Lithion Lithion Eagle-Picher Eagle-Picher
Device text SecondaryBattery SecondaryBattery SecondaryBattery SecondaryBattery SecondaryBattery SecondaryBattery SecondaryBattery SecondaryBattery
Type text Nickel-Hydrogen IPV Nickel-Hydrogen IPV Nickel-Hydrogen IPV Lithium Ion Lithium Ion Lithium Ion Silver Zinc Silver Zinc
Name text 1.1 1.2 1.3 3.1 3.2 3.3 4.1 4.2
SpecificEnergy W hr/kg 144432 172800 181440 468000 522000 522000 324000 324000
EnergyDensity W hr/L 116172000 254160000 304920000 1116000000 1166400000 1206000000 882000000 882000000
RatedCapacity A hr 108000 291600 576000 37800 90000 126000 90000 144000
NominalVoltage V 1.25 1.25 1.25 14.4 28 3.6 1.5 1.5
Mass kg 0.997 2.55 4.18 1.5 17.8 0.87 0.5 0.55
Diameter m 0.0892 0.0902 0.1178 0.075 0.1 0.05 0.015 0.054
Length m 0.2286 0.32 0.307 0.025 0.129 0.12 0.05 0.085
MaxCycles num 20000 20000 20000 2100 900 800 5000 5000
CoulombicEfficiency % 0.95 0 0 0.99 0.99 0.99 0 0
FadeRate %/cycle 0.5 0.5 0.5 0.02 0.02 0.02 0.5 0.5
Life years 2 2 2 0 0 0 0.5 0.5
Cost $ 0 0 0 0 0 0 0 0
TRL num 9 9 9 9 9 9 9 9
DOD fraction 0.55 0.55 0.55 0.8 0.8 0.8 0.5 0.5
Cyclelife num 10000 10000 10000 1500 1500 1500 200 200
clear all
%Nickel-Hydrogen IPV 1
%Nickel-Hydrogen CPV 2
%Lithium Ion 3
%Silver Zinc 4
%Fly Wheel 5
[ENV]=environmentfun;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%INPUTS$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%
%[time, L, A]=parseinputdata(data,clocks);
%time vector
t_f = 5 * 24 * 60;
dt=60;
time = dt*[0:1:t_f];
op = 90 * 60;
%incident_angle = 0:2*pi/op*dt:time(length(time))*2*pi/op;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%debug code
for stcnt=1:storage_design_length
storage(stcnt).InitialCharge=energy_initial;
% storage(stcnt).InitialCharge=0;
storage(stcnt).RemainingLife=life_init;
’solar cycle’
for SAcnt=1:SA_design_length
%outside loop
solar(socnt).IncidentAngle = incident_angle;
solar(socnt).SurfaceArea = SA_area(SAcnt);
’RTG cycle’
EffectivePowerIntensity.m
environmentfun.m
ENV.IlluminationIntensity = 1367;
PowerDesignResult.m
% Inputs:
% T Time.
% Outputs:
R.Mass = 0;
R.Cost = 0;
R.AvailablePower = zeros(1,length(t));
R.AvailableEnergy = zeros(1,length(t));
for i = 1:length(power_source)
% error(’To use a solar array, the illumination intensity "illuminationIntensity" must be specified within the environment")
%end
% illumination.
effective_intensity = ...
EffectivePowerIntensity(environment.IlluminationIntensity, ...
power_source{i}.IncidentAngle);
R.SAMass=power_source{i}.Density * power_source{i}.SurfaceArea;
R.RTGMass=0;
R.MassINV=0;
R.CostINV=0;
% Compute the cost of the solar array.
R.Cost = R.Cost ...
+ power_source{i}.CostPerArea * power_source{i}.SurfaceArea;
% The power source is an RTG:
elseif strcmp(power_source{i}.Device,’RTG’)
% Compute the power availble.
R.AvailablePower = R.AvailablePower + RTGPower(power_source{i},t);
R.MassINV=0;
R.CostINV=0;
R.SAMass=0;
R.RTGMass=power_source{i}.Mass;
slope, ...
intercept);
if (length(R.EnergyStorageInvalid) > 0)
%disp(’Invalid energy storage device.’)
R.MassINV=R.Mass + energy_storage.Mass;
R.CostINV=R.Cost + energy_storage.Cost;
R.Mass=NaN;
R.Cost=NaN;
R.STMass=NaN;
else
R.STMass=energy_storage.Mass;
R.MassINV=NaN;
R.CostINV=NaN;
end
RTGPower.m
SolarPowerPerArea.m
% P = SOLARPOWERPERAREA(SOLAR_ARRAY, EFFECTIVE_INTENSITY, T)
% Inputs
if (length(t) ~= length(effective_intensity))
error(’The length of the vectors of effective intensity and time do not match.’);
P = 0;
else
t_0 = t(1);
for i = 1:length(t)
P(i) = CurrentPowerPerArea(solar_array, effective_intensity(i), t_0, t(i));
end
end
TestPowerDesignResult.m
clear;
close all;
% Initial Time [sec]
t_0 = 0;
environment.IlluminationIntensity = 1367*ones(1,length(t));
% Power Load
power_load = 100 * sin(t/t_f*pi);
power_source{1} = solar(1);
power_source{1}.IncidentAngle = incident_angle;
power_source{2} = solar(3);
power_source{2}.IncidentAngle = incident_angle;
power_source{1} = generation(1);
energy_storage = storage(1);
energy_storage.InitialCharge = 30;
energy_storage.RemainingLife = 1;
for i=1:length(area)
power_source{1}.SurfaceArea = area(i); %[m]
power_source{2}.SurfaceArea = area(i); %[m]
design(i) = PowerDesignResult(power_source, energy_storage, power_load, environment, t);
end
for i=1:length(area)
figure(1)
hold on
plot(area(i),design(i).Mass,’o’);
figure(2)
hold on
plot(area(i),design(i).Cost,’o’);
figure(3)
hold on
plot(t,design(i).AvailablePower);
figure(4)
hold on
plot(t,design(i).AvailableEnergy);
end
TestSolarArray.m
clear;
close all;
% eta: efficiency
solar_array.Efficiency = 0.185;
solar_array.InherentDegradation = 0.77;
solar_array.InitialDegradation = 0.01;
solar_array.DegradationRate = 0.0275/365.25/24/3600;
t_0 = 0;
%t_f = 5 * 24 * 3600;
t_f = 50000;
%t_f = 1000000000;
%dt = 24 * 3600;
dt = 5;
%dt = 1000000;
t = t_0:dt:t_f;
power_intensity = 1367*ones(1,length(t));
op = 90 * 60;
rtg_power = RTGPower(generation(1),t);
rtg_power_final=min(rtg_power);
figure(2)
plot(t,rtg_power)