我有一个 FMU 和 4 个输入,我想为它们提供 csv 文件。我做了以下事情:
from pyfmi import load_fmu
import pandas as pd
electricity_network = load_fmu(r"C:\Users\kosmy\Pandapower.fmu")
load_file = r"C:\Users\kosmy\load_prof.csv"
load = pd.read_csv(load_file, index_col = 0)
load = load.to_numpy()
pv_file = r"C:\Users\kosmy\pv_prof.csv"
pv = pd.read_csv(pv_file, index_col = 0)
pv = pv.to_numpy()
input_object = [((electricity_network, 'P_load1'), load),
((electricity_network, 'P_load2'), load),
((electricity_network, 'P_pv1'), pv),
((electricity_network, 'P_pv2'), pv)]
res = electricity_network.simulate(final_time = 96, input = input_object)
但我收到以下错误:
Traceback (most recent call last):
File "C:\Users\kosmy\run_pyfmi_csv.py", line 27, in <module>
res = electricity_network.simulate(final_time = 96, input = input_object)
File "src\pyfmi\fmi.pyx", line 7501, in pyfmi.fmi.FMUModelCS2.simulate
File "src\pyfmi\fmi.pyx", line 365, in pyfmi.fmi.ModelBase._exec_simulate_algorithm
File "src\pyfmi\fmi.pyx", line 359, in pyfmi.fmi.ModelBase._exec_simulate_algorithm
File "C:\Users\kosmy\anaconda3\envs\env\lib\site-packages\pyfmi\fmi_algorithm_drivers.py", line 772, in __init__
TrajectoryLinearInterpolation(self.input[1][:,0],
TypeError: tuple indices must be integers or slices, not tuple
知道出了什么问题吗?