ubc-solar-physics 1.8.1__cp39-cp39-macosx_11_0_arm64.whl → 1.8.3__cp39-cp39-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- physics/_version.py +2 -2
- physics/models/battery/battery.rs +1 -1
- physics/models/motor/advanced_motor.py +9 -6
- physics/models/motor/basic_motor.py +1 -1
- physics_rs.cpython-39-darwin.so +0 -0
- {ubc_solar_physics-1.8.1.dist-info → ubc_solar_physics-1.8.3.dist-info}/METADATA +1 -1
- {ubc_solar_physics-1.8.1.dist-info → ubc_solar_physics-1.8.3.dist-info}/RECORD +10 -10
- {ubc_solar_physics-1.8.1.dist-info → ubc_solar_physics-1.8.3.dist-info}/LICENSE +0 -0
- {ubc_solar_physics-1.8.1.dist-info → ubc_solar_physics-1.8.3.dist-info}/WHEEL +0 -0
- {ubc_solar_physics-1.8.1.dist-info → ubc_solar_physics-1.8.3.dist-info}/top_level.txt +0 -0
physics/_version.py
CHANGED
@@ -28,7 +28,7 @@ fn battery_evolve(
|
|
28
28
|
nominal_charge_capacity: f64, // Nominal charge capacity (Coulombs)
|
29
29
|
) -> (f64, f64, f64) {
|
30
30
|
// Update state of charge and polarization potential
|
31
|
-
let new_state_of_charge: f64 = state_of_charge + (current * tick / nominal_charge_capacity);
|
31
|
+
let new_state_of_charge: f64 = f64::min(1.0, state_of_charge + (current * tick / nominal_charge_capacity));
|
32
32
|
let new_polarization_potential: f64 = f64::exp(-tick / time_constant) * polarization_potential
|
33
33
|
+ current * polarization_resistance * (1.0 - f64::exp(-tick / time_constant));
|
34
34
|
let terminal_voltage: f64 = open_circuit_voltage + new_polarization_potential
|
@@ -7,9 +7,9 @@ from physics.models.motor import BasicMotor
|
|
7
7
|
class AdvancedMotor(BasicMotor):
|
8
8
|
def __init__(self, **kwargs):
|
9
9
|
super().__init__(**kwargs)
|
10
|
-
self.cornering_coefficient =
|
10
|
+
self.cornering_coefficient = 30 # tuned to Day 1 and 3 FSGP data
|
11
11
|
|
12
|
-
def calculate_energy_in(self, required_speed_kmh, gradients, wind_speeds, tick, coords):
|
12
|
+
def calculate_energy_in(self, required_speed_kmh, gradients, wind_speeds, tick, coords, plotting=False):
|
13
13
|
"""
|
14
14
|
A function which takes in array of elevation, array of wind speed, required
|
15
15
|
speed, returns the consumed energy.
|
@@ -19,11 +19,11 @@ class AdvancedMotor(BasicMotor):
|
|
19
19
|
:param np.ndarray wind_speeds: (float[N]) speeds of wind in m/s, where > 0 means against the direction of the vehicle
|
20
20
|
:param float tick: length of 1 update cycle in seconds
|
21
21
|
:param np.ndarray coords: ([float[N,2]) The lat,lon coordinate of the car at each tick
|
22
|
-
:returns: (float[N]) energy expended by the motor at every tick
|
22
|
+
:returns: (float[N] , float[N,3]) energy expended by the motor at every tick
|
23
23
|
:rtype: np.ndarray
|
24
24
|
|
25
25
|
"""
|
26
|
-
net_force, required_angular_speed_rads = self.calculate_net_force(required_speed_kmh, wind_speeds, gradients)
|
26
|
+
net_force, required_angular_speed_rads, road_friction_array, drag_forces, g_forces = self.calculate_net_force(required_speed_kmh, wind_speeds, gradients)
|
27
27
|
|
28
28
|
cornering_work = self.calculate_cornering_losses(required_speed_kmh, coords, tick)
|
29
29
|
|
@@ -39,8 +39,11 @@ class AdvancedMotor(BasicMotor):
|
|
39
39
|
motor_controller_input_energies = np.where(motor_controller_input_energies > 0,
|
40
40
|
motor_controller_input_energies, 0)
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
if plotting:
|
43
|
+
return motor_controller_input_energies, cornering_work, gradients, road_friction_array, drag_forces, g_forces
|
44
|
+
else:
|
45
|
+
return motor_controller_input_energies
|
46
|
+
|
44
47
|
def calculate_cornering_losses(self, required_speed_kmh, coords, tick):
|
45
48
|
"""
|
46
49
|
Calculate the energy losses due to cornering based on vehicle speed and trajectory.
|
@@ -130,7 +130,7 @@ class BasicMotor(BaseMotor):
|
|
130
130
|
|
131
131
|
net_force = road_friction_array + drag_forces + g_forces + acceleration_force
|
132
132
|
|
133
|
-
return net_force, required_angular_speed_rads
|
133
|
+
return net_force, required_angular_speed_rads, road_friction_array, drag_forces, g_forces
|
134
134
|
|
135
135
|
def calculate_energy_in(self, required_speed_kmh, gradients, wind_speeds, tick, **kwargs):
|
136
136
|
"""
|
physics_rs.cpython-39-darwin.so
CHANGED
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ubc-solar-physics
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.3
|
4
4
|
Summary: UBC Solar's Simulation Environment
|
5
5
|
Author: Fisher Xue, Mihir Nimgade, Chris Chang, David Widjaja, Justin Hua, Ilya Veksler, Renu Rajamagesh, Ritchie Xia, Erik Langille, Chris Aung, Nicolas Ric, Ishaan Trivedi, Jason Liang, Felix Toft, Mack Wilson, Jonah Lee, Tamzeed Quazi, Joshua Riefman
|
6
6
|
Author-email: UBC Solar <strategy@ubcsolar.com>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
physics_rs.cpython-39-darwin.so,sha256=
|
2
|
-
ubc_solar_physics-1.8.1.dist-info/RECORD,,
|
3
|
-
ubc_solar_physics-1.8.1.dist-info/LICENSE,sha256=DAej6EJNqQWTair3XPAQiqoJbly4BAT1JMOsZxoZvH0,1066
|
4
|
-
ubc_solar_physics-1.8.1.dist-info/WHEEL,sha256=Zesonz4Ava1_C5nhDPl253AOobZwhmAK4VwEBQq1e7c,107
|
5
|
-
ubc_solar_physics-1.8.1.dist-info/top_level.txt,sha256=jBZ5oyp1QQOrKodHG2UH9PMPEiZtza_q3y6fp3lEmQs,19
|
6
|
-
ubc_solar_physics-1.8.1.dist-info/METADATA,sha256=4LsfRJXbxi00HS2ll_dNHjTRNQhPaX19emja36CJa48,5002
|
1
|
+
physics_rs.cpython-39-darwin.so,sha256=uhPQja22uM-m_IaHjPTJFanhr2vGGGNeH9B327kxlA0,702192
|
7
2
|
physics_rs/__init__.pyi,sha256=bMMIbLFgpSYq37i9xHpvdoVlMuI7IRZ9bdbLCcIBeO8,4235
|
8
|
-
|
3
|
+
ubc_solar_physics-1.8.3.dist-info/RECORD,,
|
4
|
+
ubc_solar_physics-1.8.3.dist-info/LICENSE,sha256=DAej6EJNqQWTair3XPAQiqoJbly4BAT1JMOsZxoZvH0,1066
|
5
|
+
ubc_solar_physics-1.8.3.dist-info/WHEEL,sha256=Zesonz4Ava1_C5nhDPl253AOobZwhmAK4VwEBQq1e7c,107
|
6
|
+
ubc_solar_physics-1.8.3.dist-info/top_level.txt,sha256=jBZ5oyp1QQOrKodHG2UH9PMPEiZtza_q3y6fp3lEmQs,19
|
7
|
+
ubc_solar_physics-1.8.3.dist-info/METADATA,sha256=-pjgDDPDpXMacGJLFeOGRewLoJC1NYQtbDEk69B_iiY,5002
|
8
|
+
physics/_version.py,sha256=pisYjk2X9uBCFNqxKRgq9I6HdLknL1MGB8wfBJRDsHA,411
|
9
9
|
physics/lib.rs,sha256=uMeIRNVeeIpaxvvNM7qvCoSUzTzOdwOBEff_fP9XH18,8161
|
10
10
|
physics/models.rs,sha256=N5342VhLaLSlPLHZ7s1VDIEPY76-rQN03lY_wd2HS1A,59
|
11
11
|
physics/__init__.py,sha256=7939mrehCy0ogupHq26hUk1MkAjh2xmbD30GscdC_D8,169
|
@@ -21,17 +21,17 @@ physics/models/lvs/basic_lvs.py,sha256=UH6VmVWrSo-tKvcbSOm3Ptp0edz1xDQiQsM4HlOJ_
|
|
21
21
|
physics/models/lvs/lvs.rs,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
physics/models/lvs/__init__.py,sha256=GkO6SJxbbSnXYLdMDvsvTRhXotV3zaRNmYBgziQLGB8,107
|
23
23
|
physics/models/lvs/base_lvs.py,sha256=PVwPgCaJ_TcV2mQf3X2pngi0aG-jTLTeloL-LQV3jMU,110
|
24
|
-
physics/models/motor/advanced_motor.py,sha256=
|
24
|
+
physics/models/motor/advanced_motor.py,sha256=ur6Dpkq3R740_c3F1GXSLkckuuV1Y3ROAiJmIbyBxxA,9000
|
25
25
|
physics/models/motor/motor.rs,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
physics/models/motor/__init__.py,sha256=zkV7LiAozFNu9CRWWXeCbCDepjsaUIYT8Q2dkXJgLsM,183
|
27
|
-
physics/models/motor/basic_motor.py,sha256=
|
27
|
+
physics/models/motor/basic_motor.py,sha256=0QuUKwL0KqU6gtiYk21R6KwLtesJ4DJ_ARf0S4ekBrk,8680
|
28
28
|
physics/models/motor/base_motor.py,sha256=GTK0cQ5RiXdrrfhenvc2_zwF2XKnqupHI8gZdi-w3oM,107
|
29
29
|
physics/models/arrays/basic_array.py,sha256=cGBwyrYpR313ECJ-SwnrK3JzYo24NRE70j8sj-sxFQI,1332
|
30
30
|
physics/models/arrays/base_array.py,sha256=ZUjehd7vwNOBdFLUk9WJUeGOi9DPopYplH1gqAMnKgA,95
|
31
31
|
physics/models/arrays/arrays.rs,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
physics/models/arrays/__init__.py,sha256=yavs1K3JA6x3Aa-U1JCZJlcWggCOFrVxrrMCGsiceAw,119
|
33
33
|
physics/models/battery/battery_config.toml,sha256=Fn1pb3NJJ_nclxm9nfGEQKmJYA2d5a9jCAUbwUGu6Uw,1092
|
34
|
-
physics/models/battery/battery.rs,sha256=
|
34
|
+
physics/models/battery/battery.rs,sha256=iUCO-y0P_lZUn8-QhRtbaLvL7BR1zPRnhor52CmYf5g,5290
|
35
35
|
physics/models/battery/basic_battery.py,sha256=u0aO_iWKicVRECbDzLIs8goaWD5tLMnYGNe948lKC7U,5754
|
36
36
|
physics/models/battery/__init__.py,sha256=bIESRM8eEpaKSYMoliXD7rs3TUkAawTN9i3-YB2WCZg,630
|
37
37
|
physics/models/battery/battery_config.py,sha256=V4CfzUTcOFcizpDU9-Ujn2zXbUnAqrhyARN9QXGH6fk,4052
|
File without changes
|
File without changes
|
File without changes
|