Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Commits
b34d8df8
Commit
b34d8df8
authored
1 year ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
update SXI thermal model
parent
ede65ec7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ccs/thermal_model.py
+19
-16
19 additions, 16 deletions
Ccs/thermal_model.py
with
19 additions
and
16 deletions
Ccs/thermal_model.py
+
19
−
16
View file @
b34d8df8
...
...
@@ -13,10 +13,17 @@ import calibrations_SMILE as cal
from
ccs_function_lib
import
get_pool_rows
,
filter_rows
SIGMA_SB
=
5.6703744191844314e-08
TZERO
=
273.15
VCTRL_MIN
=
0.4
VCTRL_MAX
=
2.9
VHTR_MIN
=
0.
VHTR_MAX
=
14.
# linfit = np.polynomial.polynomial.Polynomial.fit((VCTRL_MIN, VCTRL_MAX), (VHTR_MIN, VHTR_MAX), 1)
# a0, a1 = linfit.convert().coef
rng
=
np
.
random
.
default_rng
()
...
...
@@ -48,7 +55,7 @@ def log_norm(n, a, b):
def
sigmoid
(
n
,
a
,
b
):
x
=
np
.
linspace
(
-
b
,
b
,
n
)
y
=
x
/
(
1
+
abs
(
x
))
y
=
x
/
(
1
+
np
.
abs
(
x
))
yn
=
normalise
(
y
)
return
yn
...
...
@@ -91,17 +98,13 @@ def vctrl_to_vhtr(vctrl):
:param vctrl:
:return:
"""
vctrl_min
=
0.2
vctrl_max
=
3.1
vhtr_min
=
0.
vhtr_max
=
14.
if
vctrl
<
vctrl_min
:
return
vhtr_min
elif
vctrl
>
vctrl_max
:
return
vhtr_max
if
vctrl
<
VCTRL_MIN
:
return
VHTR_MIN
elif
vctrl
>
VCTRL_MAX
:
return
VHTR_MAX
else
:
return
((
vctrl
-
vctrl_min
)
/
(
vctrl_max
-
vctrl_min
))
*
(
vhtr_max
-
vhtr_min
)
return
((
vctrl
-
VCTRL_MIN
)
/
(
VCTRL_MAX
-
VCTRL_MIN
))
*
(
VHTR_MAX
-
VHTR_MIN
)
class
ThermalModel
:
...
...
@@ -153,7 +156,7 @@ class ThermalModel:
n0
=
0
df
=
np
.
diff
(
self
.
_delay_func
(
n
-
n0
+
1
,
1
,
self
.
f_k
))
assert
df
.
sum
()
==
1.
assert
df
.
sum
()
.
round
(
3
)
==
1.
# make sure energy is conserved
return
np
.
concatenate
([
np
.
zeros
(
n0
),
df
])
...
...
@@ -184,7 +187,7 @@ class ThermalModel:
def
calc_t_new
(
self
):
heatpwr
=
self
.
heat
()
coolpwr
=
self
.
cool
()
return
self
.
T
+
(
heatpwr
*
self
.
step
-
coolpwr
*
self
.
step
)
/
(
cp_al
(
ctok
(
self
.
T
))
*
self
.
mass
),
heatpwr
,
coolpwr
return
self
.
T
+
(
(
heatpwr
-
coolpwr
)
*
self
.
step
)
/
(
cp_al
(
ctok
(
self
.
T
))
*
self
.
mass
),
heatpwr
,
coolpwr
def
start
(
self
):
...
...
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