diff --git a/Model.py b/Model.py index 50486a4..96abee5 100644 --- a/Model.py +++ b/Model.py @@ -391,7 +391,9 @@ class Model: break V = np.array([self.mem_potential(t) for t in times]) + return states, V + def plot_results(self, times, states, V): # plt.plot(times, V) fig = plt.figure() ax1 = fig.add_subplot(141) @@ -431,7 +433,7 @@ class Model: ax4.set_xlabel("time [ms]") ax4.set_ylabel(r"$\mu mol/3l$") - return states, V + plt.show() if __name__ == "__main__": @@ -439,32 +441,9 @@ if __name__ == "__main__": # Cass, Os, C2, C3, C4, I1, I2, I3, LTRPNCa, HTRPNCa, Cai, FCa= states model = Model() - Cai_0 = 0.11712 # Cai - FCa_0 = (model.k_on * model.F_tot * Cai_0) / (model.k_on * Cai_0 + model.k_off) - # print(FCa_0) + initial_values = model.get_initial_values() + times = np.arange(0, 1000, 1.0) - # Cass, Os, C2, C3, C4, I1, I2, I3, LTRPNCa, HTRPNCa, Ca_NSR, Ca_JSR, P_RyR, P_O1, P_O2, P_C2, Cai, FCa = states - initial_values = [ - Cai_0, # Cass - 0.930308e-18, # Os, - 0.124216e-3, # C2, - 0.578679e-8, # C3, - 0.119816e-12, # C4, - 0.497923e-18, # I1, - 0.345847e-13, # I2, - 0.185106e-13, # I3, - 11.2684, # LTRPNCa, - 125.290, # HTRPNCa - 1299.50, # Ca_NSR - 1299.50, # Ca_JSR - 0.0, # P_RyR - 0.149102e-4, # P_O1 - 0.951726e-10, # P_02 - 0.167740e-3, # P_C2 - Cai_0, # Cai - FCa_0, # FCa - ] - model.solve(initial_values=initial_values, tspan=[0, 1000], dt=1.0, times=None) - plt.show() - plt.close('all') - \ No newline at end of file + states, V = model.solve(initial_values=initial_values, tspan=[0, 1000], dt=1.0, times=times) + + model.plot_results(times, states, V) diff --git a/__pycache__/Model.cpython-311.pyc b/__pycache__/Model.cpython-311.pyc index 9071fef..9ac3eb2 100644 Binary files a/__pycache__/Model.cpython-311.pyc and b/__pycache__/Model.cpython-311.pyc differ diff --git a/fitter.py b/fitter.py index 4d5a9f9..0484c9a 100644 --- a/fitter.py +++ b/fitter.py @@ -226,4 +226,4 @@ if __name__ == "__main__": # fig.savefig(f"{plot_filename}.png") # fig.savefig(f"{plot_filename}.pdf") fig.savefig("naidis_fit.pdf") - # plt.show() + plt.show()