anharmonic_p.xmds

Script source:
anharmonic_p.xmds.gz

<?xml version="1.0"?>
<!--Example anharmonic oscilator simulation using +P function-->

<simulation>

  <name>anharmonic_p</name>

  <author>Joel Corney</author>
  <description>
    Example anharmonic oscilator simulation using +P function
  </description>

  <prop_dim>t</prop_dim>
  <error_check>yes</error_check>
  <stochastic>yes</stochastic>
  <paths>1000</paths>
  <use_mpi>no</use_mpi>
  <seed>1 2</seed>
  <noises>2</noises>

  /***********/
  <globals>
  /***********/
  <![CDATA[
    const double Pi = 2.0*asin(1.0);
    const double N = 1000;       /*Number of particles*/
    const double kappa = 0.5/N; /*Interaction strength*/
    const double gamm = kappa; /*Damping rate*/
  ]]>
  </globals>

  /*************/
  <field>
  /*************/
    <name>main</name>
    <samples>1</samples>
 
    /***MAIN***/
    <vector>
      <name>main</name>
      <type>complex</type>
      <components>alpha1 alpha2</components>
      <fourier_space>no</fourier_space>
      <![CDATA[
        /* NB: We take the '2' variables to be the conjugates */
        alpha1 = rcomplex(sqrt(N),0.0);
        alpha2 = rcomplex(sqrt(N),0.0);    
      ]]>
    </vector>        
  </field>

  /******************/
  <sequence>
  /******************/
 
    <integrate>
      <algorithm>SIIP</algorithm>
      <interval>10</interval>
      <lattice>5000</lattice>
      <samples>200</samples>
      <iterations>4</iterations>
      <vectors>main</vectors>
      <![CDATA[
        complex s1 = c_sqrt(-2*i*kappa*alpha1*alpha1);  /*Noise Correlations*/
        complex s2 = c_sqrt(2*i*kappa*alpha2*alpha2);   /*Noise Correlations*/
        
        dalpha1_dt =-2*i*kappa*(alpha1*alpha1*alpha2 - alpha1/2) - gamm*alpha1/2
                     + s1*n_1 ;
        dalpha2_dt = 2*i*kappa*(alpha2*alpha1*alpha2 - alpha2/2)- gamm*alpha2/2
                     + s2*n_2;
      ]]>
    </integrate>
  </sequence>

  /**************/
  <output>
    <filename>anharmonic_p.xsil</filename>
    <group>
      <sampling>
       <vectors>main</vectors>
        <moments>N_alpha N_alphai alpha_x alpha_y alpha_x2 alpha_y2</moments>
        <![CDATA[
          N_alpha = alpha1*alpha2 ;
          N_alphai = imag(alpha1*alpha2);
          alpha_x = (alpha1 + alpha2)/2;
          alpha_y = (alpha1 - alpha2)/(2*i);
          alpha_x2 = (alpha1 + alpha2)*(alpha1 + alpha2)/4.0 + 1.0/4.0;
          alpha_y2 = -(alpha1 - alpha2)*(alpha1 - alpha2)/4.0 + 1.0/4.0;
        ]]>
      </sampling>
    </group>
  </output>
</simulation>

Generated by GNU enscript 1.6.3.



Introduction | Examples | Downloads | Documentation | Archives | Script Repository | FAQ | News | Links | Contacts