<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="lorenz">
  <refmeta>
    <refentrytitle>lorenz</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>lorenz</refname>
    <refpurpose>
      Implements the Lorenz system of equations.
      <indexterm id="IndexLorenz"><primary>lorenz</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
       Implements the Lorenz system of equations.  The Lorenz system is a chaotic-dynamic system which was originally used to simulate the motion of a particle in convection currents and simplified weather systems. Small differences in initial conditions rapidly lead to diverging values.  This is sometimes expressed as the butterfly effect. If a butterfly flaps its wings in Australia, it will have an effect on the weather in Alaska. This system is one of the milestones in the development of chaos theory. It is useful as a chaotic audio source or as a low frequency modulation source.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ax, ay, az <command>lorenz</command> ksv, krv, kbv, kh, ix, iy, iz, iskip</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ix</emphasis>, <emphasis>iy</emphasis>, <emphasis>iz</emphasis> -- the initial coordinates of the particle.
    </para>

    <para>
      <emphasis>iskip</emphasis> -- used to skip generated values. If <emphasis>iskip</emphasis> is set to 5, only every fifth value generated is output. This is useful in generating higher pitched tones.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ksv</emphasis> -- the Prandtl number or sigma
    </para>

    <para>
      <emphasis>krv</emphasis> -- the Rayleigh number
    </para>

    <para>
      <emphasis>kbv</emphasis> -- the ratio of the length and width of the box in which the convection currents are generated
    </para>

    <para>
      <emphasis>kh</emphasis> -- the step size used in approximating the differential equation. This can be used to control the pitch of the systems. Values of .1-.001 are typical.
    </para>

    <para>
      The equations are approximated as follows:
      <literallayout>
x = x + h*(s*(y - x))
y = y + h*(-x*z + r*x - y)
z = z + h*(x*y - b*z)
      </literallayout>
    </para>

    <para>
      The historical values of these parameters are:
      <literallayout>
ks = 10
kr = 28
kb = 8/3
      </literallayout>
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the lorenz opcode. It uses the files <ulink url="examples/lorenz.orc"><citetitle>lorenz.orc</citetitle></ulink> and <ulink url="examples/lorenz.sco"><citetitle>lorenz.sco</citetitle></ulink>.

      <example>
        <title>Example of the lorenz opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/lorenz.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/lorenz.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namehans;</member>
        <member>February 1999</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.53</para>
  </refsect1>
</refentry>
