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
8 changes: 4 additions & 4 deletions docs/src/tutorials/input_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ end

Symbolics.@register_symbolic get_sampled_data(t)

function System(; name)
function CustomSystem(; name)
vars = @variables f(t)=0 x(t)=0 dx(t)=0 ddx(t)=0
pars = @parameters m=10 k=1000 d=1

Expand All @@ -216,7 +216,7 @@ function System(; name)
System(eqs, t, vars, pars; name)
end

@named system = System()
@named system = CustomSystem()
sys = mtkcompile(system)
prob = ODEProblem(sys, [], (0, time[end]))

Expand Down Expand Up @@ -248,7 +248,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
using ModelingToolkitStandardLibrary.Blocks
using OrdinaryDiffEq

function System(; name)
function SampledDataSystem(; name)
src = SampledData(Float64, name = :src)

vars = @variables f(t)=0 x(t)=0 dx(t)=0 ddx(t)=0
Expand All @@ -262,7 +262,7 @@ function System(; name)
System(eqs, t, vars, pars; systems = [src], name)
end

@named system = System()
@named system = SampledDataSystem()
sys = mtkcompile(system, split = false)
s = complete(system)

Expand Down
4 changes: 2 additions & 2 deletions test/Electrical/analog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ end
connect(R2.n, voltage.n, ground.g)]

@named model = System(connections, t,
systems = [R0, R1, R2, source, short, voltage, ground]; guesses = [R2.v => 0.0])
systems = [R0, R1, R2, source, short, voltage, ground]; guesses = [R2.v => 0.0, R1.v => 0.0])
sys = mtkcompile(model)
prob = ODEProblem(sys, [], (0, 2.0))
sol = solve(prob, Rodas4()) # has no state; does not work with Tsit5
Expand Down Expand Up @@ -867,7 +867,7 @@ end

@mtkcompile sys = SimplePNPCircuitSubstrate(V_b = 0.70)

prob = ODEProblem(sys, [sys.Q1.c.i => 0.0], (0.0, 10.0))
prob = ODEProblem(sys, [sys.Q1.c.i => 0.0], (0.0, 10.0); guesses = [sys.Q1.I_sub => 1.0])
sol = solve(prob)

@test isapprox(
Expand Down
Loading