soliton.xmds

来自「XMDS is a code generator that integrates」· XMDS 代码 · 共 112 行

XMDS
112
字号
<?xml version="1.0"?><!--Example Exactly Solvable Coupled NLSE--><!-- $Id: soliton.xmds,v 1.8 2004/07/14 06:37:05 joehope Exp $ --><!--  Copyright (C) 2000-2004                                           --><!--                                                                    --><!--  Code contributed by Greg Collecutt, Joseph Hope and Paul Cochrane --><!--                                                                    --><!--  This file is part of xmds.                                        --><!--                                                                    --><!--  This program is free software; you can redistribute it and/or     --><!--  modify it under the terms of the GNU General Public License       --><!--  as published by the Free Software Foundation; either version 2    --><!--  of the License, or (at your option) any later version.            --><!--                                                                    --><!--  This program is distributed in the hope that it will be useful,   --><!--  but WITHOUT ANY WARRANTY; without even the implied warranty of    --><!--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     --><!--  GNU General Public License for more details.                      --><!--                                                                    --><!--  You should have received a copy of the GNU General Public License --><!--  along with this program; if not, write to the Free Software       --><!--  Foundation, Inc., 59 Temple Place - Suite 330, Boston,            --><!--  MA  02111-1307, USA.                                              --><simulation>  <!-- Global system parameters and functionality -->  <name>soliton</name>  <author>Unknown Author</author>  <description>    Example of an exactly solvable coupled nonlinear Schroedinger    equation.  Describes solition formation.  </description>  <prop_dim>z</prop_dim>  <error_check>yes</error_check>  <stochastic>no</stochastic>    <!-- Global variables for the simulation -->  <globals>  <![CDATA[    const double alpha = 1;    const double beta = 1;  ]]>  </globals>    <!-- Field to be integrated over -->  <field>    <name> main </name>    <dimensions> t    </dimensions>    <lattice>    50   </lattice>    <domains>  (-5,5) </domains>    <samples> 1 </samples>    <vector>      <name> main </name>      <type> complex </type>      <components>u v</components>      <fourier_space>no</fourier_space>      <![CDATA[        u = complex(exp(-t*t/alpha/alpha/4),0);        v = complex(exp(-t*t/beta/beta/4),0);      ]]>    </vector>  </field>    <!-- The sequence of integrations to perform -->  <sequence>    <integrate>      <algorithm>RK4IP</algorithm>      <interval>10</interval>      <lattice>2400</lattice>      <samples>30</samples>            <k_operators>        <constant>yes</constant>        <operator_names>L</operator_names>        <![CDATA[          L = i*(-kt*kt/2);        ]]>      </k_operators>            <iterations>3</iterations>      <![CDATA[        const double density = u.re*u.re+u.im*u.im+v.re*v.re+v.im*v.im;                du_dz = L[u] + i*u*density;        dv_dz = L[v] + i*v*density;      ]]>    </integrate>  </sequence>    <!-- The output to generate -->  <output format="ascii" precision="double">    <group>      <sampling>        <fourier_space> no </fourier_space>        <lattice>       25  </lattice>        <moments>ure uim vre vim</moments>        <![CDATA[          ure = u;          uim = -i*u;          vre = v;          vim = -i*v;        ]]>      </sampling>    </group>  </output></simulation>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?