Skip to content

Fix typos #2773

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

Merged
merged 2 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/src/examples/remake.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ over the various methods, listing their use cases.

This method is the most generic. It can handle symbolic maps, initializations of
parameters/states dependent on each other and partial updates. However, this comes at the
cost of performance. `remake` is also not always inferrable.
cost of performance. `remake` is also not always inferable.

## `remake` and `setp`/`setu`

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/discrete_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ the Fibonacci series:
```

The "default value" here should be interpreted as the value of `x` at all past timesteps.
For example, here `x(k-1)` and `x(k-2)` will be `1.0`, and the inital value of `x(k)` will
For example, here `x(k-1)` and `x(k-2)` will be `1.0`, and the initialvalue of `x(k)` will
thus be `2.0`. During problem construction, the _past_ value of a variable should be
provided. For example, providing `[x => 1.0]` while constructing this problem will error.
Provide `[x(k-1) => 1.0]` instead. Note that values provided during problem construction
Expand Down
2 changes: 1 addition & 1 deletion src/clock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ is_concrete_time_domain(x) = x isa Union{AbstractClock, Continuous}
SolverStepClock()
SolverStepClock(t)

A clock that ticks at each solver step (sometimes referred to as "continuous sample time"). This clock **does generally not have equidistant tick intervals**, instead, the tick interval depends on the adaptive step-size slection of the continuous solver, as well as any continuous event handling. If adaptivity of the solver is turned off and there are no continuous events, the tick interval will be given by the fixed solver time step `dt`.
A clock that ticks at each solver step (sometimes referred to as "continuous sample time"). This clock **does generally not have equidistant tick intervals**, instead, the tick interval depends on the adaptive step-size selection of the continuous solver, as well as any continuous event handling. If adaptivity of the solver is turned off and there are no continuous events, the tick interval will be given by the fixed solver time step `dt`.

Due to possibly non-equidistant tick intervals, this clock should typically not be used with discrete-time systems that assume a fixed sample time, such as PID controllers and digital filters.
"""
Expand Down
6 changes: 3 additions & 3 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2341,11 +2341,11 @@
print(io, "ExtraEquationsSystemException: ", e.msg)
end

struct HybridSystemNotSupportedExcpetion <: Exception
struct HybridSystemNotSupportedException <: Exception
msg::String
end
function Base.showerror(io::IO, e::HybridSystemNotSupportedExcpetion)
print(io, "HybridSystemNotSupportedExcpetion: ", e.msg)
function Base.showerror(io::IO, e::HybridSystemNotSupportedException)
print(io, "HybridSystemNotSupportedException: ", e.msg)

Check warning on line 2348 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L2347-L2348

Added lines #L2347 - L2348 were not covered by tests
end

function AbstractTrees.children(sys::ModelingToolkit.AbstractSystem)
Expand Down
10 changes: 5 additions & 5 deletions src/systems/clock_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
ClockInference(ts, eq_domain, var_domain, inferred)
end

struct NotInferedTimeDomain end
struct NotInferredTimeDomain end
function error_sample_time(eq)
error("$eq\ncontains `SampleTime` but it is not an infered discrete equation.")
error("$eq\ncontains `SampleTime` but it is not an Inferred discrete equation.")

Check warning on line 26 in src/systems/clock_inference.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/clock_inference.jl#L26

Added line #L26 was not covered by tests
end
function substitute_sample_time(ci::ClockInference, ts::TearingState)
@unpack eq_domain = ci
Expand All @@ -34,7 +34,7 @@
domain = eq_domain[i]
dt = sampletime(domain)
neweq = substitute_sample_time(eq, dt)
if neweq isa NotInferedTimeDomain
if neweq isa NotInferredTimeDomain

Check warning on line 37 in src/systems/clock_inference.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/clock_inference.jl#L37

Added line #L37 was not covered by tests
error_sample_time(eq)
end
eqs[i] = neweq
Expand All @@ -52,13 +52,13 @@
op = operation(ex)
args = arguments(ex)
if op == SampleTime
dt === nothing && return NotInferedTimeDomain()
dt === nothing && return NotInferredTimeDomain()

Check warning on line 55 in src/systems/clock_inference.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/clock_inference.jl#L55

Added line #L55 was not covered by tests
return dt
else
new_args = similar(args)
for (i, arg) in enumerate(args)
ex_arg = substitute_sample_time(arg, dt)
if ex_arg isa NotInferedTimeDomain
if ex_arg isa NotInferredTimeDomain

Check warning on line 61 in src/systems/clock_inference.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/clock_inference.jl#L61

Added line #L61 was not covered by tests
return ex_arg
end
new_args[i] = ex_arg
Expand Down
2 changes: 1 addition & 1 deletion src/systems/systemstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@
kwargs...)
if length(tss) > 1
if continuous_id > 0
throw(HybridSystemNotSupportedExcpetion("Hybrid continuous-discrete systems are currently not supported with the standard MTK compiler. This system requires JuliaSimCompiler.jl, see https://help.juliahub.com/juliasimcompiler/stable/"))
throw(HybridSystemNotSupportedException("Hybrid continuous-discrete systems are currently not supported with the standard MTK compiler. This system requires JuliaSimCompiler.jl, see https://help.juliahub.com/juliasimcompiler/stable/"))

Check warning on line 639 in src/systems/systemstructure.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/systemstructure.jl#L639

Added line #L639 was not covered by tests
end
# TODO: rename it to something else
discrete_subsystems = Vector{ODESystem}(undef, length(tss))
Expand Down
8 changes: 4 additions & 4 deletions test/clock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ eqs = [yd ~ Sample(t, dt)(y)
D(x) ~ -x + u
y ~ x]
@named sys = ODESystem(eqs, t)
@test_throws ModelingToolkit.HybridSystemNotSupportedExcpetion ss=structural_simplify(sys);
@test_throws ModelingToolkit.HybridSystemNotSupportedException ss=structural_simplify(sys);

@test_skip begin
Tf = 1.0
Expand Down Expand Up @@ -500,18 +500,18 @@ eqs = [yd ~ Sample(t, dt)(y)
@mtkmodel FirstOrderWithStepCounter begin
@components begin
counter = CounterSys()
fo = FirstOrderSys()
firstorder = FirstOrderSys()
end
@equations begin
counter.u ~ fo.x
counter.u ~ firstorder.x
end
end

@mtkbuild model = FirstOrderWithStepCounter()
prob = ODEProblem(model, [], (0.0, 10.0))
sol = solve(prob, Tsit5(), kwargshandle = KeywordArgSilent)

@test sol.prob.kwargs[:disc_saved_values][1].t == sol.t[1:2:end] # Test that the discrete-tiem system executed at every step of the continuous solver. The solver saves each time step twice, one state value before discrete affect and one after.
@test sol.prob.kwargs[:disc_saved_values][1].t == sol.t[1:2:end] # Test that the discrete-time system executed at every step of the continuous solver. The solver saves each time step twice, one state value before discrete affect and one after.
@test_nowarn ModelingToolkit.build_explicit_observed_function(
model, model.counter.ud)(sol.u[1], prob.p..., sol.t[1])

Expand Down
2 changes: 1 addition & 1 deletion test/parameter_dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ end
D(x) ~ -x + u
y ~ x
z(k) ~ z(k - 2) + yd(k - 2)]
@test_throws ModelingToolkit.HybridSystemNotSupportedExcpetion @mtkbuild sys = ODESystem(
@test_throws ModelingToolkit.HybridSystemNotSupportedException @mtkbuild sys = ODESystem(
eqs, t; parameter_dependencies = [kq => 2kp])

@test_skip begin
Expand Down
Loading