can not update MATLAB initial conditons when using BCVTB coupling EP+ and MATLAB

asked 2017-08-02 13:50:04 -0500

nancynanxiaodan gravatar image

updated 2017-08-08 09:30:18 -0500

Hi all.

I am using BCVTB for linking EP+ and Matlab(control signal)

currently, I am facing a problem. after the first run of the system, the initial conditions set up in MATLAB is not changing anymore.

In MATLAB initialisation section, I wrote an small function myself to assign value of one variable's initial value, after first run, it seems to be fixed at the same value for next simulation.

It happens in IDF file, which I know I have to deleted some related files if I have to update the IDF for a new run, looks like the same issues here, however, I tried to deleted some files created by MATLAB, seems not working for this issues.

Pdemand_10mins will be used as a condition check in later stage, however, after first simulation, it sticks with a fixed value.

If you have any tips and suggestions, please help!

I had a detail look at this issues, I found out that it looks like BCVTB limited the random number generated from initialisation part, unless you have another random function generates random number before

 [Pdemand_10mins, PSOC_10mins] = EV_demand_generation_1();

otherwise, it will be exactly the same random number every time when we simulate.

Any possible ways we could solve this issues?

% Initialize model variables
delTim    = 600;  % time step %10 min
HeatingSystemStatus = 1;
Electricity = zeros(144,1);
InputsFromEP = [0 0]; % 2 variables 1. electricity from house 2. indoor temp.

% Initialize flags
retVal    = 0;
flaWri    = 0;
flaRea    = 0;
simTimWri = 600;% time step %10 min
simTimRea = 0;

[Pdemand_10mins, PSOC_10mins] = EV_demand_generation_1();
filename_1 ='SOC.csv';
csvwrite(filename_1,PSOC_10mins);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add path to BCVTB matlab libraries
addpath( strcat(getenv('BCVTB_HOME'), '/lib/matlab'));

Many thanks

Nancy

edit retag flag offensive close merge delete