WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
SimpleBatterySystem.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16/*
17Simple power system header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Simple Battery System",
24 "exclude" : False,
25 "category" : "Power"
26}
27aliases = {"peak_battery_voltage" : "Peak Voltage/Battery",
28 "single_battery_capacity" : "Capacity/Battery (W*hr)",
29 "shutoff_capacity" : "Shutoff Capacity",
30 "initial_charge_state" : "Initial Charge",
31 "num_batteries_series" : "Num Batteries/String",
32 "num_batteries_parallel" : "Num Strings",
33 "power_generation_in" : "Power In",
34 "power_draw_out" : "Power Out",
35 "net_power_change" : "EXCLUDE",
36 "system_voltage" : "Battery Voltage",
37 "current_draw" : "Battery Current",
38 "power_available" : "Power Available"
39}
40*/
41
42#ifndef MODELS_POWER_SIMPLE_POWER_SYSTEM_H
43#define MODELS_POWER_SIMPLE_POWER_SYSTEM_H
44
45#include "simulation/Model.h"
46#include "utils/Interpolate2D.h"
47#include "locations.h"
48
49namespace warptwin {
50
56 MODEL(SimpleBatterySystem)
57 public:
58
59 // Model params
60 // NAME TYPE DEFAULT VALUE
63 SIGNAL(peak_battery_voltage, double, 0.0)
65 SIGNAL(single_battery_capacity, double, 0.0)
67 SIGNAL(shutoff_capacity, double, 0.0)
69 SIGNAL(initial_charge_state, double, 1.0)
71 SIGNAL(num_batteries_series, int, 1)
73 SIGNAL(num_batteries_parallel, int, 1)
75 SIGNAL(capacity_voltage_def, std::string, warptwinDir()+"data"+slash()+"power"+slash()+"lithium_ion.json")
77
78 // Model inputs
79 // NAME TYPE DEFAULT VALUE
82 SIGNAL(power_generation_in, double, 0.0)
84 SIGNAL(power_draw_out, double, 0.0)
86
87 // Model outputs
88 // NAME TYPE DEFAULT VALUE
91 SIGNAL(net_power_change, double, 0.0)
93 SIGNAL(depth_of_discharge, double, 0.0)
95 SIGNAL(system_voltage, double, 0.0)
97 SIGNAL(current_draw, double, 0.0)
99 SIGNAL(power_available, int, 0)
101
102 protected:
103 int16 start() override;
104 int16 execute() override;
105
106 double _total_system_capacity; // The total capacity of the system in W*s
107 double _peak_system_voltage; // Voltage when the system is at full capacity
108 double _system_shutoff_capacity;// Capacity at which the system will shut off
109 double _current_capacity; // The current capacity of the system in W*s
110
112 };
113}
114
115#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
A class for performing simple x-y linear interpolation.
Definition Interpolate2D.h:50
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
double _total_system_capacity
Definition SimpleBatterySystem.h:106
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
double _system_shutoff_capacity
Definition SimpleBatterySystem.h:108
double _current_capacity
Definition SimpleBatterySystem.h:109
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
Interpolate2D _voltage_interp_table
Definition SimpleBatterySystem.h:111
double _peak_system_voltage
Definition SimpleBatterySystem.h:107