Skip to content

Commit

Permalink
New fileparameter "rec" allows to fit simultaneously Creep and Creep …
Browse files Browse the repository at this point in the history
…Recovery experiments of the same sample.
  • Loading branch information
jorge-ramirez-upm committed Dec 15, 2023
1 parent 22fc20a commit fcb9130
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions RepTate/theories/TheoryRetardationModes.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class TheoryRetardationModesTime(QTheory):
citations = []
doi = []
html_help_file = "http://reptate.readthedocs.io/manual/Applications/Creep/Theory/theory.html#retardation-modes"
single_file = True
single_file = False

def __init__(self, name="", parent_dataset=None, ax=None):
"""**Constructor**"""
Expand Down Expand Up @@ -309,14 +309,21 @@ def RetardationModesTime(self, f=None):
tau = np.logspace(
self.parameters["logtmin"].value, self.parameters["logtmax"].value, nmodes
)
try:
rec = int(f.file_parameters["rec"])
except (ValueError, KeyError):
rec = 0

for i in range(nmodes):
if self.stop_theory_flag:
break
expT_tau = 1.0 - np.exp(-tt.data[:, 0] / tau[i])
J = np.power(10, self.parameters["logJ%02d" % i].value)
tt.data[:, 1] += stress * J * expT_tau
tt.data[:, 1] += stress * (J0 + tt.data[:, 0] / eta0)
if rec == 1:
tt.data[:, 1] += stress * J0
else:
tt.data[:, 1] += stress * (J0 + tt.data[:, 0] / eta0)

def plot_theory_stuff(self):
"""Plot theory helpers"""
Expand Down
2 changes: 1 addition & 1 deletion data/Creep/CM3_CreepRecovery.creep
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
chem=PE;label=CM3;T=150;stress=10;
chem=PE;label=CM3;T=150;stress=10;rec=1;
t strain stress T
s - Pa C
0.01 8.98254E-5
Expand Down

0 comments on commit fcb9130

Please sign in to comment.