power rules
econrad
econrad at vt.edu
Sat May 22 06:04:59 CEST 2004
Here's an annoying issue I have: I'm using GiNaC as a symbolic front end for a
dynamical systems tool I'm building that does alot of numerical bifurcation
analysis and such (I'm using GiNaC to generate all the symbolic info I need up
front, translating this into numerical prodedures, and then using LAPACK/BLAS
and some new continuation algorithms on the what I've generated). Models
typically have terms like "a*k^n/(p^n+k^n)" in the RHS of the ODEs, where a,
k, p are real numbers and n is typically an integer. Calculation of the
jacobian then has terms like -a*k^n*n*p^(n-1)/(p^n+k^n)^2. Problem is, GiNaC
uses the safe assumption and calculates -a*k^n*n*p^n*(p^n+k^n)^(-2)*p^(-1),
which introduces a singularity into the derivatives that isn't really there.
I understand the rational behind not automatically making p^n/p^1=p^(n-1) when
one doesn't know anything about n, but nevertheless, I know that I'll only be
using a real n>1 (or in any case, I'll only use n that makes this a valid
reduction). How can I force this power transformation to take place... I'm
sure I can do some convoluted matching and replacing to get this to work, but
a user should be able to give an option to "eval" or to "normal" to get this
operation performed at their own risk, yes? Have I missed something?
Any help would be appreciated.
Emery
Emery Conrad
4089 Derring Hall
Virginia Tech, Blacksburg VA
540.231.5508
More information about the GiNaC-list
mailing list