ariadne-cps / ariadne

C++ framework for rigorous computation on cyber-physical systems
http://www.ariadne-cps.org
GNU General Public License v3.0
28 stars 9 forks source link

Segmentation fault and extracting solution #757

Open pastankaitis opened 1 year ago

pastankaitis commented 1 year ago

I was trying to to extract reach set solution from the attractor.py example (modified to work). Is there an easy way to get ranges from the evolver_orbit?

When I was trying to iterate over the solution (as in LOVO20 example), I get Segmentation Fault issue. Same happens, when I run LOVO20.py and print enclosure in verify method.

from pyariadne import *

x = RealVariable("x") y = RealVariable("y")

system = VectorField([dot(x)<<2x-xy,dot(y)<<2xx-y]) initial_set = RealExpressionBoundedConstraintSet([(1<=x)&(x<=1),(-2 <= y)&(y<=-2)],[sqr(x)+sqr(y+2)<=1]) initial_constraint_set = initial_set.euclidean_set(system.state_space())

evolution_time = Decimal(0.1) g = LabelledFigure(Axes2d(0,x,3, -3,y,2))

integrator = TaylorPicardIntegrator(0.1) print("Evolving...") evolver = VectorFieldEvolver(system,integrator) evolver.configuration().set_maximum_enclosure_radius(1.0) evolver.configuration().set_maximum_step_size(0.1) evolver_orbit = evolver.orbit(initial_set, evolution_time, Semantics.UPPER) g.clear() g.draw(evolver_orbit) g.write("attractor_evolution")

for p in evolver_orbit.final(): print(p)

pastankaitis commented 1 year ago

Sorry to bother, but any suggestions how to extract reach set solution from evolver_orbit?

lgeretti commented 1 year ago

I noticed there are problems iterating single elements of the orbit, I made https://github.com/ariadne-cps/ariadne/issues/759