Skip to content

Bug in ex_fitting_5pdeer_pathways #513

Description

@HKaras

I think there is a bug in the calculations of the individual pathways. (1-np.sum(lams)) is applied twice to Vinter, once in line 75 and again in line 77. This changes the final amplitudes.

Vinter = results.P_scale*(1-np.sum(lams))*np.prod([dl.bg_hom3d(t-reftime,results.conc,lam) for lam,reftime in zip(lams,reftimes)],axis=0)
for (lam,reftime,color,label) in zip(lams,reftimes,colors,labels):
Vpath = (1-np.sum(lams) + lam*dl.dipolarkernel(t-reftime,r)@Pfit)*Vinter
plt.plot(t,Vpath,linewidth=3,label=f'Pathway #{label}',color=color)

This can be fixed by change line 75, removing(1-np.sum(lams)):

Vinter = results.P_scale*np.prod([dl.bg_hom3d(t-reftime,results.conc,lam) for lam,reftime in zip(lams,reftimes)],axis=0)

With this change you can now visually overlay the pathways with the experimental data and full fit.

Before

Image

After

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions