From: gonnet@inf.ethz.ch (Gaston Gonnet)
Subject: Re: Solving Rate Equations
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Fri, 21 Aug 1992 07:57:55 GMT

In article <1992Aug20.230128.8716@ucc.su.OZ.AU> king@physics.su.OZ.AU (Peter King) writes:
>I'm interested in solving the following equations (in Mathematica format)
>for a cw optically pumped laser:
>
>eqns = {
>	wv N3 - wp (N0 - g0 / g2 N2) == 0
>	B21 n (N2 - g2 / g1 N1) - wr N1 == 0
>	wp (N0 - g0 / g2 N2) - wr N2 - B21 n (N2 - g2 / g1 N1) == 0
>	N0 + N1 + N2 + N3 == N
>	B21 n (N2 - g2 / g1 N1) - 2 Pi y n == 0
>       }
>
>simultaneously.  In Mathematica I naively tried
>	Solve[eqns, {N0, N1, N2, N3, n}]

This is a rather simple system, it does not need Grobner
bases or anything sophisticated.  Here are the solutions
given by Maple:

    |\^/|      MAPLE V
._|\|   |/|_.  Copyright (c) 1981-1990 by the University of Waterloo.
 \  MAPLE  /   All rights reserved.  MAPLE is a registered trademark of
 <____ ____>   Waterloo Maple Software.
      |        Type ? for help.
> eqns := {
>         wv*N3 - wp*(N0 - g0 / g2*N2) = 0,
>         B21*n*(N2 - g2 / g1*N1) - wr*N1 = 0,
>         wp*(N0 - g0 / g2*N2) - wr*N2 - B21*n*(N2 - g2 / g1*N1) = 0,
>         N0 + N1 + N2 + N3 = N,
>         B21*n*(N2 - g2 / g1*N1) - 2*Pi*y*n = 0
>        };
                     /     g0 N2\            /     g2 N1\
 eqns := {wv N3 - wp |N0 - -----| = 0, B21 n |N2 - -----| - wr N1 = 0,
                     \       g2 /            \       g1 /

        /     g0 N2\                 /     g2 N1\
     wp |N0 - -----| - wr N2 - B21 n |N2 - -----| = 0, N0 + N1 + N2 + N3 = N,
        \       g2 /                 \       g1 /

           /     g2 N1\
     B21 n |N2 - -----| - 2 Pi y n = 0}
           \       g1 /

>         solve(eqns, {N0, N1, N2, N3, n});

# the answer has two different solutions:

                                     wp wv g2 N
{n = 0, N1 = 0, N2 = -----------------------------------------,
                     wp wv g2 + wp g0 wv + wr g2 wv + wr g2 wp

                    (wp g0 + wr g2) wv N
    N0 = -----------------------------------------,
         wp wv g2 + wp g0 wv + wr g2 wv + wr g2 wp

                         N wr g2 wp
    N3 = -----------------------------------------},
         wp wv g2 + wp g0 wv + wr g2 wv + wr g2 wp


{n = - 1/2 wr g1 (- wp wv g2 N B21 + 2 Pi y wr g2 wv + 2 Pi y wp wv g2

      + 2 Pi y wp g0 wv + 2 Pi y wr g2 wp)/(%1 B21 g2 Pi y),

         2 wr g1 wv Pi y + 2 wp g1 wv Pi y + 2 wr g1 wp Pi y + wp wv g2 N B21
    N2 = --------------------------------------------------------------------,
                                        B21 %1

    N0 = (wv g2 N B21 wr g1 + wv g2 N B21 wp g0 + 2 wp g0 g1 wv Pi y

                2
         + wv g2  N B21 wr + 2 wp g0 wr g1 Pi y)/(g2 B21 %1),

    N1 = - g1 (- wp wv g2 N B21 + 2 Pi y wr g2 wv + 2 Pi y wp wv g2

         + 2 Pi y wp g0 wv + 2 Pi y wr g2 wp)/(g2 B21 %1),

                                                 2
           wr wp (2 g1 Pi y g0 - g2 N B21 g1 - g2  N B21)
    N3 = - ----------------------------------------------}
                              g2 B21 %1

%1 :=

    wp g1 wv + wr g2 wv + wp wv g2 + wr g1 wv + wp g0 wv + wr g1 wp + wr g2 wp

> done
bytes used=659136, alloc=524192, time=2.783

in a little bit less than 40Mb.