Trying to add prv and set it

hi
I want to add a prv to the network and set it to a certain value and run single period hydraulic analysis. But the values of the pressures are not the same as the values of the epanet.
Codes:

%Clear
clear; close(‘all’); clc;
start_toolkit;

% Load a network.
d = epanet(‘Base0.inp’);

disp(‘Add a CV pipe’)

% Get from and to nodes for add cv pipe.
LinkIndex = 209;
LinkName =d.getLinkNameID(LinkIndex)

conn=d.getNodesConnectingLinksID;
befNodes=conn(LinkIndex,:);

fromNode = befNodes{1};
toNode = befNodes{2};
d.deleteLink(LinkIndex);

Code=‘PRV4’;
Vlv_Stg=15;
valve_index = d.addLinkValvePRV(Code,fromNode,toNode);
d.setLinkInitialSetting(valve_index,Vlv_Stg);

d.openHydraulicAnalysis;
d.initializeHydraulicAnalysis;
tstep=1;P=[];T_H=[];D=[];H=[];F=[];
while (tstep>0)
t=d.runHydraulicAnalysis;
P=[P; d.getNodePressure];
D=[D; d.getNodeActualDemand];
H=[H; d.getNodeHydaulicHead];
F=[F; d.getLinkFlows];
tstep=d.nextHydraulicAnalysisStep;
end
d.closeHydraulicAnalysis;
% Unload library.
d.unload