Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hydesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TOPFARM
hydesign
Commits
cbaeb734
Commit
cbaeb734
authored
1 year ago
by
jumu
Committed by
Mikkel Friis-Møller
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix batt replacement
parent
42051e4b
No related branches found
No related tags found
1 merge request
!108
Fix batt replacement
Pipeline
#48461
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hydesign/battery_degradation.py
+3
-3
3 additions, 3 deletions
hydesign/battery_degradation.py
hydesign/tests/test_files/battery_degradation_battery_replacement.pickle
+0
-0
0 additions, 0 deletions
...test_files/battery_degradation_battery_replacement.pickle
with
3 additions
and
3 deletions
hydesign/battery_degradation.py
+
3
−
3
View file @
cbaeb734
...
...
@@ -176,7 +176,7 @@ def battery_replacement(
if
np
.
min
(
1
-
LoC
)
>
min_LoH
:
# First battery is NOT fully used after the full lifetime
try
:
#split the minimum into the number of levels
ind_q
=
[
np
.
where
(
1
-
LoC
<
q
)[
0
][
0
]
for
q
in
np
.
linspace
(
1
,
np
.
min
(
1
-
LoC
),
n_steps_in_LoH
+
1
+
1
,
endpoint
=
False
)]
for
q
in
np
.
linspace
(
1
,
np
.
min
(
1
-
LoC
),
n_steps_in_LoH
+
1
,
endpoint
=
False
)]
ind_q_last
=
ind_q
[
-
1
]
except
:
#split the time into equal number of levels
ind_q
=
np
.
linspace
(
0
,
len
(
rf_i_start
),
n_steps_in_LoH
+
1
,
dtype
=
int
,
endpoint
=
False
)
...
...
@@ -207,7 +207,7 @@ def battery_replacement(
if
min_LoH
>
(
1
-
LoC_new
[
-
1
]):
ind_q_new
=
[
np
.
where
(
1
-
LoC_new
<
q
)[
0
][
0
]
+
ind_q_last
for
q
in
np
.
linspace
(
1
,
min_LoH
,
n_steps_in_LoH
+
1
,
endpoint
=
Tru
e
)]
for
q
in
np
.
linspace
(
1
,
min_LoH
,
n_steps_in_LoH
+
1
,
endpoint
=
Fals
e
)]
ind_q_last
=
ind_q_new
[
-
1
]
ind_q
=
ind_q
+
ind_q_new
[
1
:]
...
...
@@ -220,7 +220,7 @@ def battery_replacement(
except
:
raise
(
'
This many bateries are not required. Reduce the number.
'
)
return
LoC
,
ind_q
,
ind_q_last
def
degradation
(
rf_DoD
,
rf_SoC
,
rf_count
,
rf_i_start
,
avr_tem
,
LLoC_0
=
0
):
...
...
This diff is collapsed.
Click to expand it.
hydesign/tests/test_files/battery_degradation_battery_replacement.pickle
+
0
−
0
View file @
cbaeb734
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment