You should now have a complete small Spacecraft Life Support System including humans but at the moment you probably still only have the minimalistic plotting we implemented in 1.4.2 Stores and Phases. Now we want to add different other plots to the system that actually show the system behavior!

1.4.10.1 Changing the Time Unit of Plots

If you want to use a different time unit than seconds for your plots you can use the plot options struct input to set the desired unit. For example to change it to hours for the total cabin pressure you can use

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@455e1297'
tPlotOptions = struct('sTimeUnit','hours');
coPlot{1,1} = oPlotter.definePlot({'"Total Cabin Pressure"'},       'Total Cabin Pressure', tPlotOptions);

1.4.10.2 Virtual Log Values

In some cases the values directly accesible in V-HAB are not exactly what you are looking for, and instead you would like to transform them into a differen quantity using calculations. Either by combining multiple values into one or by using constant numbers in the calculation. You can achieve this by defining virtual log values which allow calculations between other logged values. For example if you want to know the effective coolant heat flow from both heat exchangers together you can first add two normal log values for each of the heat flows

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@6f850abd'
oLogger.addValue('Example.toProcsF2F.HeatExchanger_1',                          'fHeatFlow', 'W',      'Heat Exchanger Heat Flow');
oLogger.addValue('Example.toProcsF2F.CondensingHeatExchanger_1',                'fHeatFlow', 'W',      'Condensing Heat Exchanger Heat Flow');

and then simply add these two log values using a virtual value

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@7a4689b9'
oLogger.addVirtualValue('"Heat Exchanger Heat Flow" + "Condensing Heat Exchanger Heat Flow"', 'W', 'Total Heat Exchanger Heat Flow');

This virtual value can then be plotted like any other value! However, currently it is not possible to reuse virtual values in the definition of new virtual values. For that case you have to include the original calculation instead of the virtual value you wanted to use!

You can also use this to transform values into other quantities. For example you can transform the CO2 partial pressure from pascal to Torr by dividing it with the corresponding constant factor:

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@47520b98'
oLogger.addVirtualValue('"Partial Pressure CO2 Cabin" ./ 133.332', 'torr', 'Partial Pressure CO2 in Torr');

In principle you can combine any number of log values and use any valid mathematical calculation on them to create new log values! It is only important that you remeber to use ./ .* and .^ operators for the corresponding vector operation otherwise you will receive an error during plotting. If you transform a SI unit into a different unit it is quite possible that V-HAB will not know of that unit yet throwing an error. In that case you have to define a custom label for that axis to prevent the error from occuring! This can be done by using the plot options struct and adding the field sYLabel to it with the corresponding axis label.

1.4.10.2 Two Y-Axis

Sometimes you want to show two quantities with different units in the same plot. For example we could show the total heat exchanger heat flow and the cabin temperature in one plot to showcase the relation between these two quantities. However, to combine two different units in one plot you will need two y-axis. This can simply be done by adding both values to one plot, V-HAB will automaticall generate a plot with two y-axis! For example use this to define the plot mentioned before:

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@9ad13fc'
oPlotter.definePlot({'"Total Heat Exchanger Heat Flow"', '"Cabin Temperature"'},  'Total HX Heat Flow and Cabin Temperature')

1.4.10.3 X-Axis with a different Value than Time

The standard for plots in V-HAB is a quantity plotted over time, however sometimes you want to plot two different quantities over each other. For example we want to plot the condensate flowrate of the CHX over the cabin humidity.First add the condensate flowrate to the logged values

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@77d69905'
oLogger.addValue('Example.toStores.Cabin.toProcsP2P.CondensingHX', 'fFlowRate',             'kg/s',  'Condensate Flow Rate')

Then we need to define the plot options struct with an alternative x axis value and hand that to the definePlot function:

Fehler beim Rendern des Makros 'code': Ungültiger Wert für den Parameter '[Ljava.lang.Object;@13e7a6c6'
tPlotOptions = struct('sAlternativeXAxisValue', '"Relative Humidity Cabin"', 'sXLabel', 'Relative Humidity in [-]')
coPlot{2,1} = oPlotter.definePlot({'"Condensate Flow Rate"'},       'Condensate FlowRate over Relative Humidity', tPlotOptions);

1.4.10.4 Further Options

There are a lot of other options available to customize your plots, but the options described above should get you pretty far already. In principle you can define any property of the plot that Matlab lets you customize by handing a field with the plot property name and the desired value to the plot options struct! For examples on how to use the plotting you can also go into the user/+examples/+plotting folder and run the example to see the results

  • Keine Stichwörter