Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback and questions #1

Closed
mhlbapat opened this issue May 29, 2022 · 3 comments
Closed

Feedback and questions #1

mhlbapat opened this issue May 29, 2022 · 3 comments

Comments

@mhlbapat
Copy link

mhlbapat commented May 29, 2022

This repo is terrific! Neat work. I am trying to generate master curves using this tool for my research. A few initial thoughts:

  • Examples from the "demos" folder do not have labels for the plots generated by "mc.plot()". That makes it challenging to recognize the plots and associated transformations initially.
  • Can you add more documentation/manual for the code for beginners? E.g., what variables to access to get the scaling parameter value?
  • I am facing issues with replicating the diffusion from the point source example in the paper. I have attached my code. It would be great if you could help me replicate the example, pointing me in the right direction to use this tool.
import matplotlib
from matplotlib import pyplot as plt
from mastercurves.transforms import Multiply
from mastercurves import MasterCurve

def func(x,t):
	c = (1/np.sqrt(4*np.pi*t))*np.exp(-(x**2)/4*t)
	return c

x1 = np.linspace(0.1,2)
ct1 = np.array([func(i, 1) for i in x1])
ct2 = np.array([func(i, 2) for i in x1])
ct3 = np.array([func(i, 3) for i in x1])
ct4 = np.array([func(i, 4) for i in x1])

dataX = [x1, x1, x1, x1]
dataY = [ct1, ct2, ct3, ct4]

dataX_log = [np.log(i) for i in dataX]
dataY_log = [np.log(i) for i in dataY]

t_states = [1,2,3,4]

mc = MasterCurve()
mc.add_data(dataX_log, dataY_log, t_states)
mc.set_gp_kernel(mc.kernel)
# mc.add_vtransform(Multiply())
mc.add_htransform(Multiply())
mc.superpose()
mc.plot()
plt.show()
@krlennon
Copy link
Owner

Thanks! Some more documentation will be added soon which should address your first two comments. As for the third, it looks like you've got a small bug in the definition of the concentration profile function (missing parentheses in the denominator in the exponential). Try replacing it with the following:

c = (1/np.sqrt(4*np.pi*t))*np.exp(-(x**2)/(4*t))

You'll also need to uncomment the mc.add_vtransform(Multiply()) line to get superposition.

You can also adjust the fixed noise level for GP to improve the results. For this example, the results will be closer to the ideal example in the paper if you don't include any fixed noise. You can do this when initializing the MasterCurve object:

mc = MasterCurve(fixed_noise=0)

Feel free to follow up if needed. I'll leave this issue open until the docs are available.

@krlennon
Copy link
Owner

Docs are now available online! You can check them out here. They give more detailed documentation for the API, and
some walkthroughs for the demos. I'll continue to add more walkthroughs over time.

Also created a tutorial based on this issue. You can check it out for a step-by-step guide to running the diffusion example.

Thanks for the feedback and comments!

@mhlbapat
Copy link
Author

Thanks a lot, will check them out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants