Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: always build initialization problem #3347

Merged
merged 122 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
77c4aed
fix: handle case when parameter object is `nothing` in `GetUpdatedMTK…
AayushSabharwal Jan 21, 2025
5c873f7
feat: update `u0map` and `pmap` in `build_operating_point`
AayushSabharwal Jan 21, 2025
ba21ac5
feat: add dummy initialization parameters instead of hard constraints
AayushSabharwal Jan 21, 2025
127a0c8
feat: always build initialization problem, handle dummy parameters
AayushSabharwal Jan 21, 2025
a7b73ee
refactor: allow disabling `gensym` in `similar_variable`
AayushSabharwal Jan 21, 2025
3d88375
feat: count shift equations as differential equations
AayushSabharwal Jan 21, 2025
d9a1872
test: provide missing parameters to `NonlinearProblem` test
AayushSabharwal Jan 21, 2025
420a497
feat: add `force_time_independent` keyword to `InitializationProblem`
AayushSabharwal Jan 21, 2025
3153677
feat: expose `force_time_independent` through `process_SciMLProblem`
AayushSabharwal Jan 21, 2025
131ac81
fix: remove delayed terms in initialization system of DDEs
AayushSabharwal Jan 21, 2025
c8a282d
fix: only add dummy parameters for unknowns of time-dependent systems
AayushSabharwal Jan 21, 2025
b4289e6
fix: change differential operator when building initialization for `D…
AayushSabharwal Jan 21, 2025
1dbe295
fix: handle recursive default edge case in initializesystem
AayushSabharwal Jan 21, 2025
3b1dbc1
fix: remove occurrences of dummy parameters when remaking initializeprob
AayushSabharwal Jan 21, 2025
46f2b82
fix: only set solvable parameter values to zero in limited cases
AayushSabharwal Jan 21, 2025
aa3e6db
fix: ensure initialization systems for `SteadyStateProblem` do not in…
AayushSabharwal Jan 21, 2025
7e647ae
test: disambiguate `observed` in initializesystem tests
AayushSabharwal Jan 21, 2025
d419247
test: remove unnecessary test
AayushSabharwal Jan 21, 2025
44c05cd
test: refactor `initialization_data === nothing` tests
AayushSabharwal Jan 21, 2025
fbcacfb
test: update initializeprob type promotion test
AayushSabharwal Jan 21, 2025
0d5adc5
fix: don't build initialization for `JumpProblem`
AayushSabharwal Jan 23, 2025
2618c64
fix: don't use observed equations for initialization of `DiscreteSystem`
AayushSabharwal Jan 23, 2025
ea8b8d6
fix: populate observed into `u0map` for time-independent systems
AayushSabharwal Jan 23, 2025
c4c9ba2
fix: remove incorrect fix to dummy derivatives in `u0map` added in #3337
AayushSabharwal Jan 24, 2025
3d60e04
fix: do not build initialization for `DiscreteProblem`
AayushSabharwal Jan 24, 2025
2e6d172
test: make `NonlinearSystem` initialization tests less temperamental
AayushSabharwal Jan 24, 2025
44a28af
test: mark initialization of `JumpSystem` as broken
AayushSabharwal Jan 24, 2025
cab4506
fix: fix `ReconstructInitializeprob` overriding guesses
AayushSabharwal Jan 24, 2025
8d11252
feat: propagate `algebraic_only` kwarg in `InitializationProblem`
AayushSabharwal Jan 20, 2025
33fe6cd
fix: filter `nothing` values in `op`/`u0map`/`pmap` in `process_SciML…
AayushSabharwal Jan 20, 2025
3e37d24
feat: propagate `algebraic_only`, `allow_incomplete` kwargs to initia…
AayushSabharwal Jan 20, 2025
bca43ba
fix: use `SciMLBase.get_initial_values` in `linearization_function`
AayushSabharwal Jan 20, 2025
f524be8
fix: do not forward keywords to `linearize` in `AnalysisPoint` linear…
AayushSabharwal Jan 20, 2025
77939a3
fix: handle `=> nothing` entries in `u0map` in `generate_initializesy…
AayushSabharwal Feb 4, 2025
7bdc1f6
fix: output variable in `PerturbOutput` should not have a default
AayushSabharwal Feb 4, 2025
a3351ff
fix: better handle `=> nothing` entries in `u0map`
AayushSabharwal Feb 4, 2025
54bc714
test: fix some issues with initialization of InverseControlledTank
AayushSabharwal Feb 4, 2025
d626783
test: add #3319 as a test
AayushSabharwal Feb 4, 2025
e2dc475
test: fix initialization of model in tests
AayushSabharwal Feb 4, 2025
5a75d65
refactor: remove `wrap_array_vars`, `wrap_mtkparameters`, `wrap_param…
AayushSabharwal Feb 5, 2025
2956f0b
feat: add `Initial` operator
AayushSabharwal Feb 5, 2025
3096d09
feat: add initialization parameters in `complete`
AayushSabharwal Feb 5, 2025
c916452
feat: optionally filter `Initial` parameters in `parameters`
AayushSabharwal Feb 5, 2025
665d1d3
feat: put `Initial` parameters at the end of tunables
AayushSabharwal Feb 5, 2025
aeffa95
feat: add single-argument `reorder_parameters`
AayushSabharwal Feb 5, 2025
a726293
fix: fix `zero_var` for array symbolics
AayushSabharwal Feb 5, 2025
2a7432b
fix: handle `Initial` parameters in `MTKParameters` constructor
AayushSabharwal Feb 5, 2025
d19134f
fix: handle `Initial` parameters in `tunable_parameters`
AayushSabharwal Feb 5, 2025
6531c87
fix: handle `Initial` parameters in code generation
AayushSabharwal Feb 5, 2025
f5cce1d
test: fix usage of incorrect `MTKParameters` object in `generate_cust…
AayushSabharwal Feb 5, 2025
c8f488d
test: refactor parameter dependency tests
AayushSabharwal Feb 5, 2025
1fc8c5f
refactor: rename `build_operating_point` to `build_operating_point!`
AayushSabharwal Feb 5, 2025
2ec306b
HACK: fix: add `maketerm` for `Initial` operator
AayushSabharwal Feb 7, 2025
ecaa585
fix: filter existing `Initial`s in `add_initialization_parameters`
AayushSabharwal Feb 7, 2025
5150659
fix: handle `Initial` parameters in `flatten`
AayushSabharwal Feb 7, 2025
50bfcdd
refactor: use problem building utils in `MTKParameters` constructor
AayushSabharwal Feb 7, 2025
5432f51
fix: fix scalarization of array defaults in `structural_simplify`
AayushSabharwal Feb 7, 2025
49a8ccf
test: fix tests taking into account new initialization parameters
AayushSabharwal Feb 7, 2025
be89d29
test: account for additional initialization parameter defaults
AayushSabharwal Feb 7, 2025
8ca484f
test: account for additional initialization parameters
AayushSabharwal Feb 7, 2025
ec3d3a8
refactor: don't create new parameters in `generate_initializesystem`
AayushSabharwal Feb 7, 2025
4cef878
fix: better handling of extra symbolics and splitting in `build_opera…
AayushSabharwal Feb 7, 2025
91f4bae
refactor: remove `substitute_extra_variables!`
AayushSabharwal Feb 7, 2025
7f0342d
fix: handle `Initial` parameters in `process_SciMLProblem`
AayushSabharwal Feb 7, 2025
8b9728a
fix: handle `Initial` parameters in `get_u0_p`
AayushSabharwal Feb 7, 2025
6273543
fix: fix infinite recursion in `full_equations`
AayushSabharwal Feb 7, 2025
7c457e5
fix: fix modelingtoolkitize
AayushSabharwal Feb 7, 2025
9d88d5f
fix: fix handling of array unknowns in `add_initialization_parameters`
AayushSabharwal Feb 7, 2025
14b28d4
fix: respect `validate` kward in `_remake_buffer`
AayushSabharwal Feb 7, 2025
7b5f29d
fix: handle constant initial conditions of derivatives of unknowns
AayushSabharwal Feb 7, 2025
8142b76
feat: implement `is_time_dependent` for `PDESystem`
AayushSabharwal Feb 10, 2025
2d9194d
fix: retain parameter dependencies in `build_operating_point!`
AayushSabharwal Feb 10, 2025
cecb15c
feat: export `Initial`
AayushSabharwal Feb 10, 2025
33e844b
refactor: make `symbol_to_symbolic` a global utility function
AayushSabharwal Feb 10, 2025
b42075a
feat: implement `SciMLBase.late_binding_update_u0_p` to update `Initi…
AayushSabharwal Feb 10, 2025
9d7e413
fix: provide history function to `reconstruct_fn` in `remake_initiali…
AayushSabharwal Feb 10, 2025
fe329d0
test: fix unsatisfiable initialization
AayushSabharwal Feb 10, 2025
f5cdf21
test: account for additional initialization parameters
AayushSabharwal Feb 10, 2025
525324a
fix: don't copy variables to `Initial` parameters in `ReconstructInit…
AayushSabharwal Feb 10, 2025
b0749b6
feat: add `Initial` parameters for real-valued parameter dependencies
AayushSabharwal Feb 11, 2025
35ef0ab
test: update tests to consider `Initial` parameters of pdeps
AayushSabharwal Feb 11, 2025
bfae1d2
refactor: move linearization-related code to new `linearization.jl` file
AayushSabharwal Feb 11, 2025
382ce9b
refactor: use new `LinearizationFunction` instead of closure in `line…
AayushSabharwal Feb 11, 2025
f0590ae
feat: add `LinearizationProblem`
AayushSabharwal Feb 11, 2025
0f5c008
feat: add `LinearizationProblem` constructor, `getindex` and `.ps` sy…
AayushSabharwal Feb 11, 2025
f9c328f
feat: export `LinearizationProblem`
AayushSabharwal Feb 11, 2025
494a7e7
docs: add docstrings for linearization
AayushSabharwal Feb 11, 2025
4eee373
fix: don't use `defaults_and_guesses` for operating point
AayushSabharwal Feb 11, 2025
ce0533f
fix: handle case when `u0 === nothing` in `linearization_function`
AayushSabharwal Feb 11, 2025
e16cf4d
fix: fix initialization of `linearize` testset
AayushSabharwal Feb 11, 2025
f34a4e0
test: minimally test `LinearizationProblem`
AayushSabharwal Feb 11, 2025
7793cb3
fix: handle `nothing` values in `InitializationProblem`
AayushSabharwal Feb 11, 2025
2a2b8b3
fix: handle `nothing` values in `linearize`
AayushSabharwal Feb 11, 2025
db2ae7b
test: fix initialization of `linearization_dd` testset
AayushSabharwal Feb 11, 2025
f0f1da9
fix: disable discovering defaults from metadata in `flatten(::ODESyst…
AayushSabharwal Feb 12, 2025
648956d
test: fix inversemodel testset
AayushSabharwal Feb 12, 2025
370343b
update pendcart test
baggepinnen Feb 12, 2025
9ed0fe2
test: fix initialization of some tests
AayushSabharwal Feb 12, 2025
b664e1c
fix: unhack observed in `process_SciMLProblem`
AayushSabharwal Feb 12, 2025
c73b0a2
test: test mutation of `Initial` parameters
AayushSabharwal Feb 12, 2025
4724540
test: test Issue#3342
AayushSabharwal Feb 12, 2025
ca1f389
test: test initialization for unsimplified systems
AayushSabharwal Feb 12, 2025
6f38a13
fix: check `hasname` for parameters in `propertynames`
AayushSabharwal Feb 12, 2025
158f3f8
build: bump SciMLBase compat
AayushSabharwal Feb 12, 2025
c12374f
docs: add documentation for `Initial` parameters
AayushSabharwal Feb 12, 2025
5d190f6
fix: better handle overrides for differentiated variables in `remake`
AayushSabharwal Feb 12, 2025
7baf788
docs: import `DynamicQuantities` in doc example requiring it
AayushSabharwal Feb 13, 2025
dfa4db8
docs: update remake doc page to account for extra tunables
AayushSabharwal Feb 13, 2025
c5b9fe0
fix: handle `state_priority` of wrapped variables
AayushSabharwal Feb 13, 2025
1e9d28f
test: add guess for FMI test
AayushSabharwal Feb 13, 2025
6bc28a8
fix: handle non-standard array indexes in `parameter_index`
AayushSabharwal Feb 13, 2025
3e5c436
fix: better handle scalarized array parameters with unscalarized defa…
AayushSabharwal Feb 13, 2025
85f9880
test: move `generate_custom_function` tests to `InterfaceII`
AayushSabharwal Feb 13, 2025
471e77c
test: rename `generate_custom_function` testset to `code_generation`
AayushSabharwal Feb 13, 2025
a50081d
fix: handle non-standard array indexes in codegen
AayushSabharwal Feb 13, 2025
4d9552c
test: test code generation for non-standard array indexes
AayushSabharwal Feb 13, 2025
c78e9f0
refactor: remove dead code
AayushSabharwal Feb 13, 2025
2748f7f
docs: add documentation for `Initial` operator
AayushSabharwal Feb 13, 2025
10250a2
docs: add PreallocationTools.jl to docs environment
AayushSabharwal Feb 13, 2025
a25aab4
test: increase tolerances of FMI CS test
AayushSabharwal Feb 14, 2025
7767fb5
fix: handle unsized array symbolics in `get_possibly_array_fallback_s…
AayushSabharwal Feb 14, 2025
0b72737
fix: search for required parameter dependencies in observed equations
AayushSabharwal Feb 14, 2025
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
Prev Previous commit
Next Next commit
refactor: remove dead code
AayushSabharwal committed Feb 13, 2025
commit c78e9f0089acc4db816b70058f42330693c60658
8 changes: 1 addition & 7 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
@@ -713,14 +713,8 @@ function add_initialization_parameters(sys::AbstractSystem)
end
all_initialvars = collect(all_initialvars)
initials = map(Initial(), all_initialvars)
# existing_initials = filter(
# x -> iscall(x) && (operation(x) isa Initial), parameters(sys))
existing_initials = []
@set! sys.ps = unique!([setdiff(get_ps(sys), existing_initials); initials])
@set! sys.ps = unique!([get_ps(sys); initials])
defs = copy(get_defaults(sys))
for x in existing_initials
delete!(defs, x)
end
for ivar in initials
if symbolic_type(ivar) == ScalarSymbolic()
defs[ivar] = zero_var(ivar)