Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
minimization_of_functions [2020/06/11 18:17] – external edit 127.0.0.1 | minimization_of_functions [2024/07/12 08:37] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Minimization of functions ====== | ||
+ | The minimization of general functions of one or more variables can be carried out using the command: | ||
+ | |||
+ | '' | ||
+ | |||
+ | where //func// represents a function of up to 50 variables //x$_1$, x$_2$, …//. Two different optimization methods can be selected as described below which do or do not use numerical derivative information. | ||
+ | |||
+ | The optimization method, as well as finer control over //func//, can be chosen using the '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | where //key// defines the optimization method. Valid options for //key// are: | ||
+ | |||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | Options to these methods, //key1, key2, …//, are: | ||
+ | |||
+ | * **'' | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | * **'' | ||
+ | |||
+ | Miscellaneous directives (separated by semicolons or linebreaks) | ||
+ | |||
+ | * **'' | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | ==== Geometry optimization ==== | ||
+ | |||
+ | <code - examples/ | ||
+ | ***, Simple geometry optimization | ||
+ | |||
+ | basis=vdz | ||
+ | |||
+ | geometry={ | ||
+ | O | ||
+ | H 1 r | ||
+ | H 1 r 2 theta} | ||
+ | |||
+ | r=1.8 | ||
+ | theta=104 | ||
+ | |||
+ | hf | ||
+ | mp2 | ||
+ | |||
+ | {minimize, | ||
+ | --- | ||
+ | </ | ||
+ | |||
+ | ==== Basis function optimizations ==== | ||
+ | |||
+ | <code - examples/ | ||
+ | ***, Optimization of 2 d functions | ||
+ | |||
+ | geometry={Ne} | ||
+ | |||
+ | dexp=[2.0, | ||
+ | |||
+ | basis={ | ||
+ | sp, | ||
+ | d, | ||
+ | } | ||
+ | |||
+ | hf | ||
+ | mp2 | ||
+ | eval=energy | ||
+ | |||
+ | minimize, | ||
+ | --- | ||
+ | </ | ||
+ | |||
+ | <code - examples/ | ||
+ | ***, Optimization of 2 d functions | ||
+ | |||
+ | geometry={Ne} | ||
+ | |||
+ | dexp=[2.0, | ||
+ | |||
+ | {minimize, | ||
+ | method, | ||
+ | |||
+ | |||
+ | proc optd | ||
+ | |||
+ | basis={ | ||
+ | sp, | ||
+ | d, | ||
+ | } | ||
+ | |||
+ | hf | ||
+ | mp2 | ||
+ | eval=energy | ||
+ | |||
+ | endproc | ||
+ | </ | ||
+ | |||
+ | <code - examples/ | ||
+ | ***, MP2 optimization of core-valence cc-pCVDZ functions | ||
+ | |||
+ | geometry={Ne} | ||
+ | |||
+ | sexp=20. | ||
+ | pexp=30. | ||
+ | |||
+ | {minimize, | ||
+ | method, | ||
+ | |||
+ | |||
+ | proc myopt | ||
+ | |||
+ | basis={ | ||
+ | spd, | ||
+ | s,Ne,sexp | ||
+ | p,Ne,pexp | ||
+ | } | ||
+ | |||
+ | hf | ||
+ | {mp2; | ||
+ | eval=energy | ||
+ | |||
+ | {mp2; | ||
+ | eall=energy | ||
+ | |||
+ | ecv=eall-eval | ||
+ | |||
+ | endproc | ||
+ | </ | ||
+ | |||
+ | ==== Intersection points ==== | ||
+ | |||
+ | <code - examples/ | ||
+ | ***, Try to find intersection seam of singlet-triplet CH2 as function of angle | ||
+ | |||
+ | basis=vdz | ||
+ | |||
+ | geometry={ | ||
+ | C | ||
+ | H 1 r | ||
+ | H 1 r 2 theta} | ||
+ | |||
+ | r=1.6 | ||
+ | angles=[70, | ||
+ | |||
+ | do i=1,#angles | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | enddo | ||
+ | |||
+ | table, | ||
+ | digit, | ||
+ | |||
+ | |||
+ | proc findit | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | endproc | ||
+ | --- | ||
+ | </ |