How to manually modify coupling matrixes === This method only works for [version 2.3.0](https://www.mathworks.com/matlabcentral/fileexchange/64433-cosmoss) and newer so please download the latest version of the COSMOSS. For the demonstration, let’s use the Two-Coupled Oscillator (TCO) model as an example. Her how you modify system coupling matrix: ### Generate the TCO structure Call the TCO model from the Main GUI. This should bring up the sub-GUI, Model_TCO: ![](https://i.imgur.com/42bfJoq.png) Click on the "Generate" button will pass the structural data to the main GUI. ### Export the coupling matrix from the main GUI You can export the spectral data class (Data_COSMOSS) by clicking the ‘Export Data'. ![](https://i.imgur.com/rjpjpv2.png) You will find a variable in the workspace named: ``` Data_COSMOSS ``` And the coupling matrix (Beta) of the TCO model is stored at here: ``` >> Data_COSMOSS.Structure.Beta ans = 0 24.7513 24.7513 0 ``` Note, the value was determined by the sub-GUI options. ### Modify the value of the coupling matrix Let's try to modify the off-diagonal elements to zeros: ``` >> Data_COSMOSS.Structure.Beta = zeros(2); >> Data_COSMOSS.Structure.Beta ans = 0 0 0 0 ``` The coupling matrix will be updated automatically. However, one still need to force COSMOSS to recognize the update by the following line:[^RefreshOn] ``` >> Data_COSMOSS.hCOSMOSS.RefreshOn; ``` You may notice that the color of the spectral calculation buttons become blue again, indicating recalculation is enforced. [^RefreshOn]: The "RefreshOn" tag was designed to save calculation time when an request to update spectrum **does not need** recalculation. For example, one may want to see different part of the Feynman pathways of a 2D IR simulation. Since all the Feynman path are calculated in one run, recalculation only waste your precious time and limited resources on earth. To test the effect, let's try to force coupling to zeros. In this case, the FTIR spectra will only have one peak since there is no coupling between the two identical modes: ![](https://i.imgur.com/yop66bh.png) Note: This tricks works best if you only want to edit some elements of the coupling matrix. If you want to edit a big chunk of the coupling matrix, writing a coupling generation script maybe easier. You can find examples in the source code: ``` '/SpecFunc/MolecularResponse/Coupling.m' '/SpecFunc/MolecularResponse/Coupling_TDC.m' etc... ``` ###### tags: `tutorials` `COSMOSS`