bounds = { "R1": [0, 1000], "Q1": [0, 1e-2], "alpha1": [0.1, 0.9], "R2": [0, 1000], "W1": [1, 200] } true_params = {"R1": 10, "Q1": 0.001, "alpha1": 0.8} param_names = ["R1", "Q1", "alpha1"] sim = EIS_genetics() normaliser = EIS(circuit=ZARC, parameter_bounds=bounds, parameter_names=param_names, test=True, fitting=True) sim1 = normaliser.simulate([true_params[x] for x in param_names], omegas) fig, ax = plt.subplots(1, 2) sim.plot_data(sim.dict_simulation(ZARC, omegas, [], [true_params[x] for x in param_names], param_names), ax[1], label="Analytic frequency simulation") num_oscillations = 3 time_start = 0 sampling_rate = 200 def cpe1(denom, i, charge_array, time_array, dt): total = 0 if i != 0: time_array = np.flip(time_array)
for R3 in [10, 50, 100, 150, 200, 250]: for i in range(0, len(frequencies)): params = { "R1": 10, "R3": R3, "C2": 1e-3, "R2": 250, "Q1": 2e-3, "omega": frequencies[i], "C1": 1e-6, "W1": 40, "alpha1": 1 } #spectra[0][i]=gamry_randles(**params) start = time.time() spectra[1][i] = test.simulate(**params) times[1] = time.time() - start print(times) #plt.plot(np.real(spectra[0,:]), -np.imag(spectra[0,:]), label="hard") ax[0, -1].plot(np.real(spectra[1, :]), -np.imag(spectra[1, :]), label=R3) ax[0, -1].scatter( np.real(spectra[1, :])[0::8], -np.imag(spectra[1, :])[0::8]) plt.legend() ax[0, -1].set_title("R3") for C2 in [1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1]: for i in range(0, len(frequencies)): params = { "R1": 10, "R3": 100, "C2": C2, "R2": 250,