# Unable to verify Superposition Principle via Matlab

I am dealing with this problem where I want to verify the Superposition Principle via Matlab.

I have a DC source of 100V, an AC source of 50V, 60Hz and three resistances, R1=10 ohms, R2=20 ohms and R3=15 ohms. (Refer circuit diagram)

Now, the Principle of Superposition states the total current in any part of a linear circuit equals the algebraic sum of the currents produced by each source separately. I am trying to verify the current flowing through R3 = 15 ohms resistance.

1. I short circuit the DC voltage source and run the program. Result:

2. I then short circuit the AC voltage source and run the program. Result:

As clearly can be seen, the Superposition Principle is not verified. I am unable to reason where the discrepancy is.

However, when taking both sources as DC or AC, the Principle is verified. Any help regarding this is appreciated.

• Superposition principle applies to DC/momentary current. Here you are mixing AC RMS with DC. Commented Mar 5, 2018 at 17:00
• To clarify: Think about two AC sources in series, working in opposite phase. Obviously they will cancel out each other. But RMS values will add up nicely to some positive value, which is obviously incorrect. Commented Mar 5, 2018 at 17:12
• i understand that at a particular instant, the principle will be valid. Commented Mar 5, 2018 at 17:23
• but i do not get how i am ''mixing" the two sources when i am considering their individual responses. are you trying to say that algebraic addition of the two is incorrect? Commented Mar 5, 2018 at 17:30
• No, it is not correct. See here: masteringelectronicsdesign.com/… Commented Mar 5, 2018 at 17:32