Re: Problem with simultaneous equations with several variables - population genetics

• To: mathgroup at smc.vnet.net
• Subject: [mg8986] Re: [mg8686] Problem with simultaneous equations with several variables - population genetics
• From: Richard Anderson <richardj.anderson at stonebow.otago.ac.nz>
• Date: Tue, 7 Oct 1997 03:35:32 -0400
• Organization: University of Otago, Dunedin, New Zealand
• Sender: owner-wri-mathgroup at wolfram.com

```Richard Anderson writes,

The solution, courtesy of Daniel Lichtblau at Wolfram, involves getting
rid of denominators to prevent Solve from generating extra variables to
handle them. We subtract one side from the other, use Together to get
numerator / denominator, and set it to zero. This code does this:

eqs={pfs==pf,pms==pm};
polys=Map[#[[1]]-#[[2]]&,eqs];
newpolys=Map[Numerator[Together[[#]]&, polys]

Now we can solve for pm and pf.

Solve[newpolys==0, {pm,pf]]

Many thanks to those who offered help.

Richard Anderson

Richard Anderson wrote

>  I am a new Mathematica user. My problem occurs in the context of
>  modelling genetic systems. I have two equations corresponding to the
>  change in gene frequencies in females and males respectively, and wish
>  to search for equilibrium values - i.e. values where the iteration
>  produces no change in gene frequencis for either males or females.
>          The Solve command as detailed in the literature works fine for the
>  simpler models we have attempted:-
>
>  Solve [{pfs=pf, pms=pm}, {pm,pf}]
>
>          where pfs is the function to give the iterated value for females, pms
>  for males, and pf and pm are the current gene frequencies in terms of
>  other parameters.
>          However as the models become more complex, and more variables are added
>  to thes functions, we have experienced problems.
>          It is always the case that two equilibrium points will occur,
>  corresponding to pf=1, pm=1 and pf=0, pm=0. Only an internal equilibiurm
>  is of interest to us, should one be present. However, after several
>  hours of evaluating our more complex models, the Kernel shuts down,
>  professing lack of memory. We know that in many cases an internal
>  equilibirum does exist, since we have simulated the systems with C++.
>  (Even if in a particular case it does not, the two equilibria
>  corresponding to fixation always exist, and should be returned by
>  Mathematica). What we seek are precise algebraic definitions of the
>  internal equilibria.
>          My question is this : is there any way we can assist Mathematica in
>  finding such definitions by telling it that we know two of the roots of
>  whichever cubic it is seeking to solve, so as to aid it in discovering
>  the third?
>
>          Many thanks in advance for any help you may be able to give,
>
>                                  Richard Anderson,
>                                  University of Otago.

```

• Prev by Date: Re: Integrate got slower in Version 3.0/Example
• Next by Date: Re: Colored ListPlot
• Previous by thread: RE:Kolmogorov-Smirnov statistic
• Next by thread: Re: Problem with simultaneous equations with several variables - population genetics