@@ -100,7 +100,7 @@ def test_008_PVsystem(self):
100100 circuit = PyGridSim ()
101101 circuit .update_source ()
102102 circuit .add_load_nodes (num = 2 )
103- circuit .add_PVSystem (load_nodes = ["load0" , "load1" ], num_panels = 5 )
103+ circuit .add_PVSystems (load_nodes = ["load0" , "load1" ], num_panels = 5 )
104104 circuit .add_lines ([("source" , "load0" )])
105105 circuit .solve ()
106106 print (circuit .results (["Voltages" , "Losses" ]))
@@ -109,7 +109,7 @@ def test_009_generator(self):
109109 circuit = PyGridSim ()
110110 circuit .update_source ()
111111 circuit .add_load_nodes ()
112- circuit .add_generator (num = 3 , gen_type = "small" )
112+ circuit .add_generators (num = 3 , gen_type = "small" )
113113 circuit .add_lines ([("source" , "load0" ), ("generator0" , "load0" )])
114114 circuit .solve ()
115115 print (circuit .results (["Voltages" , "Losses" ]))
@@ -118,10 +118,10 @@ def test_010_many_sources(self):
118118 circuit = PyGridSim ()
119119 circuit .update_source (source_type = "powerplant" )
120120 circuit .add_load_nodes (num = 3 )
121- circuit .add_PVSystem (load_nodes = ["load1" , "load2" ], num_panels = 10 )
122- circuit .add_generator (num = 3 , gen_type = "small" )
121+ circuit .add_PVSystems (load_nodes = ["load1" , "load2" ], num_panels = 10 )
122+ circuit .add_generators (num = 3 , gen_type = "small" )
123123 circuit .update_source (source_type = "turbine" ) # change to a turbine source midway
124- circuit .add_generator (num = 4 , gen_type = "large" )
124+ circuit .add_generators (num = 4 , gen_type = "large" )
125125 circuit .add_lines ([("source" , "load0" ), ("generator0" , "load0" ), ("generator5" , "source" )])
126126 circuit .solve ()
127127 print (circuit .results (["Voltages" , "Losses" ]))
@@ -149,10 +149,10 @@ def test_011_configs(self):
149149
150150 # GENERATOR CONFIG
151151 # works, because not case sensitive
152- circuit .add_generator (num = 3 , gen_type = "SMALl" )
152+ circuit .add_generators (num = 3 , gen_type = "SMALl" )
153153 # don't want linetype input, just string
154154 with self .assertRaises (Exception ):
155- circuit .add_generator (num = 3 , gen_type = GeneratorType .SMALL )
155+ circuit .add_generators (num = 3 , gen_type = GeneratorType .SMALL )
156156
157157 # SOURCE CONFIG
158158 # works, because not case sensitive
@@ -211,9 +211,9 @@ def test_101_bad_parameter(self):
211211 # add load nodes so we can test pv system erroring
212212 circuit .add_load_nodes (num = 2 , params = {"kV" : 10 , "kW" : 20 , "kvar" :1 })
213213 with self .assertRaises (KeyError ):
214- circuit .add_generator (num = 4 , params = {"badParam" : 100 })
214+ circuit .add_generators (num = 4 , params = {"badParam" : 100 })
215215 with self .assertRaises (KeyError ):
216- circuit .add_PVSystem (load_nodes = ["load0" ], params = {"badParam" : 100 }, num_panels = 4 )
216+ circuit .add_PVSystems (load_nodes = ["load0" ], params = {"badParam" : 100 }, num_panels = 4 )
217217
218218 def test_102_negative_inputs (self ):
219219 """
@@ -245,6 +245,24 @@ def test_104_non_int_parameters(self):
245245 with self .assertRaises (TypeError ):
246246 circuit .add_load_nodes (params = {"kV" : "stringInput" })
247247
248+ def test_105_alt_source_parameters (self ):
249+ circuit = PyGridSim ()
250+ circuit .add_load_nodes (num = 5 )
251+ circuit .add_generators (params = {"kV" : 50 , "kW" : 100 })
252+ circuit .add_PVSystems (load_nodes = ["load0" , "load1" ], num_panels = 5 , params = {"kV" : 0.1 })
253+ circuit .solve ()
254+ print (circuit .results (["Voltages" , "Losses" ]))
255+ circuit .clear ()
256+
257+ def test_106_transformer_parameters (self ):
258+ circuit = PyGridSim ()
259+ circuit .add_load_nodes (num = 5 )
260+ circuit .update_source ()
261+ circuit .add_lines ([("source" , "load0" )], params = {"length" : 20 , "XHL" : 5 })
262+ circuit .solve ()
263+ print (circuit .results (["Voltages" , "Losses" ]))
264+ circuit .clear ()
265+
248266
249267class TestLargeCircuit (unittest .TestCase ):
250268 """
0 commit comments