Skip to content

Commit 6f3d771

Browse files
committed
Use registered [email protected] + Adapted all examples and tests, so that dependent packages are included via Modia.
1 parent 64b7242 commit 6f3d771

27 files changed

+227
-59
lines changed

Manifest.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ version = "0.3.1"
108108
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
109109

110110
[[ModiaMath]]
111-
deps = ["DataFrames", "DataStructures", "LinearAlgebra", "Printf", "Requires", "StaticArrays", "Sundials", "Test", "Unitful"]
111+
deps = ["DataFrames", "DataStructures", "LinearAlgebra", "Pkg", "Printf", "Requires", "StaticArrays", "Sundials", "Test", "Unitful"]
112112
git-tree-sha1 = "7007013a87bfb4cd165c2df1c54ee48fff166e60"
113-
repo-rev = "master"
114-
repo-url = "ModiaMath"
115113
uuid = "67ccffd1-116d-535b-ad39-76a8fd0cbf71"
116114
version = "0.2.4"
117115

examples/CauerLowPassFilter.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ println("\nTestCauerLowPassFilter: Demonstrating the ability to simulate an elec
55

66
using Modia
77
using Modia.Electric
8-
using ModiaMath:plot
8+
9+
# Desired:
10+
# using ModiaMath: plot
11+
#
12+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
13+
using Modia.ModiaMath: plot
914

1015

1116
@model CauerLowPassOPV begin

examples/CollidingBalls.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ module TestBalls
33
println("\nCollidingBalls: Demonstrating the use of allInstances to set up contact force between any number of balls")
44

55
using Modia
6-
using ModiaMath:plot
6+
7+
# Desired:
8+
# using ModiaMath: plot
9+
# using Test
10+
# using LinearAlgebra
11+
#
12+
# In order that these packages need not to be defined in the user environment, they are included via Modia:
13+
using Modia.ModiaMath: plot
714

815
@static if VERSION < v"0.7.0-DEV.2005"
916
using Base.Test
1017
else
11-
using Test
12-
using LinearAlgebra
18+
using Modia.Test
19+
using Modia.LinearAlgebra
1320
end
1421

1522
const k=10000

examples/CurrentController.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ using Modia
66
using Modia.Electric
77
using Modia.Rotational
88
using Modia.Blocks
9-
using ModiaMath: plot
9+
10+
# Desired:
11+
# using ModiaMath: plot
12+
#
13+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
14+
using Modia.ModiaMath: plot
15+
1016

1117
@model CurrentController begin
1218
k=30 # Gain of PI current controller
@@ -46,10 +52,10 @@ end
4652

4753
#result = simulate(CurrentController, 0.1, storeEliminated=false)
4854

49-
#=
50-
result = checkSimulation(CurrentController, 0.1, "load.w", 0.07929151315487117, removeSingularities=false)
51-
plot(result, ("currentSensor.i", "step.y", "load.w"))
52-
=#
55+
# result = checkSimulation(CurrentController, 0.1, "load.w", 0.07929151315487117, removeSingularities=false)
56+
# plot(result, ("currentSensor.i", "step.y", "load.w"))
57+
58+
5359
@static if VERSION < v"0.7.0-DEV.2005"
5460
result = checkSimulation(CurrentController, 0.1, "load.w", 0.07927285979038304, removeSingularities=true)
5561
plot(result, [("currentSensor.i", "step.y"), "load.w"], heading="CurrentController", figure=11)

examples/ElectricalVehicleAndCharger.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ println("ElectricalVehicleAndCharger: Demonstrates the ability to change models
44

55
using Modia
66
using Modia.Electric
7-
using ModiaMath:plot
8-
97

108
using Modia:@equation
119
using Modia:addEquation!
1210
using Modia:deleteEquation!
1311

12+
13+
# Desired:
14+
# using ModiaMath: plot
15+
#
16+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
17+
using Modia.ModiaMath: plot
18+
19+
1420
# -----------------------------------
1521

1622
function concatenateTimeSeries(result1, result2)

examples/HeatTransfer2D.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
module HeatTransfer2D
22

33
using Modia
4-
using ModiaMath
4+
5+
# Desired:
6+
# using ModiaMath: plot
7+
#
8+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
9+
using Modia.ModiaMath: plot
10+
511

612
# Definition of model
713
const N = 30 # 100 # Number of nodes in x-direction (same number of nodes in y-direction
@@ -83,7 +89,7 @@ end
8389
end
8490

8591
result = simulate(HeatTransfer, 30)
86-
#ModiaMath.plot(result, "T", figure=22)
92+
#plot(result, "T", figure=22)
8793

8894
res = Dict{AbstractString,Any}()
8995
res["time"] = result["time"]
@@ -98,6 +104,6 @@ res[v2] = T[:, 1, div(N,2)]
98104
res[v3] = T[:, N, 1]
99105
res[v4] = T[:, 1, N]
100106

101-
ModiaMath.plot(res, (v1, v2, v3, v4), figure=20, heading="HeatTransfer2D: N=$N, temperature [K]")
107+
plot(res, (v1, v2, v3, v4), figure=20, heading="HeatTransfer2D: N=$N, temperature [K]")
102108

103109
end

examples/LinearSystems.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ println("\nLinearSystems: Demonstrates type and size deduction.")
44

55
using Modia
66
using Modia.Blocks: ABCD, Switch
7-
using ModiaMath: plot
7+
8+
9+
# Desired:
10+
# using ModiaMath: plot
11+
#
12+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
13+
using Modia.ModiaMath: plot
814

915

1016
@model MySISOABCD begin

examples/Rectifier.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ println("\nRectifier: Demonstrating the ability to simulate models with state ev
44

55
using Modia
66
using Modia.Electric
7-
using ModiaMath: plot
7+
8+
# Desired:
9+
# using ModiaMath: plot
10+
#
11+
# In order that ModiaMath need not to be defined in the user environment, it is included via Modia:
12+
using Modia.ModiaMath: plot
13+
814

915
@model Rectifier begin
1016
R=Resistor(R=1)

examples/SynchronousExamples.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ println("\nSynchronousExamples: Demonstrating the ability to simulate models wit
44

55
using Modia
66
using Modia.Synchronous: sample, Clock, previous, hold
7-
using ModiaMath:plot
7+
8+
# Desired:
9+
# using ModiaMath: plot
10+
# using Test
11+
#
12+
# In order that these packages need not to be defined in the user environment, they are included via Modia:
13+
using Modia.ModiaMath: plot
814

915
@static if VERSION < v"0.7.0-DEV.2005"
1016
using Base.Test
1117
else
12-
using Test
18+
using Modia.Test
1319
end
1420

1521
@testset "Synchronous" begin

examples/runexamples.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ include("LinearSystems.jl")
2121
include("SynchronousExamples.jl")
2222
@static if VERSION < v"0.7.0-DEV.2005"
2323
include("ElectricalVehicleAndCharger.jl") # Problem in 1.0
24-
include("CollidingBalls.jl")
2524
end
25+
include("CollidingBalls.jl")
2626
include("HeatTransfer2D.jl")
2727

2828
Modia.ModiaLogging.printTestStatus()

0 commit comments

Comments
 (0)