# Boost converter achieving over-unity efficiency

I'm trying to charge a 200V battery with a 100V battery with the help of a boost converter in Simulink, just as an experiment. This is my circuit:

The 100V battery is V1 with a series resistance Rseries1 and the 200V battery is V2 with a series resistance Rseries2. The series resistance for both batteries is set to 0.01 ohms and the inductor is set to 220uH with a series resistance of 0.025 ohms. The duty-cycle is set to 50%.

I'm measuring the input and output power in this manner:

The multimeters are used to measure the input and output voltage and current, the product block is used to multiply voltage and current and get the instantaneous power and the RMS block (fundamental set to 20kHz, which is the switching frequency) is used to get a steady value.

When I run the simulation, I get this result:

The output power is higher than the input power!

I initially thought that this error could be due to the voltage source present on the output side, so I replaced it with a 100ohm resistor and ran the simulation again. This is what I got:

The output power is still higher than the input power. So bizarre!

Next, I added an output capacitance of 330uF and ran the simulation again.

This time, the measured output power is less than the measured input power.

So why was there an over-unity efficiency in the previous cases? What have I done wrong?

edit

As per devnul's suggestion, I replaced the RMS blocks with Mean blocks and re-ran the simulation. T

This time, the output power is less than the input power, but only by half-a-watt. (Ignore the minus sign.) The efficiency is close to 100%. Very unlikely.

I did the same thing with the 200V battery.

Here, the output power is much lower than the input power.

What's going on?

• @devnull Yes, I just did that and got proper results. Could you tell me why the RMS block gave me incorrect results, please? Commented Oct 19, 2021 at 16:01
• What have you done wrong - you've used RMS on power. RMS is for using with a linear quantity like voltage, or current. It's got a square term in there to implicitly turn things into power before averaging. If you're starting with power, then you need to do a straight sum over time to get energy, or the equivalent average to get mean power. The square term corrupts the meaning of an average for power. Commented Oct 19, 2021 at 16:53
• I'd suggest running this simulation in a proper SPICE-based tool, such as LTspice. Commented Oct 19, 2021 at 17:51
• @rdtsc I usually use LTspice, but I'm trying to learn simulink, which is why I simulated it there:) Commented Oct 20, 2021 at 3:23
• In your question, you rejected the multiply and mean block because 432 was too close to 433. However, your residual resistances are so small that you can expect the efficiency to be close to 100%. Only if you model realisitic losses are you going to get 80/90% efficincies. Set all loss resistance to zero and try again, you should get 100%. If not, it means the summation instead of integration approximation is not accurate enough, step-size and integration acccuracy is always a problem in simulators. Commented Oct 20, 2021 at 7:46