lennardjones | Lennard Jones Molecular Dynamics in C

 by   wesbarnett C++ Version: v0.1beta License: GPL-2.0

kandi X-RAY | lennardjones Summary

kandi X-RAY | lennardjones Summary

lennardjones is a C++ library typically used in Simulation applications. lennardjones has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

Simulates Lennard Jonesium using Molecular Dynamics. The program is written in C++ and requires Boost libraries and development headers for reading the .ini file, and xdrfile for writing the trajectory to .xtc. Some of the classes I use are based on my libgmxcpp library. Reduced units are used.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              lennardjones has a low active ecosystem.
              It has 9 star(s) with 3 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              lennardjones has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of lennardjones is v0.1beta

            kandi-Quality Quality

              lennardjones has 0 bugs and 0 code smells.

            kandi-Security Security

              lennardjones has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              lennardjones code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              lennardjones is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              lennardjones releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lennardjones
            Get all kandi verified functions for this library.

            lennardjones Key Features

            No Key Features are available at this moment for lennardjones.

            lennardjones Examples and Code Snippets

            Lennard Jones Molecular Dynamics in C++,Compiling
            C++dot img1Lines of Code : 5dot img1License : Strong Copyleft (GPL-2.0)
            copy iconCopy
            mkdir build
            cd build
            cmake ..
            make
            make install
              
            Lennard Jones Molecular Dynamics in C++,Running
            C++dot img2Lines of Code : 1dot img2License : Strong Copyleft (GPL-2.0)
            copy iconCopy
            ljmd md.ini
              

            Community Discussions

            QUESTION

            Is there a way to pass the parameters within the script in bash?
            Asked 2021-Jul-16 at 08:28

            I am new to bash and trying to run the following command in bash.

            ...

            ANSWER

            Answered 2021-Jul-16 at 08:28

            From what I understand, the program is asking you to type those parameters, because it won't read them as command line arguments. If that is the case, you could try to read from a file (but there's a better option!) like this in your script.sh:

            Source https://stackoverflow.com/questions/68396452

            QUESTION

            Curve_fit for a function that returns a numpy array
            Asked 2021-Apr-11 at 09:12

            I know the library curve_fit of scipy and its power to fitting curves. I have read many examples here and in the documentation, but I cannot solve my problem. For example, I have 10 files (chemical structers but it does not matter) and ten experimental energy values. I have a function inside a class that calculates for each structure the theoretical energy for some parameters and it returns a numpy array with the theoretical energy values.

            I want to find the best parameters to have the theoretical values nearest to the experimental ones. I will furnish here the minimum exemple of my code

            This is the class function that reads the experimental energy files, extracts the correct substring and returns the values as a numpy array. The self.path is just the directory and self.nPoints = 10. It is not so important, but I furnish for the sake of completeness

            ...

            ANSWER

            Answered 2021-Apr-11 at 09:12
            Curve fitting

            The curve_fit fits a function f(w, x[i]) to points y[i] by finding w that minimizes sum((f(w, x[i] - y[i])**2 for i in range(n)). As you will read in the first line after the function definition

            [It uses] non-linear least squares to fit a function, f, to data.

            It refers to least_squares where it states

            Given the residuals f(x) (an m-D real function of n real variables) and the loss function rho(s) (a scalar function), least_squares finds a local minimum of the cost function F(x):

            Curve fitting is a kind of convex-cost multi-objective optimization. Since the each individual cost is convex, you can add all of them and that will still be a convex function. Notice that the decision variables (the parameters to be optimized) are the same in every point.

            Your problem

            In my understanding for each energy level you have a different set of parameters, if you write it as a curve fitting problem, the objective function could be expressed as sum((f(w[i], x[i]) - y[i])**2 ...), where y[i]is determined by the energy level. Since each of the terms in the sum is independent on the other terms, this is equivalent to finding each group of parametersw[i]separately minimizing(f(w[i], x[i]) - y[i])**2`.

            Convexity

            Convexity is a very convenient property for optimization because it ensures that you will have only one minimum in the parameter space. I am not doing a detailed analysis but have reasonable doubts about the convexity of your energy function.

            1. The Lennard Jones function has the difference of a repulsive and an attractive force both with negative even exponent on the distance this alone is very unlikely to be convex.

            2. The sum of multiple local functions centered at different positions has no defined convexity.

            3. Molecular energy, or crystal energy, or protein folding are well known to be non-convex.

            A few days ago (on a bike ride) I was thinking about this, how the molecules will be configured in a global minimum energy, and I was wondering if it finds that configuration so rapidly because of quantum tunneling effects.

            Non-convex optimization

            The non-convex (global) optimization is different from (non-linear) least-squares, in the sense that when a local minimum is found the process don't return immediately, it start making new attempts in different regions of the search spaces. If the function is smooth you can still take advantage of a gradient based local optimization method, but the complexity is still NP.

            A classic global optimization method is the Simulated annenaling, if you have a chemical background I think you will have some insights reading about it. Once upon a time, simulated annealing was provided in scipy.optimize.

            You will find a few global optimization methods in scipy.optimize. I would encourage you to try Basin hopping, since it was successfully applied to similar problems, as you can read in the references.

            I hope this drop you on the right way to your solution. But, be aware that you will probably need to spend, learning how to use the function and will need to make some decisions. You will need to find a balance of accuracy, simplicity, efficiency.

            If you want better solution take the time to derive the gradient of the cost function (you can return two values f, and df, where df is the gradient of f with respect to the decision variables).

            Source https://stackoverflow.com/questions/66983473

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install lennardjones

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/wesbarnett/lennardjones.git

          • CLI

            gh repo clone wesbarnett/lennardjones

          • sshUrl

            git@github.com:wesbarnett/lennardjones.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link