Skip to content

Commit 5d48b5e

Browse files
author
Brad Carman
committed
format
1 parent 8a5839a commit 5d48b5e

File tree

3 files changed

+339
-227
lines changed

3 files changed

+339
-227
lines changed

examples/electrical.jl

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,34 @@ using ModelingToolkitDesigner
55
using CairoMakie
66
using GLMakie
77

8-
@component function PassThru2(;name)
8+
@component function PassThru2(; name)
99
@variables t
10-
10+
1111
systems = @named begin
1212
p1 = Pin()
1313
p2 = Pin()
1414
end
1515

16-
eqs = [
17-
connect(p1, p2)
18-
]
16+
eqs = [connect(p1, p2)]
1917

2018
return ODESystem(eqs, t, [], []; name, systems)
2119
end
2220

23-
@component function PassThru3(;name)
21+
@component function PassThru3(; name)
2422
@variables t
25-
23+
2624
systems = @named begin
2725
p1 = Pin()
2826
p2 = Pin()
2927
p3 = Pin()
3028
end
3129

32-
eqs = [
33-
connect(p1, p2, p3)
34-
]
30+
eqs = [connect(p1, p2, p3)]
3531

3632
return ODESystem(eqs, t, [], []; name, systems)
3733
end
3834

39-
@component function Circuit(;name)
35+
@component function Circuit(; name)
4036

4137
R = 1.0
4238
C = 1.0
@@ -48,7 +44,7 @@ end
4844
capacitor = Capacitor(C = C)
4945
source = Voltage()
5046
constant = Constant(k = V)
51-
ground = Ground()
47+
ground = Ground()
5248
pt2 = PassThru2()
5349
pt3 = PassThru3()
5450
end
@@ -68,7 +64,7 @@ end
6864
# connect(resistor.n, capacitor.p)
6965
# connect(capacitor.n, source.n, ground.g)]
7066

71-
ODESystem(eqs, t, [], []; systems, name)
67+
ODESystem(eqs, t, [], []; systems, name)
7268
end
7369

7470
@named rc = Circuit()
@@ -80,7 +76,7 @@ end
8076

8177
path = joinpath(@__DIR__, "design")
8278
design = ODESystemDesign(rc, path)
83-
GLMakie.set_theme!(Theme(;fontsize=12))
79+
GLMakie.set_theme!(Theme(; fontsize = 12))
8480
ModelingToolkitDesigner.view(design)
8581

8682
# CairoMakie.set_theme!(Theme(;fontsize=12))

0 commit comments

Comments
 (0)