A simple code for approximate thermal mathematical modeling and simulation.
This set of Matlab package allows modeling and simulating the thermal evolution of a system composed of several isothermal nodes, connected by conductive paths and radiative paths, subject to internal and external heat loads, and radiating to free space. All units are SI units.
This code has been developed as an aid for the Spacecraft Predesign course of the Master in Space Engineering at the Universidad Carlos III de Madrid. It is currently in beta version and may contain errors. All help to detect bugs and improve the code is welcome.
Installation requires simply that you
download Thermal
and add the base src
directory (the one that contains the +thermal
directory)
to your Matlab path.
A recent version of Matlab is needed to run the code.
The main function that the user must know is thermal.integrator
. This function uses ode45
to integrate the thermal evolution equation of each node. It has the following interface:
function [t,T] = integrator(model,scenario,ic,tspan,options)
The INPUTS are:
model
is a structure like the one generated by the functionmodel_template
. It contains the parameters of the thermal mathematical model to be simulated.scenario
is a structure like the one generated by the functionscenario_template
. This structure contains the thermal loads for the simulation.ic
is a vector with the initial temperature conditions for the nodes.tspan
is the time span for the simulation, e.g. [0,1000] s.options
is an optional argument, a structure like the one generated by Matlab'sodeset
function.
The user is adviced to copy and edit the provided template files for model
, scenario
, where the necessary
structure fields are defined. A template for ic is also provided for reference.
The model
and scenario
structures and the ic
vector may be also created/edited by other means.
This is particularly interesting when concatenating succesive integrations with different thermal loads,
where the initial conditions of each integration are the terminal conditions of the former.
A minimum absolute and relative tolerance should be indicated in options
with odeset
to ensure accurate integration.
The OUTPUTS are:
t
is am x 1
-vector with the resulting integration timesT
is am x n
-array with the resulting integration temperatures, one column per node.
The package contains the following functions in the /src
directory:
thermal.dT_dt
: differential equations for each node.thermal.integrator
: main function to be called by the user. Integrates the differential equations.model_template
: a function that generates themodel
structure. This is a template, intended to be copied and modified by the user.scenario_template
: a function that generates thescenario
structure. This is a template, intended to be copied and modified by the user.ic_template
: a function that generates theic
vector. This is a template, intended to be copied and modified by the user.
The test suite of Thermal is currently quite minimal.
Tests and their fixtures can be found in the /tests
directory. These tests can give you a feeling of how to run Thermal on your own.
After adding the Thermal package to your Matlab path, you can run all tests by executing runtests
from the /tests
directory.
If you have any comments for improvement or are interested in contributing to the continued development of this or any of our other codes, you can contact us through our website.
For updates and news, follow us on Twitter: @ep2lab..
This program is the result of our development effort. It is released as open source in the hope that it will be useful to other people. If you find it useful and/or use it in any of your works, we kindly ask you to acknowledge it by referencing the code directly as:
Mario Merino (2020). Thermal code DOI: 10.5281/zenodo.1257295
Copyright (c) 2020 Mario Merino. The software is released as open source under the MIT License.