Difference between two results given by causal simulation and acausal simulation in Xcos

Hi,
I have studied the RLC circuit given on the web page Electronics | Scilab.
I have assigned the values: R = 20 ohms, L = 0.1 henry and C = 0.001 farad.
I have found the output voltage Ua according to the input voltage Ue (as a unit step function as on the web page). I have solved the problem in 3 ways: analytical method, causal simulation and non-causal simulation in Xcos.
The graphs of output voltage Ua given by analytical method and causal simulation are the same, but the result given by causal simulation is different.
But if I assign a value of 1 ohm to R, the results given by all three ways are the same.
I do not understand why. I posted here all the images for the case R = 20 ohms.
I look forward to receiving everyone’s help. Thank you in advance.

Hello,

Can you share the two diagrams (you can attach them to your above post) ?

S.

1 Like

Hello,

This is likely an issue with your equations or the parameter’s initial values.
Be sure to have the exact initial conditions on the integral values; they might not be 0 at the start.

1 Like

Hi,
Thank you for replying to my email. Can I continue to communicate with you in French? I am in Vietnam but my French is good, my English is much worse.

Hello,

Considering the diagrams you sent me, you are not measuring tension at the right point in the acausal diagram. Your causal diagram amounts to measure the tension of the condensator, like this :


See the compared step responses (for R=10) below:

Hello,

Thank you for your enthusiastic help. I apologize for the delay in responding to you as I had to finish my semester work at the university in the last few days.

The causal simulation diagram I made is based on the equation given on the site Electronics | Scilab, which allows to determine the output voltage Ua as a function of the input voltage Ue. The voltage measured at the output of my causal simulation diagram is Ua, the total voltage across R and C. I do not understand why, as you said, this voltage is only the voltage across the capacitor in the non-causal simulation diagram, while in this diagram I also measure the total voltage across R and C.
However, the difference between the two causal and non-causal simulations only appears when the resistance R = 10 ohms and 20 ohms. With R = 1 ohm, they are the same. I did not make any changes to the two simulation diagrams in the 3 cases for different values ​​of R, except for the value of this element.

Hello,

Your causal simulation does not have the same diagram as the one at Electronics | Scilab. Please check that. Your diagram corresponds to the serial RLC circuit on Wikipedia’s French RLC page (Circuit RLC — Wikipédia).

S.

Hi, can you share the scilab/xcos source file with me too?
Thank you

Hello (welcome to Scilab’s Discourse!)

Here they are:

AC_R=10.zcos|attachment (3.9 KB)
C_R=10.zcos|attachment (3.9 KB)

S.

Thank you so much for the files.