Kitchin Research Group - Latest Commentshttp://kitchinresearchgroup.disqus.com/enFri, 11 Jan 2019 06:07:22 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4280108612<p>@JohnKitchin Can anybody help me to convert python code matlab code?</p>ThineshFri, 11 Jan 2019 06:07:22 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2015/04/03/Getting-data-from-the-Scopus-API#comment-4266037605<p>I am trying to search publication based on affiliations. I'm using the request as : <a href="https://api.elsevier.com/content/search/author?query=affil(Monash)" rel="nofollow noopener" title="https://api.elsevier.com/content/search/author?query=affil(Monash)">https://api.elsevier.com/co...</a>. I'm not getting publications only from Monash. There are other affiliations too, how can I get publications from only that particular univ or institution.</p>KSWed, 02 Jan 2019 10:04:52 -0000Re: Autograd and the derivative of an integral functionhttp://jkitchin.github.io/blog/2018/10/10/Autograd-and-the-derivative-of-an-integral-function#comment-4238596600<p>Thanks John.</p>Ali PanahiThu, 13 Dec 2018 10:04:32 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2015/04/24/Commenting-in-org-files#comment-4230323116<p>Excellent Post, thanks for sharing.<br><a href="http://musictarin.com/" rel="nofollow noopener" title="http://musictarin.com/">http://musictarin.com/</a></p>sara jjjjFri, 07 Dec 2018 17:58:50 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2014/02/02/Printing-unicode-characters-in-Python-strings#comment-4228812143<p>What if my script itself is all-UTF-8? Then `print("füße")` will output `f\xc3\xbc\xc3\x9fe`. Why is ASCII still the default encoding anyway, 20 years after Unicode/UTF-8 it became the common standard encoding?</p>BAReFOOtThu, 06 Dec 2018 18:56:04 -0000Re: A new ode integrator function in scipyhttp://jkitchin.github.io/blog/2018/09/04/A-new-ode-integrator-function-in-scipy#comment-4228633309<p>It is somewhat clunky to do that. You can set dense_output=True, which will include a function in the output that can be used at each t_event to get the solution values. I don't know a way to do it all in one pass.</p>JohnKitchinThu, 06 Dec 2018 16:22:47 -0000Re: A new ode integrator function in scipyhttp://jkitchin.github.io/blog/2018/09/04/A-new-ode-integrator-function-in-scipy#comment-4228339715<p>Hi, I am using scipy_ivp for the Three Body Problem, and I have the event when the solution crosses the y-axis, the output give me the t_events which is the time that this event occur but I would like as a output the solution(the values of each coord.) at this point. It is possiible?</p>Marta Pardo AraujoThu, 06 Dec 2018 13:04:50 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4228015707<p>It should be possible.</p>JohnKitchinThu, 06 Dec 2018 10:10:25 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4227987903<p>D is constant, r is radius of cylindrical tubular membrane, y is height of membrane</p>ThineshThu, 06 Dec 2018 09:51:07 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4227986549<p>@JohnKitchin is that possible to model mass diffusion in cylindrical u {dc/dy) = D/r (d (rdc/dr) /dr) using smilar method. i just know the input flow rate and concnetration</p>ThineshThu, 06 Dec 2018 09:50:12 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4223576994<p>Sure it is common to do that. Also, when you train your neural net, it looks like the size of input time vector is very small. It makes sense for this simple ode system but for more complicated system like lorenz system, i guess it may require more time steps and the neural net will be more difficult to train. For solving PDE, it may have the same problem when you try to include two variables in the input vector.</p>Kun SuMon, 03 Dec 2018 13:49:01 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4219754508<p>Usually you flatten the input vectors to make them 1D.</p>JohnKitchinFri, 30 Nov 2018 17:05:22 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4219751214<p>Is it possible to use this neural net idea to solve a 2 dimensional PDE (like a elliptic Laplace's eqn)? In that case, the inputs of neural net become a 2D matrix instead of a vector, how would you deal with these 2D inputs?</p>Kun SuFri, 30 Nov 2018 17:02:46 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2013/02/18/Fitting-a-numerical-ODE-solution-to-data#comment-4218380720<p>Hi, I am trying to extend this example to system of two differential equations with two parameters. bt i am not getting the answers. my code is<br>import numpy as np<br>from scipy.optimize import curve_fit<br>from scipy.integrate import odeint<br>import numpy as np<br>from scipy.optimize import curve_fit<br>from scipy.integrate import odeint</p><p># given data we want to fit<br>tspan = [0, 0.1, 0.2, 0.3, 0.4, 0.5]<br>Ca_data =[[0, 0.00377578, 0.0075035 , 0.01118369, 0.01481697, 0.01840388],[1, 0.99621855, 0.9924739 , 0.98876566, 0.98509336,0.98145661]]</p><p>def fitfunc(t, k):</p><p> 'Function that returns Ca computed from an ODE for a k'<br> def dU_dx(U, t):<br> return [-k[0]*U[0]+0.038*U[1],k[1]*U[0]-0.038*U[1]]</p><p> U0=[0,1]<br> Casol = odeint(dU_dx, U0, tspan)</p><p> return Casol<br>p0=[1,1] <br>k_fit, kcov = curve_fit(fitfunc, tspan, Ca_data, p0)<br>print (k_fit)</p><p>tfit = np.linspace(0,1);<br>fit1 = fitfunc(tfit, k_fit)<br>#fit2 = fitfunc(tfit, k_fit[1])<br>import matplotlib.pyplot as plt<br>plt.figure(1)<br>plt.plot(tspan, Ca_data[0], 'ro', label='data')<br>plt.plot(tfit, fit1[0], 'b-', label='fit')<br>plt.legend(loc='best')</p><p>plt.figure(2)<br>plt.plot(tspan, Ca_data[1], 'ro', label='data')<br>plt.plot(tfit, fit1[1], 'b-', label='fit')<br>plt.legend(loc='best')</p>shumailaThu, 29 Nov 2018 20:00:15 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2013/03/11/Solving-the-Blasius-equation#comment-4212082114<p>hi! thank you very much, Mr. Kitchin, you have helped me a lot.</p><p>could you please explain the shooting method (algorithm) for this Blasius problem? in mathematical notation, because i was having a hard time to understand the code (sorry).</p><p>i derive the Blasius D.E. as</p><p>f.f" + 2.f"' = 0</p><p>so, f'3 = -2.f1.f3</p><p>Thank you very much, Mr. Kitchin.</p>Dimas Maulana RachmanSun, 25 Nov 2018 22:38:43 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2014/08/08/What-we-are-using-org-mode-for#comment-4209347955<p>Use beamer to structure your posters. Export your Emacs org-mode document to latex. Modify your preamble using M-x-org-export-default-latex. Install beamer on your system or texmf as the case may be.</p>ArinFri, 23 Nov 2018 18:41:59 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2015/07/01/Spoken-translations-in-Emacs#comment-4195838086<p>thank for share this with us</p>dịch thuật miền trungThu, 15 Nov 2018 02:08:38 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2014/10/19/Using-Pymacs-to-integrate-Python-into-Emacs#comment-4178540042<p>I hadn't noticed the previous - next pages in the category sections.<br>Thank you for the reply<br>It's time to close shop for tonight.<br>Goodnight and sweet dreams sir.</p>Guy BongersSun, 04 Nov 2018 17:06:08 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2013/03/11/Solving-the-Blasius-equation#comment-4178535722<p>I would switch to the solve_bvp solver in scipy and use greater etas with that. I don't know why it wouldnt work with this code though.</p>JohnKitchinSun, 04 Nov 2018 17:02:39 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2013/03/11/Solving-the-Blasius-equation#comment-4178511198<p><a href="https://uploads.disquscdn.com/images/d20a19476a6be2d5cb1a3badbb2659dbcabf20cf8967e242fb9b41af0eb47cbd.png" rel="nofollow noopener" title="https://uploads.disquscdn.com/images/d20a19476a6be2d5cb1a3badbb2659dbcabf20cf8967e242fb9b41af0eb47cbd.png">https://uploads.disquscdn.c...</a></p><p>Based on your code I plot the streamlines and the BL thickness (uniform speed 1 m/s, kinematic viscosity 1.5(10)^-5, 3m long plate) but I haven't enough x,y data. So, I tried to increase the eta value to get more values as suggested by Kundu, however I get different solutions.</p><p>How can I get accurate results for eta values greater than 6?</p><p>Thank you</p>DiegoAndres SiguenzaSun, 04 Nov 2018 16:43:40 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2014/10/19/Using-Pymacs-to-integrate-Python-into-Emacs#comment-4177960469<p>It looks like it is in <a href="http://kitchingroup.cheme.cmu.edu/blog/category/emacs/21/" rel="nofollow noopener" title="http://kitchingroup.cheme.cmu.edu/blog/category/emacs/21/">http://kitchingroup.cheme.c...</a> or <a href="http://kitchingroup.cheme.cmu.edu/blog/category/python/10/" rel="nofollow noopener" title="http://kitchingroup.cheme.cmu.edu/blog/category/python/10/">http://kitchingroup.cheme.c...</a>.</p>JohnKitchinSun, 04 Nov 2018 09:58:25 -0000Re: The Kitchin Research Grouphttp://jkitchin.github.io/blog/2014/10/19/Using-Pymacs-to-integrate-Python-into-Emacs#comment-4177947513<p>hello.<br>I can not find this page using category emacs or python.<br>It is not on those category pages</p><p>Have a nice day</p>Guy BongersSun, 04 Nov 2018 09:47:57 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4176668060<p>I did something quite similar many many years ago. Then I explicitly computed the derivatives by hand (eg using a lot of matrix algebra and the chain rule).</p><p>Maybe a better trade off betwen efficiency and convienciency would be to use autograd just for the activation and then use matrix algebra to propagate the weigths.</p><p>Will give this a try in a couple of weeks...</p>Kristoffer AnderssonSat, 03 Nov 2018 11:52:43 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4176641463<p>Maybe. I still think it would work and work faster to compute the derivatives. Maybe the coupled net ends up being more accurate with less training though, or converges in fewer steps. Someone will have to try it and see!</p>JohnKitchinSat, 03 Nov 2018 11:31:21 -0000Re: Solving coupled ODEs with a neural network and autogradhttp://jkitchin.github.io/blog/2018/11/02/Solving-coupled-ODEs-with-a-neural-network-and-autograd#comment-4176203211<p>If you use seprate nets for each species you would loose the "structural information" that is implicit for using the same net in describing all three species.</p>Kristoffer AnderssonSat, 03 Nov 2018 03:05:08 -0000