From fcb91302171828d9d853ade610ef7bba552bdcde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Ram=C3=ADrez?= Date: Fri, 15 Dec 2023 13:05:24 +0100 Subject: [PATCH] New fileparameter "rec" allows to fit simultaneously Creep and Creep Recovery experiments of the same sample. --- RepTate/theories/TheoryRetardationModes.py | 11 +++++++++-- data/Creep/CM3_CreepRecovery.creep | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RepTate/theories/TheoryRetardationModes.py b/RepTate/theories/TheoryRetardationModes.py index e6f96b15..fab4abe4 100644 --- a/RepTate/theories/TheoryRetardationModes.py +++ b/RepTate/theories/TheoryRetardationModes.py @@ -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**""" @@ -309,6 +309,10 @@ 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: @@ -316,7 +320,10 @@ def RetardationModesTime(self, f=None): 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""" diff --git a/data/Creep/CM3_CreepRecovery.creep b/data/Creep/CM3_CreepRecovery.creep index 9e6a37ef..3fd29427 100644 --- a/data/Creep/CM3_CreepRecovery.creep +++ b/data/Creep/CM3_CreepRecovery.creep @@ -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