← Back to team overview

ufl team mailing list archive

Re: [Question #212068]: Reducing a fraction

 

On 23 October 2012 13:11, Jan Blechta
<question212068@xxxxxxxxxxxxxxxxxxxxx> wrote:
> New question #212068 on UFL:
> https://answers.launchpad.net/ufl/+question/212068
>
> Hi,
> is there a way one can manipulate (by some algorithm) UFL expression or form to reduce a term like
>     something * x[0] / x[0]
> to mathematically equivalent
>     something * 1
> which has polynomial degree smaller by two. Moreover it could prevent division by zero.
>
> I'm not asking for a generel algorithm doing a division of rational functions but rather if user can apply some transformation rule locating products with factors x[0] and 1/x[0] and remove it.
>

No, there is no way to do that in ufl without writing additional
algorithms for it.

Such simplification may be feasible for this particular case but
generalized can be a very hard problem.

Martin


> I admit I could do this transformation by hand but consider situation when this expression is result of automatic calculations (e.g. automatic differentiation).
>
> Thanks
> Jan
>
> --
> You received this question notification because you are a member of UFL
> Team, which is an answer contact for UFL.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to     : ufl@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ufl
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References