Hi Troels, This is a great idea! But it is rather disruptive. Therefore I have some suggestions below. Rather than answering all in one post, for a nicer thread structure at http://thread.gmane.org/gmane.science.nmr.relax.devel/5747, it is good to answer each point below in a separate post. That will also help focus discussions. Cheers! 1) You should make a subversion branch just for developing this feature. In case you give up or don't have the time, this will mean that the trunk will not be severely disrupted. 2) This is important - adding such a feature to the target functions is computationally expensive. I have tried it before in the model-free analysis, but rejected the commits because of the huge slow-down. And it is expensive coding-wise, as you would need to do that for all target functions for all analyses. Therefore you should not change target functions, but instead develop one generic wrapper function for all. This function would be sent into minfx as the target function. It would take the parameter vector, append it to a list, and then send the parameter vector into the real target function. 3) Because of 2), it would be better to create a special dx.minimise user function. This would be similar to the minimise user function, but would also add a few of the dx.map user function arguments. It could then create an OpenDX data file and matching *.general file. It could maybe even have a compulsory argument for a pre-created dx.map output, so that it can create a new *.net OpenDX program for the animation, which recycles many parts of the dx.map *.net program and uses the chi-squared surface data. As this would be a separate user function to the optimisation user functions, it should not change the model parameter values. I.e. it performs optimisation from the current parameter values but then ignores the result, only storing the parameter array for each iteration for it's own internal use. You should not change the relax data store. 4) You should understand the Nelder-Mead simplex algorithm verses all other algorithms in minfx. In the case of Nelder-Mead, you have a geometric object walking through the space (https://en.wikipedia.org/wiki/File:Nelder_Mead1.gif). For all other methods, you have a simple line. I.e. iteration 1 connects directly to 2, 2 to 3, 3 to 4, and so forth. For developing this, it would be good to start with a line representation. Once this works, you can then catch the 'simplex' algorithm in the dx.minimise user function, and then you can develop a special function to reconstruct the simplex from the parameter vector. This is not as easy as it seems, especially identifying this step http://home.gna.org/minfx/minfx.simplex-pysrc.html#Simplex.contract. You will need to know each part of the algorithm and the exact order of steps (http://home.gna.org/minfx/minfx.simplex-pysrc.html). Note that a majority of function calls by an optimisation algorithm will not be an optimisation step! See http://home.gna.org/minfx/. There are a lot of 'feeler' calls to allow the algorithm to understand the space it is in, before it actually makes the real step. 5) The analysis specific API. To support this idea, you will probably need to develop some standard methods for accessing the analysis specific optimisation code and data. Therefore you will need to work with the specific API. This will mean that a RelaxImplementError will be raised for all analyses which do not support the API functions yet. This is a clean way of handling this, and allows you to develop for only the dispersion analysis, while at the same time developing a feature that can be used for all other analyses in relax. This is how all non-analysis specific features in relax must be developed. It's rather simple - you will know exactly what methods to add when you get to a certain point and realise you need something. Then you add a prototype method to specific_analyses.api_base. And then add the method to specific_analyses.relax_disp.api to return the dispersion specific stuff. Regards, Edward On 11 May 2014 08:43, Troels E. Linnet <NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:
URL: <http://gna.org/task/?7794> Summary: Make dx capture x,y,z positions during minimisation to make a video of minimisation Project: relax Submitted by: tlinnet Submitted on: Sun 11 May 2014 06:43:07 AM UTC Should Start On: Sun 11 May 2014 12:00:00 AM UTC Should be Finished on: Mon 11 May 2015 12:00:00 AM UTC Category: relax's source code Priority: 1 - Later Status: Postponed Percent Complete: 0% Assigned to: tlinnet Open/Closed: Open Discussion Lock: Any Effort: 0.00 _______________________________________________________ Details: The idea is to make a dx.map with 3 parameters and map the chi isosurfaces. Then let dx.video function run a minimisation, and capture the the x,y,z coordinates of the parameters during the minimisation. This can then be mapped as frames on the the dx map. And then be turned into a video, showing the movement of the minimisation. That would be a 3d version of http://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method http://en.wikipedia.org/wiki/File:Nelder_Mead1.gif Some ideas to video can come from here http://physics.ucsd.edu/students/courses/winter2008/physics141/labnote2/dx_tutorial/DX_tutorial.html https://www10.cs.fau.de/Teaching/Courses/NuSiF/howto.shtml http://www.physics.usyd.edu.au/app/complex/sv3/chapter5_2.html _______________________________________________________ Reply to this item at: <http://gna.org/task/?7794> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@xxxxxxx To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel