From af48d590bea3ef7e97c68842f291ca976f851801 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 13 Oct 2019 15:50:46 +0200 Subject: [PATCH] add code to undo a coordinate transformation --- src/Utils/transformations.jl | 29 ++++++++++++++++++++++++++++- src/solve.jl | 5 ++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Utils/transformations.jl b/src/Utils/transformations.jl index 04e4a779..24044360 100644 --- a/src/Utils/transformations.jl +++ b/src/Utils/transformations.jl @@ -1,6 +1,33 @@ using LinearAlgebra -export transform +export transform, + backtransform + +""" + backtransform(Rsets::ReachSolution, options::Options) + +Undo a coordinate transformation. + +### Input + +- `Rsets` -- flowpipe +- `option` -- problem options containing an `:transformation_matrix` entry + +### Output + +A new flowpipe where each reach set has been transformed. + +### Notes + +The transformation is implemented with a lazy `LinearMap`. +""" +function backtransform(Rsets, options::Options) + transformation_matrix = options[:transformation_matrix] + if transformation_matrix == nothing + return Rsets + end + return project(Rsets, transformation_matrix) +end """ transform(problem::InitialValueProblem, options::Options) diff --git a/src/solve.jl b/src/solve.jl index c1bcd4e1..1c1d045d 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -71,7 +71,10 @@ function solve!(problem::InitialValueProblem, problem, options = transform(problem, options) # run the continuous-post operator - post(op, problem, options) + res = post(op, problem, options) + + # undo a coordinate transformation + res = backtransform(res, options) end """