示例#1
0
def main():
    '''
    Main function to run the T&D Cosimulation    
    '''
    GlobalData.set_config('config_qsts.json')
    GlobalData.set_TDdata()
    startTime=time.time() 
    simulate()  
    print ('Simulation time: ' + str(time.time()-startTime) + "sec")
    generateReport(GlobalData,fname='report.xlsx',sim=GlobalData.config['simulationConfig']['simType'])
    return 0
示例#2
0
def main():
    '''
    Main function to run the T&D Cosimulation    
    '''
    GlobalData.set_config('config_td.json')
    GlobalData.set_TDdata()
    simulate()
    generateReport(GlobalData,
                   fname='report.xlsx',
                   sim=GlobalData.config['simulationConfig']['simType'])
    return 0
示例#3
0
def main(configfile):
    '''
    Main function to run the T&D Cosimulation    
    '''

    GlobalData.set_config(configfile)
    GlobalData.set_TDdata()
    setOutLocation()
    startTime = time.time()
    simulate()
    #    GlobalData.print_data()
    print('Simulation time: ' + str(time.time() - startTime) + "sec")
    generateReport(GlobalData,
                   fname=GlobalData.config["outputPath"] + "\\reportfin.xlsx",
                   sim=GlobalData.config['simulationConfig']['simType'])
    return 0
示例#4
0
def run(args):
	try:
		startTime = time.time()
		assert args.config, "config is not provided. You can specify this using -c --config"
		if not os.path.exists(os.path.abspath(args.config)) and os.path.exists(os.path.join(baseDir,args.config)):
			args.config=os.path.join(baseDir,args.config)
		assert os.path.exists(args.config),'{} does not exist'.format(args.config)

		# check if the config is valid
		check_config(args.config)

		GlobalData.set_config(args.config)
		GlobalData.set_TDdata()
		proc = Procedure()
		proc.simulate()
		print('Solution time:',time.time()-startTime)
	except:
		raise
示例#5
0
import unittest
import sys
import os

from tdcosim.global_data import GlobalData
from tdcosim.model.psse.psse_model import PSSEModel

dirlocation = os.path.abspath(sys.modules['__main__'].__file__)
rootindex = dirlocation.index('tdcosim_pkg')
dirlocation = dirlocation[0:rootindex + 11]
configlocation = dirlocation + '\\test\\testconfig.json'

GlobalData.set_config(configlocation)
GlobalData.set_TDdata()

GlobalData.config["cosimHome"] = dirlocation + '\\tdcoim'
GlobalData.config["psseConfig"][
    "rawFilePath"] = dirlocation + '\\SampleData\\TNetworks\\118bus\\case118.raw'
GlobalData.config["psseConfig"][
    "dyrFilePath"] = dirlocation + '\\SampleData\\TNetworks\\118bus\\case118.dyr'
GlobalData.config["openDSSConfig"]["defaultFeederConfig"]["filePath"] = [
    dirlocation + '\\SampleData\\DNetworks\\123Bus\\case123ZIP.dss'
]
GlobalData.config["openDSSConfig"]["manualFeederConfig"]["nodes"][0][
    "filePath"] = [
        dirlocation + '\\SampleData\\DNetworks\\123Bus\\case123ZIP.dss'
    ]


class TestPSSEModel(unittest.TestCase):
    def test_init(self):