python - Pyomo DAE toolbox cannot discretize the domain appropriately -
i'm using pyomo dae toolbox solve partial differential equation , domain length of 1 independent variable (say m.x) small (like 1e-6).
it seems me dae toolbox cannot discretize domain appropriately because discretized m.x had 2 points (i used continuousset.get_finite_elements() method check that) specified 10 finite element points in 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 upper bound of m.x as
m.x = continuousset(bounds=(0, 1e-5)) and tried discretize again. time got 10 points in x domain.
however, when increased 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 know if there 1e-6 tolerance or limitation dae toolbox. if there is, how can customize value?
thank in advance!
yes, there limit on domain length. discretization transformation rounds new discretization points 6 decimal points. because seeing issues same discretization point being added multiple times because of slight differences in floating point round off. @qtothec mentioned, best solution modify scaling bounds on continuousset around (0,1).
the number of decimal points include not option can modified user can go source code , change number here , here.
Comments
Post a Comment