Skip to content

Commit 3fd9073

Browse files
Merge pull request #3765 from oameye/typo
fix: spelling typos
2 parents d3433aa + d640517 commit 3fd9073

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

src/modelingtoolkitize/common.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ end
4646
"""
4747
$(TYPEDSIGNATURES)
4848
49-
Return a symbolic state for the given proble `prob.`. `t` is the independent variable.
49+
Return a symbolic state for the given problem `prob.`. `t` is the independent variable.
5050
`u_names` optionally contains the names to use for the created symbolic variables.
5151
"""
5252
function construct_vars(prob, t, u_names = nothing)
@@ -287,7 +287,7 @@ end
287287
"""
288288
$(TYPEDSIGNATURES)
289289
290-
Return a symbolic parameter object for the given proble `prob.`. `t` is the independent
290+
Return a symbolic parameter object for the given problem `prob.`. `t` is the independent
291291
variable. `p_names` optionally contains the names to use for the created symbolic
292292
variables.
293293
"""
@@ -319,7 +319,7 @@ end
319319
$(TYPEDSIGNATURES)
320320
321321
Given the differential operator `D`, mass matrix `mm` and ordered list of unknowns `vars`,
322-
return the list of
322+
return the list of
323323
"""
324324
function lhs_from_mass_matrix(D, mm, vars)
325325
var_set = Set(vars)

src/structural_transformation/symbolics_tearing.jl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ end
193193
=#
194194

195195
"""
196-
Replace derivatives of non-selected unknown variables by dummy derivatives.
196+
Replace derivatives of non-selected unknown variables by dummy derivatives.
197197
198198
State selection may determine that some differential variables are
199199
algebraic variables in disguise. The derivative of such variables are
200200
called dummy derivatives.
201201
202-
`SelectedState` information is no longer needed after this function is called.
203-
State selection is done. All non-differentiated variables are algebraic
202+
`SelectedState` information is no longer needed after this function is called.
203+
State selection is done. All non-differentiated variables are algebraic
204204
variables, and all variables that appear differentiated are differential variables.
205205
"""
206206
function substitute_derivatives_algevars!(
@@ -241,7 +241,7 @@ function substitute_derivatives_algevars!(
241241
end
242242
end
243243

244-
#=
244+
#=
245245
There are three cases where we want to generate new variables to convert
246246
the system into first order (semi-implicit) ODEs.
247247
@@ -288,32 +288,32 @@ where `:=` denotes assignment.
288288
As a final note, in all the above cases where we need to introduce new
289289
variables and equations, don't add them when they already exist.
290290
291-
###### DISCRETE SYSTEMS #######
291+
###### DISCRETE SYSTEMS #######
292292
293293
Documenting the differences to structural simplification for discrete systems:
294294
295295
In discrete systems everything gets shifted forward a timestep by `shift_discrete_system`
296-
in order to properly generate the difference equations.
296+
in order to properly generate the difference equations.
297297
298298
In the system x(k) ~ x(k-1) + x(k-2), becomes Shift(t, 1)(x(t)) ~ x(t) + Shift(t, -1)(x(t))
299299
300-
The lowest-order term is Shift(t, k)(x(t)), instead of x(t). As such we actually want
300+
The lowest-order term is Shift(t, k)(x(t)), instead of x(t). As such we actually want
301301
dummy variables for the k-1 lowest order terms instead of the k-1 highest order terms.
302302
303303
Shift(t, -1)(x(t)) -> x\_{t-1}(t)
304304
305-
Since Shift(t, -1)(x) is not a derivative, it is directly substituted in `fullvars`.
306-
No equation or variable is added for it.
305+
Since Shift(t, -1)(x) is not a derivative, it is directly substituted in `fullvars`.
306+
No equation or variable is added for it.
307307
308-
For ODESystems D(D(D(x))) in equations is recursively substituted as D(x) ~ x_t, D(x_t) ~ x_tt, etc.
309-
The analogue for discrete systems, Shift(t, 1)(Shift(t,1)(Shift(t,1)(Shift(t, -3)(x(t)))))
310-
does not actually appear. So `total_sub` in generate_system_equations` is directly
311-
initialized with all of the lowered variables `Shift(t, -3)(x) -> x_t-3(t)`, etc.
308+
For ODESystems D(D(D(x))) in equations is recursively substituted as D(x) ~ x_t, D(x_t) ~ x_tt, etc.
309+
The analogue for discrete systems, Shift(t, 1)(Shift(t,1)(Shift(t,1)(Shift(t, -3)(x(t)))))
310+
does not actually appear. So `total_sub` in generate_system_equations` is directly
311+
initialized with all of the lowered variables `Shift(t, -3)(x) -> x_t-3(t)`, etc.
312312
=#
313313
"""
314314
Generate new derivative variables for the system.
315315
316-
Effects on the system structure:
316+
Effects on the system structure:
317317
- fullvars: add the new derivative variables x_t
318318
- neweqs: add the identity equations for the new variables, D(x) ~ x_t
319319
- graph: update graph with the new equations and variables, and their connections
@@ -484,7 +484,7 @@ function find_duplicate_dd(dv, solvable_graph, diff_to_var, linear_eqs, mm)
484484
end
485485

486486
"""
487-
Add a dummy derivative variable x_t corresponding to symbolic variable D(x)
487+
Add a dummy derivative variable x_t corresponding to symbolic variable D(x)
488488
which has index dv in `fullvars`. Return the new index of x_t.
489489
"""
490490
function add_dd_variable!(s::SystemStructure, fullvars, x_t, dv)
@@ -516,22 +516,22 @@ function add_dd_equation!(s::SystemStructure, neweqs, eq, dv, v_t)
516516
end
517517

518518
"""
519-
Solve the equations in `neweqs` to obtain the final equations of the
519+
Solve the equations in `neweqs` to obtain the final equations of the
520520
system.
521521
522-
For each equation of `neweqs`, do one of the following:
522+
For each equation of `neweqs`, do one of the following:
523523
1. If the equation is solvable for a differentiated variable D(x),
524524
then solve for D(x), and add D(x) ~ sol as a differential equation
525525
of the system.
526-
2. If the equation is solvable for an un-differentiated variable x,
526+
2. If the equation is solvable for an un-differentiated variable x,
527527
solve for x and then add x ~ sol as a solved equation. These will
528528
become observables.
529529
3. If the equation is not solvable, add it as an algebraic equation.
530530
531531
Solved equations are added to `total_sub`. Occurrences of differential
532532
or solved variables on the RHS of the final equations will get substituted.
533533
The topological sort of the equations ensures that variables are solved for
534-
before they appear in equations.
534+
before they appear in equations.
535535
536536
Reorder the equations and unknowns to be in the BLT sorted form.
537537
@@ -610,7 +610,7 @@ function generate_system_equations!(state::TearingState, neweqs, var_eq_matching
610610
@unpack neweqs′, eq_ordering, var_ordering, solved_eqs, solved_vars = eq_generator
611611

612612
is_diff_eq = .!iszero.(var_ordering)
613-
# Generate new equations and orderings
613+
# Generate new equations and orderings
614614
diff_vars = var_ordering[is_diff_eq]
615615
diff_vars_set = BitSet(diff_vars)
616616
if length(diff_vars_set) != length(diff_vars)
@@ -695,7 +695,7 @@ struct EquationGenerator{S, D, I}
695695
neweqs′::Vector{Equation}
696696
"""
697697
`eq_ordering[i]` is the index `neweqs′[i]` was originally at in the untorn equations of
698-
the system. This is used to permute the state of the system into BLT sorted form.
698+
the system. This is used to permute the state of the system into BLT sorted form.
699699
"""
700700
eq_ordering::Vector{Int}
701701
"""
@@ -866,7 +866,7 @@ function make_solved_equation(var, eq, total_sub; simplify = false)
866866
end
867867

868868
"""
869-
Given the ordering returned by `generate_system_equations!`, update the
869+
Given the ordering returned by `generate_system_equations!`, update the
870870
tearing state to account for the new order. Permute the variables and equations.
871871
Eliminate the solved variables and equations from the graph and permute the
872872
graph's vertices to account for the new variable/equation ordering.
@@ -916,7 +916,7 @@ function reorder_vars!(state::TearingState, var_eq_matching, var_sccs, eq_orderi
916916
# Remove empty SCCs
917917
filter!(!isempty, var_sccs)
918918

919-
# Update system structure
919+
# Update system structure
920920
@set! state.structure.graph = complete(new_graph)
921921
@set! state.structure.var_to_diff = new_var_to_diff
922922
@set! state.structure.eq_to_diff = new_eq_to_diff
@@ -933,7 +933,7 @@ function update_simplified_system!(
933933
@unpack fullvars, structure = state
934934
@unpack solvable_graph, var_to_diff, eq_to_diff, graph = structure
935935
diff_to_var = invview(var_to_diff)
936-
# Since we solved the highest order derivative varible in discrete systems,
936+
# Since we solved the highest order derivative variable in discrete systems,
937937
# we make a list of the solved variables and avoid including them in the
938938
# unknowns.
939939
solved_vars = Set()
@@ -1058,7 +1058,7 @@ function tearing_reassemble(state::TearingState, var_eq_matching::Matching,
10581058
state, neweqs, var_eq_matching, full_var_eq_matching, var_sccs; iv, D)
10591059
end
10601060

1061-
# Structural simplification
1061+
# Structural simplification
10621062
substitute_derivatives_algevars!(state, neweqs, var_eq_matching, dummy_sub; iv, D)
10631063

10641064
var_sccs = generate_derivative_variables!(

src/systems/problem_utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ end
985985
$(TYPEDEF)
986986
987987
A callable struct to use as the `get_updated_u0` field of `InitializationMetadata`.
988-
Returns the value to use for the `u0` of the problem.
988+
Returns the value to use for the `u0` of the problem.
989989
990990
# Fields
991991
@@ -1451,7 +1451,7 @@ function check_inputmap_keys(sys, op)
14511451
end
14521452

14531453
const BAD_KEY_MESSAGE = """
1454-
Undefined keys found in the parameter or initial condition maps. Check if symbolic variable names have been reassigned.
1454+
Undefined keys found in the parameter or initial condition maps. Check if symbolic variable names have been reassigned.
14551455
The following keys are invalid:
14561456
"""
14571457

@@ -1634,7 +1634,7 @@ end
16341634
"""
16351635
$(TYPEDSIGNATURES)
16361636
1637-
Turn key-value pairs in `kws` into assignments and appent them to `block.args`. `head` is
1637+
Turn key-value pairs in `kws` into assignments and append them to `block.args`. `head` is
16381638
the head of the `Expr` used to create the assignment. `filter` is a function that takes the
16391639
key and returns whether or not to include it in the assignments.
16401640
"""

src/systems/system.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,12 +624,12 @@ function process_costs(costs::Vector, sts, ps, iv)
624624
end
625625

626626
"""
627-
Validate that all the variables in an auxiliary system of the (ODE) System (constraint or costs) are
627+
Validate that all the variables in an auxiliary system of the (ODE) System (constraint or costs) are
628628
well-formed states or parameters.
629629
- Callable/delay variables (e.g. of the form x(0.6) should be unknowns of the system (and have one arg, etc.)
630630
- Callable/delay parameters should be parameters of the system
631631
632-
Return the set of additional parameters found in the system, e.g. in x(p) ~ 3 then p should be added as a
632+
Return the set of additional parameters found in the system, e.g. in x(p) ~ 3 then p should be added as a
633633
parameter of the system.
634634
"""
635635
function validate_vars_and_find_ps!(auxvars, auxps, sysvars, iv)
@@ -1072,14 +1072,14 @@ end
10721072

10731073
function Base.showerror(io::IO, err::EventsInTimeIndependentSystemError)
10741074
println(io, """
1075-
Events are not supported in time-indepent systems. Provide an independent variable to \
1075+
Events are not supported in time-independent systems. Provide an independent variable to \
10761076
make the system time-dependent or remove the events.
10771077
10781078
The following continuous events were provided:
10791079
$(err.cevents)
10801080
10811081
The following discrete events were provided:
1082-
$(err.devents)
1082+
$(err.devents)
10831083
""")
10841084
end
10851085

0 commit comments

Comments
 (0)