Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ Symbolics = "7"
julia = "1.10"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Ipopt", "Test"]
test = ["CSV", "DataFrames", "Ipopt", "Test"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ An optimal reactor-separator-recycle process design problem originally presented
A nonlinear kinetic parameter estimation problem originally described by [[5](#references)] is used to demonstrate the use of `register_odesystem` to formulate and solve an ODE system using [`Ipopt`](https://github.com/coin-or/ipopt) [[6](#references)].

## References
1. Ma, Y., Gowda, S., Anantharaman, R., Laughman, C., Shah, V., and Rackauckas, C. ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling. (2022). DOI: [10.48550/arXiv.2103.05244)](https://doi.org/10.48550/arXiv.2103.05244)
1. Ma, Y., Gowda, S., Anantharaman, R., Laughman, C., Shah, V., and Rackauckas, C. ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling. (2022). DOI: [10.48550/arXiv.2103.05244](https://doi.org/10.48550/arXiv.2103.05244)
2. Lubin, M., Dowson, O., Dias Garcia, J., Huchette, J., Legat, B., and Vielma, J.P. JuMP 1.0: recent improvements to a modeling language for mathematical optimization. *Mathematical Programming Computation.* 15, 581-589 (2023). DOI: [10.1007/s12532-023-00239-3](https://doi.org/10.1007/s12532-023-00239-3)
3. Kokossis, A.C. and Floudas, C.A. Synthesis of isothermal reactor-separator-recycle systems. *Chemical Engineering Science.* 46, 1361-1383 (1991). DOI: [10.1016/0009-2509(91)85063-4](https://doi.org/10.1016/0009-2509(91)85063-4)
4. Wilhelm, M. E. and Stuber, M.D. EAGO.jl: easy advanced global optimization in Julia. *Optimization Methods and Software.* 37(2), 425-450 (2022). DOI: [10.1080/10556788.2020.1786566](https://doi.org/10.1080/10556788.2020.1786566)
4. Wilhelm, M. E. and Stuber, M.D. EAGO.jl: easy advanced global optimization in Julia. *Optimization Methods & Software.* 37(2), 425-450 (2022). DOI: [10.1080/10556788.2020.1786566](https://doi.org/10.1080/10556788.2020.1786566)
5. Taylor, J.W. Direct measurement and analysis of cyclohexadienyl oxidation. Ph.D. thesis, Massachusetts Institute of Technology. (2005). URL: http://hdl.handle.net/1721.1/33716
6. Wächter, A. and Biegler, L.T. On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. *Mathematical Programming.* 106, 25-57 (2006). DOI: [10.1007/s10107-004-0559-y](https://doi.org/10.1007/s10107-004-0559-y)
234 changes: 75 additions & 159 deletions examples/algebraic_model.ipynb

Large diffs are not rendered by default.

29 changes: 16 additions & 13 deletions examples/algebraic_model.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using ModelingToolkit, JuMP, EAGO, EOptInterface
using EAGO
using EOptInterface
using JuMP
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

# Create algebraic ModelingToolkit system
Expand Down Expand Up @@ -163,14 +166,14 @@ xU = [100.0, 1.0, 1.0, 1.0, 100.0, 10.0]
register_nlsystem(model, system, obj, [g1, g2])

# Optimize model
JuMP.optimize!(model)
optimize!(model)

# Display results
println("Termination Status: $(JuMP.termination_status(model))")
println("Primal Status: $(JuMP.primal_status(model))")
println("Solve Time: $(round.(JuMP.solve_time(model), digits=5))")
println("f^* = $(round(JuMP.objective_value(model), digits=5))")
println("x* = $(round.(JuMP.value.(x), digits=3))")
println("Termination Status: $(termination_status(model))")
println("Primal Status: $(primal_status(model))")
println("Solve Time: $(round.(solve_time(model), digits=5))")
println("f^* = $(round(objective_value(model), digits=5))")
println("x* = $(round.(value.(x), digits=3))")

# Retrieve full-space solution
full_solution(model, system)
Expand All @@ -191,9 +194,9 @@ xU = vcat(repeat([100.0, 1.0, 1.0, 1.0], 12), 100.0, 10.0)
register_nlsystem(full_model, full_system, obj, [g1, g2])

# Optimize model and retrieve results
JuMP.optimize!(full_model)
println("Termination Status: $(JuMP.termination_status(full_model))")
println("Primal Status: $(JuMP.primal_status(full_model))")
println("Solve Time: $(round.(JuMP.solve_time(full_model), digits=5))")
println("f^* = $(round(JuMP.objective_value(full_model), digits=5))")
println("x* = $(round.(JuMP.value.(x), digits=3))")
optimize!(full_model)
println("Termination Status: $(termination_status(full_model))")
println("Primal Status: $(primal_status(full_model))")
println("Solve Time: $(round.(solve_time(full_model), digits=5))")
println("f^* = $(round(objective_value(full_model), digits=5))")
println("x* = $(round.(value.(x), digits=3))")
202 changes: 202 additions & 0 deletions examples/kinetic_intensity_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
time,intensity
0,0
0.01,66.0952
0.02,104.762
0.03,110.333
0.04,114.905
0.05,122.238
0.06,125.429
0.07,125.429
0.08,123.476
0.09,121.286
0.1,118.857
0.11,117.667
0.12,116.143
0.13,113.857
0.14,111.571
0.15,108.81
0.16,105.952
0.17,104.048
0.18,102.048
0.19,100.143
0.2,98.5238
0.21,96.2381
0.22,94.381
0.23,91.6667
0.24,89.5714
0.25,87.1429
0.26,84.8571
0.27,83.4286
0.28,81.1905
0.29,78.9048
0.3,77.0476
0.31,75.4762
0.32,73.4762
0.33,71.8095
0.34,70.6667
0.35,68.381
0.36,67.3333
0.37,65.0952
0.38,63.7143
0.39,62.0476
0.4,60.8571
0.41,59.619
0.42,58.2857
0.43,57.4762
0.44,56.4762
0.45,55.8095
0.46,54.5238
0.47,53
0.48,51.8571
0.49,50.4286
0.5,49.381
0.51,47.9524
0.52,47.3714
0.53,46.8952
0.54,46.4857
0.55,45.9048
0.56,45.0762
0.57,44.3238
0.58,43.4143
0.59,43.5429
0.6,42.3619
0.61,41.8381
0.62,40.2381
0.63,39.1286
0.64,38.7857
0.65,37.081
0.66,36.9524
0.67,36.581
0.68,36.281
0.69,35.3476
0.7,34.8905
0.71,34.1667
0.72,33.6714
0.73,32.9667
0.74,31.8429
0.75,31.5429
0.76,31.1476
0.77,30.9905
0.78,29.9571
0.79,29.1333
0.8,28.7857
0.81,28.4429
0.82,28.3476
0.83,27.5429
0.84,27.4333
0.85,27.6048
0.86,27.1762
0.87,27.2
0.88,26.4333
0.89,25.7619
0.9,24.8095
0.91,24.7429
0.92,24.2857
0.93,24.1714
0.94,23.5667
0.95,23.5476
0.96,23.3952
0.97,22.919
0.98,22.3095
0.99,21.8048
1,21.2857
1.01,21.2048
1.02,20.8429
1.03,20.4429
1.04,20.0048
1.05,19.9381
1.06,19.5
1.07,19.8667
1.08,18.9333
1.09,19.1381
1.1,18.9619
1.11,18.5476
1.12,17.9048
1.13,17.7571
1.14,18.5333
1.15,18.3762
1.16,18.3571
1.17,18.3286
1.18,18.2762
1.19,18.3952
1.2,17.5952
1.21,18.1524
1.22,18.1952
1.23,17.8476
1.24,17.9095
1.25,17.5048
1.26,17.5
1.27,15.9619
1.28,16.2095
1.29,16.181
1.3,15.6952
1.31,15.7095
1.32,15.4619
1.33,15.9476
1.34,16
1.35,16.1952
1.36,16.1143
1.37,15.7429
1.38,15.5762
1.39,15.7048
1.4,15.8095
1.41,15.6667
1.42,14.9048
1.43,14.5857
1.44,14.7524
1.45,14.7571
1.46,14.9762
1.47,14.5333
1.48,14.5524
1.49,14.0143
1.5,13.6286
1.51,13.4429
1.52,13.4667
1.53,13.319
1.54,12.9333
1.55,13.1238
1.56,12.7476
1.57,12.9333
1.58,13.0714
1.59,13.0714
1.6,12.7619
1.61,12.4238
1.62,12.5143
1.63,12.9143
1.64,12.5714
1.65,13.3667
1.66,13.2286
1.67,13.7905
1.68,13.7571
1.69,13.5905
1.7,12.9667
1.71,12.981
1.72,12.8857
1.73,12.919
1.74,13.0143
1.75,13.0095
1.76,12.3857
1.77,12.5571
1.78,12.3429
1.79,12.7571
1.8,12.681
1.81,12.5429
1.82,12.1857
1.83,12.7905
1.84,12.5571
1.85,12.8429
1.86,12.5476
1.87,12.5714
1.88,12.3762
1.89,11.9952
1.9,11.4571
1.91,11.3
1.92,11.1524
1.93,11.681
1.94,11.619
1.95,11.9048
1.96,12
1.97,12.0762
1.98,11.9143
1.99,11.7619
2,11.5333
Loading
Loading