MadNLP / DynamicNLPModels.jl

NLPModels for dynamic optimization
MIT License
11 stars 1 forks source link

Added support for LQDynamicModel when condense=true #10

Closed dlcole3 closed 2 years ago

dlcole3 commented 2 years ago

Added support for the condensed form of the LQDynamicModel for when condense=true, based on the work done by Jerez et al.. I added two internal functions _build_condensed_blocks for building the block A, B, R, and Q matrices and the H matrix and h vector described in Jerez et al. It also returns the constant term, $h_0$. I also added the function _build_G which creates the block G matrix and the g matrix described in Jerez et al. This latter function is used to incorporate any constraints on the state variables.

runtests.jl was also updated to test that the condensed form yields the same results as the sparse form.

codecov-commenter commented 2 years ago

Codecov Report

Merging #10 (1caa3b1) into main (b7c5af9) will increase coverage by 25.38%. The diff coverage is 95.83%.

@@             Coverage Diff             @@
##             main      #10       +/-   ##
===========================================
+ Coverage   61.45%   86.83%   +25.38%     
===========================================
  Files           1        1               
  Lines         179      281      +102     
===========================================
+ Hits          110      244      +134     
+ Misses         69       37       -32     
Impacted Files Coverage Δ
src/DynamicNLPModels.jl 86.83% <95.83%> (+25.38%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b7c5af9...1caa3b1. Read the comment docs.

sshin23 commented 2 years ago

Thanks, @frapac for the review! No further comments on my end

sshin23 commented 2 years ago

One minor comment: make sure to give each PR a proper name