Pyomo DAE toolbox cannot discretize the domain appropriately

Home / python / Pyomo DAE toolbox cannot discretize the domain appropriately

Question:
I’m using Pyomo DAE toolbox to solve a partial differential equation and the domain length of one independent variable (say m.x) is very small (like 1e-6).

It seems to me that the DAE toolbox cannot discretize the domain appropriately because the discretized m.x only had 2 points (I used ContinuousSet.get_finite_elements() method to check that) even I specified 10 finite element points in the option (see code below).
m.x = ContinuousSet(bounds=(0, 1e-6))

disc=TransformationFactory(‘dae.finite_difference’)
disc.apply_to(m, nfe=10, wrt=m.x, scheme=’BACKWARD’)
I increased the upper bound of m.x as
m.x = ContinuousSet(bounds=(0, 1e-5))
and tried to discretize it again. This time I got 10 points in the x domain.

However, when I increased the number of finite element points as
m.x = ContinuousSet(bounds=(0, 1e-5))
disc.apply_to(m, nfe=100, wrt=m.x, scheme=’BACKWARD’)
the returned discretized domain x still had 10 points.

I want to know if there is a 1e-6 tolerance or limitation for DAE toolbox. If there is, how can I customize this value?

Thank you in advance!


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *