Skip to content

Commit

Permalink
add code to undo a coordinate transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Oct 13, 2019
1 parent 5f72622 commit af48d59
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
29 changes: 28 additions & 1 deletion src/Utils/transformations.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down

0 comments on commit af48d59

Please sign in to comment.