source: src/Potentials/Specifics/PairPotential_Harmonic.hpp@ 65c42c

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 65c42c was 65c42c, checked in by Frederik Heber <heber@…>, 12 years ago

PairPotential_Harmonic now has additional offset parameter.

  • do we need this value in general or not?. A constant should in fact be removed by zero and first order ... but it has to to remove the minimum value. Otherwise the fit cannot converge properly (hence the parameter probably inavoidable for stability).
  • With this setup we were able to successfully fit to a C2H6 system where the CC bond length was specifically manipulated. However, the harmonic function is not the best model, a Morse potential seems more adept.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * PairPotential_Harmonic.hpp
3 *
4 * Created on: Sep 26, 2012
5 * Author: heber
6 */
7
8#ifndef PAIRPOTENTIAL_HARMONIC_HPP_
9#define PAIRPOTENTIAL_HARMONIC_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17
18#include "Potentials/EmpiricalPotential.hpp"
19#include "FunctionApproximation/FunctionModel.hpp"
20
21/** This is the implementation of a harmonic pair potential.
22 *
23 * This evaluates \f$ k \cdot (r -r_0)^2 \f$.
24 *
25 */
26class PairPotential_Harmonic : public EmpiricalPotential, public FunctionModel
27{
28public:
29 PairPotential_Harmonic();
30 PairPotential_Harmonic(
31 const double _spring_constant,
32 const double _equilibrium_distance,
33 const double _energy_offset) :
34 spring_constant(_spring_constant),
35 equilibrium_distance(_equilibrium_distance),
36 energy_offset(_energy_offset)
37 {}
38 virtual ~PairPotential_Harmonic() {}
39
40 /** Setter for parameters as required by FunctionModel interface.
41 *
42 * \param _params given set of parameters
43 */
44 void setParameters(const parameters_t &_params);
45
46 /** Getter for parameters as required by FunctionModel interface.
47 *
48 * \return set of parameters
49 */
50 parameters_t getParameters() const;
51
52 /** Getter for the number of parameters of this model function.
53 *
54 * \return number of parameters
55 */
56 size_t getParameterDimension() const
57 {
58 return 3;
59 }
60
61 /** Evaluates the harmonic potential function for the given arguments.
62 *
63 * @param arguments single distance
64 * @return value of the potential function
65 */
66 results_t operator()(const arguments_t &arguments) const;
67
68 /** Evaluates the derivative of the potential function.
69 *
70 * @param arguments single distance
71 * @return vector with derivative with respect to the input degrees of freedom
72 */
73 derivative_components_t derivative(const arguments_t &arguments) const;
74
75private:
76 //!> the spring constant for the harmonic potential
77 double spring_constant;
78 //!> the equilibrium distance indicating the potential minimum
79 double equilibrium_distance;
80 //!> energy offset
81 double energy_offset;
82};
83
84#endif /* PAIRPOTENTIAL_HARMONIC_HPP_ */
Note: See TracBrowser for help on using the repository browser.