@@ -30,12 +30,15 @@ NOTE: Current plots are for the total current flowing in the coil (ie. it is mul
30
30
end
31
31
32
32
currents = [get_time_array (c. current, :data , time0) * getproperty (c. element[1 ], :turns_with_sign , 1.0 ) for c in pfa. coil]
33
-
34
33
CURRENT = maximum ((maximum (abs, c. current. data[index] * getproperty (c. element[1 ], :turns_with_sign , 1.0 )) for c in pfa. coil))
35
34
if maximum (currents) > 1e6
36
35
currents = currents ./ 1e6
37
36
CURRENT = CURRENT ./ 1e6
38
37
c_unit = " MA"
38
+ elseif maximum (currents) > 1e3
39
+ currents = currents ./ 1e3
40
+ CURRENT = CURRENT ./ 1e3
41
+ c_unit = " kA"
39
42
else
40
43
c_unit = " A"
41
44
end
@@ -77,7 +80,7 @@ NOTE: Current plots are for the total current flowing in the coil (ie. it is mul
77
80
linestyle --> :dash
78
81
marker --> :circle
79
82
ylabel := " [$c_unit ]"
80
- [" $k " for k in 1 : length (currents)], currents
83
+ [" $k " for k in eachindex (currents)], currents
81
84
end
82
85
83
86
Imax = []
@@ -98,12 +101,14 @@ NOTE: Current plots are for the total current flowing in the coil (ie. it is mul
98
101
@series begin
99
102
marker --> :cross
100
103
label := " Max current"
101
- [" $k " for k in 1 : length (currents)], Imax
104
+ ylabel := " [$c_unit ]"
105
+ [" $k " for k in eachindex (currents)], Imax
102
106
end
103
107
@series begin
104
108
marker --> :cross
105
109
primary := false
106
- [" $k " for k in 1 : length (currents)], - Imax
110
+ ylabel := " [$c_unit ]"
111
+ [" $k " for k in eachindex (currents)], - Imax
107
112
end
108
113
end
109
114
@@ -1810,7 +1815,7 @@ end
1810
1815
controller = IMAS. parent (controller_outputs)
1811
1816
1812
1817
data = controller. inputs. data[1 , :]
1813
- integral = cumsum ((data[k+ 1 ] + data[k]) / 2.0 * (controller. inputs. time[k+ 1 ] - controller. inputs. time[k]) for k in 1 : length (controller. inputs. time)- 1 )
1818
+ integral = cumsum ((data[k+ 1 ] + data[k]) / 2.0 * (controller. inputs. time[k+ 1 ] - controller. inputs. time[k]) for k in eachindex (controller. inputs. time)- 1 )
1814
1819
derivative = diff (data) ./ diff (controller. inputs. time)
1815
1820
1816
1821
@series begin
0 commit comments