# Different Current Measurement

**URL:** <https://forum.plexim.com/t/different-current-measurement/2340>\
**Category:** PLECS\
**Tags:** plecs, simulink\
**Created:** [July 16, 2025, 8:56am UTC](https://forum.plexim.com/t/different-current-measurement/2340 "2025-07-16T08:56:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukman\_SN](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@Lukman\_SN](https://forum.plexim.com/u/Lukman_SN)\
**Post date:** [July 16, 2025, 8:56am UTC](https://forum.plexim.com/t/different-current-measurement/2340/1 "2025-07-16T08:56:01Z")

</div>

Hello, I would like to ask a question. I am building a 3-phase RLC circuit with a configuration as shown in the attached image. I am modeling the circuit in both Simulink and PLECS. Both models use the same parameters for R, L, and C values. I have also set the initial current values for each inductor according to the theory for RLC circuits. However, I set the initial voltage of the capacitor to zero. The current measurement results show a difference between PLECS and Simulink, but this difference only appears in Phase A. For Phases B and C, the results still appear different. If you have any suggestions, which parameter should I consider adjusting in the PLECS model?

 ![image](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/9/9ad292f8e91a70f7d2a787f11d7354a0d5976766.png)  
Results:  
 ![image](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/a/a501e23a3a21ca538a2f7109dc302664e18bbb5d.png)

Here I attached also the program initialization:

%% Parameter initialitation

Ri = 0.01;  
Labc = 3e-3;  
Labc\_1 = 9e-3;  
Vpp\_rms = 10;  
freq\_in = 50;  
Cabc = 1e-3;  
Vln\_peak = Vpp\_rms_sqrt(2/3);  
omega = 2_pi\*freq\_in;

%% Calculate initial current for impendance and capacitance  
% Total Reactance paralel XL & XC  
Lc\_paralel = 1/((1/(omega_Labc))+(-omega_Cabc));

% Phase angle for Z = R + JX  
phase\_angle1 = atan(((Labc\_1\*omega)+Lc\_paralel)/Ri);

% Magnitude Impedance Z = R +JX  
Z\_im = sqrt(Ri^2 + ((Labc\_1\*omega) + Lc\_paralel)^2);

% Magnitude for Reactance paralel XL & XC  
Z\_im2 = sqrt(Lc\_paralel^2);

% Initial current L1  
I\_init3 = (Vln\_peak/Z\_im)_sin([0 -2_pi/3 2\*pi/3]-phase\_angle1);

% Initial current L4  
Vz\_im2 = (Vln\_peak/Z\_im) \* Z\_im2; % Voltage in paralel branch  
I\_init4 = Vz\_im2/(Labc_omega)sin([0 -2pi/3 2_pi/3]-pi/2); % Initial current

% Initial Voltage C1  
V\_init = [0 0 0];

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [July 16, 2025, 5:32pm UTC](https://forum.plexim.com/t/different-current-measurement/2340/2 "2025-07-16T17:32:57Z")

</div>

It appears that the datapoints that are included for each solver step are accurate, but that they are linearly connected in the Scopes, producing a “non-smooth” output and missing of the min/max of the sinusoids in some areas. If that’s the case then having additional points rendered would help, however you don’t need to simply reduce the tolerance or step size settings in order to achieve this.

Please instead try increasing the “Refine Factor” setting, which will insert additional points to the waveform rendering using already calculated higher-order polynomial details from the integration routine. This setting can be found in the main tab of the PLECS Standalone preferences window and the Model Configuration Pane: Data Import/Export for Simulink if you are using PLECS Blockset.

Increasing from the default of 1 to a value of 5, would be a reasonable starting point to try.

---

<div class="post-metadata">

**Author:** ![Lukman\_SN](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@Lukman\_SN](https://forum.plexim.com/u/Lukman_SN)\
**Post date:** [July 17, 2025, 3:12am UTC](https://forum.plexim.com/t/different-current-measurement/2340/3 "2025-07-17T03:12:00Z")

</div>

Thank you for your suggestion Kris, I think i should give you the more detail differences for additional information. This current measurement in plecs still showing the different value when i modelled the same parameters with simulink. I expected that Inductor and capacitor in plecs need to define the initial value both for initial current for (L) and initial voltage for (C). But, there still a difference on phase B and C, Is it really increasing “refine factor” would be the solution or maybe there are another setting parameters that i need to fix?

 ![image](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/3/305f3b46bef15f6a3fc4175a20e92e2cd7caf64e.png)

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [July 17, 2025, 2:50pm UTC](https://forum.plexim.com/t/different-current-measurement/2340/4 "2025-07-17T14:50:47Z")

</div>

Thanks for providing a “zoomed in” view. Indeed the Refine Factor helped smoothen the waveforms, but you are right there remains a discrepancy. In your other recent post my colleague pointed you to the starting initial conditions that are required in PLECS to match what Simulink is expecting- did you try this?

Are you using the same Simulink solver settings between the two models?

---

<div class="post-metadata">

**Author:** ![Lukman\_SN](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@Lukman\_SN](https://forum.plexim.com/u/Lukman_SN)\
**Post date:** [July 25, 2025, 8:02am UTC](https://forum.plexim.com/t/different-current-measurement/2340/5 "2025-07-25T08:02:49Z")

</div>

It was already solved by finding the correct value for Initial Voltage for capacitor. Finding value of Initial voltage could be decided by considering the voltage value in Capacitor branch. But must be remembered that in Capacitor having a characteristic that The current is leading from voltage. In contrast the Inductor having a characteristic that The current is left behind from the voltage. So the phase shift on Initial voltage in capacitor would be zero. Finally, this problem solved by deciding the Initial voltage in capacitor correctly. Thank you for your help in advance
