6
\$\begingroup\$

I have no idea where I went wrong with this homework question:

The waveform:

enter image description here

I deduced the function as:

$$ y=\begin{cases} 1000t & t\in [ 0,0.002]\\ -1000t+4 & t\in [ 0.002,0.006]\\ 1000t-8 & t\in [ 0.006,0.008] \end{cases} $$

Squaring both sides yields:

$$ \displaystyle y^{2} =\begin{cases} 1,000,000t^{2} & t\in [ 0,0.002]\\ 1,000,000t^{2} -8000t+16 & t\in [ 0.002,0.006]\\ 1,000,000t^{2} +16000t+64 & t\in [ 0.006,0.008] \end{cases} $$

Then I just let Matlab compute for me using the following code:

clearvars;

syms t;

y1=(1000*t)^2;
y2=expand((-1000*t+4)^2);
y3=expand((1000*t+8)^2);

y=int(y1,0,0.002)+int(y2,0.002,0.006)+int(y3,0.006,0.008)

sqrt(y/0.008)

The above code gives me an answer of \$\displaystyle \frac{2\sqrt{3}\sqrt{43}}{3} =7.57\$, which is obviously wrong since the peak current is only 2 amperes.

I have no idea where I went wrong in my steps.

\$\endgroup\$
10
  • \$\begingroup\$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. \$\endgroup\$ Commented Feb 14 at 5:13
  • \$\begingroup\$ You need to divide by the period before taking the square root. That’s how you get the “mean” part of RMS. \$\endgroup\$ Commented Feb 14 at 5:28
  • \$\begingroup\$ @Ste Kulov I did that, look that y/0.008 in sqrt() \$\endgroup\$ Commented Feb 14 at 6:09
  • \$\begingroup\$ OW1TY2, Do you already know the correct answer? (I think it is maybe 1 1/3 A.) \$\endgroup\$ Commented Feb 14 at 6:09
  • 5
    \$\begingroup\$ Most of the answers show you a different (simpler) route to the answer. The actual error in your matlab is a sign error in your definition of y3. It should be y3=expand((1000*t-8)^2); that is _-_8, not +8 \$\endgroup\$ Commented Feb 14 at 13:22

4 Answers 4

7
\$\begingroup\$

The whole idea behind RMS voltage or current has to do with the equivalent DC level that would yield the same power into a load. So it's about the topic of power.

$$\begin{align*} \overline{P}&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}P_t\:\text{d}t \end{align*}$$

If you are examining only one of either current or voltage, you are seeing only one facet. But that doesn't prevent working out the idea:

$$\begin{align*} \overline{P}&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}P_t\:\text{d}t&\overline{P}&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}P_t\:\text{d}t \\\\ &=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}V_t\,I_t\:\text{d}t &&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}V_t\,I_t\:\text{d}t \\\\ &=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}V_t\,\left[\frac{V_t}{R}\right]\:\text{d}t &&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}\left[R\,I_t\right]\,I_t\:\text{d}t \\\\ &=\frac{1}{t_1-t_0}\frac1{R}\int_{t=t_0}^{t_1}V_t^2\:\text{d}t &&=\frac1{t_1-t_0}R\int_{t=t_0}^{t_1}I_t^2\:\text{d}t \\\\ R\cdot\overline{P}&=\frac{1}{t_1-t_0}\int_{t=t_0}^{t_1}V_t^2\:\text{d}t &\frac{\overline{P}}{R}&=\frac1{t_1-t_0}\int_{t=t_0}^{t_1}I_t^2\:\text{d}t \\\\ \sqrt{R\cdot\overline{P}}&=\sqrt{\frac{1}{t_1-t_0}\int_{t=t_0}^{t_1}V_t^2\:\text{d}t} &\sqrt{\frac{\overline{P}}{R}}&=\sqrt{\frac1{t_1-t_0}\int_{t=t_0}^{t_1}I_t^2\:\text{d}t} \\\\ V_{_\text{RMS}}&=\sqrt{\frac{1}{t_1-t_0}\int_{t=t_0}^{t_1}V_t^2\:\text{d}t} &I_{_\text{RMS}}&=\sqrt{\frac1{t_1-t_0}\int_{t=t_0}^{t_1}I_t^2\:\text{d}t} \end{align*}$$

That is the reasoning behind the term root-mean-square and why current and/or voltage is squared in the process of finding this mean DC-equivalent value from varying voltages and/or currents.

In your case, you have the following problem (forgive the childish crayons):

enter image description here

The yellowish region is replicated as the other three greenish areas. So you only need to analyze the yellowish region to get a final answer since the rest are symmetric and won't change the result.

In the first quarter portion, you know that \$I_t=1000\:t\$. So the RMS equation is:

$$\begin{align*} I_{_\text{RMS}}&=\sqrt{\frac1{2\:\text{ms}-0\:\text{ms}}\int_{0}^{2\:\text{ms}}\left(1000\,t\right)^2\:\text{d}t} \\\\ &=\sqrt{\frac{1000^2}{2\:\text{ms}}\int_{0}^{2\:\text{ms}}t^2\:\text{d}t} \\\\ &=\sqrt{\frac{1000^2}{2\:\text{ms}}\left[\frac13t^3\right]\left.\vphantom{\frac13t^3}\right|_{0\:\text{ms}}^{2\:\text{ms}}} \\\\ &=\sqrt{\frac43} \\\\ &=\frac2{\sqrt{3}} \end{align*}$$

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You correctly put units into a non-trivial formula and manipulated it - yay, this is rare! Most people are lazy and calculate with pure numbers, then at the end slap on what they assume are the correct units. \$\endgroup\$ Commented Feb 15 at 8:06
  • 1
    \$\begingroup\$ @Nayuki Dimensional analysis is not only important for sanity-checking results, it can help a lot when trying to work out how to make small scale test models that can be used to simulate reality, but on a small scale. For example, testing waves and cresting and speed limits of a sail boat in water, but within a wind tunnel and using a different liquid for "water". (This affects things like the viscosity required for the test liquid on a small scale, for example.) It can also help in figuring out what parameters/factors are needed in solving problems. Powerful stuff! \$\endgroup\$ Commented Feb 15 at 8:15
3
\$\begingroup\$

In Octave/Matlab you can compute the square root of the integral of the triangular function squared divided by the interval of the integral. This is what RMS means. A simple approximation (for large n) is:

n=10000000 (n=1000000 gives the same result)

 sqrt(sum([bartlett(n)(1:(n-1));-bartlett(n)].^2)/(2*n-1))

This works out to 0.5774 implying that for a peak value of 1.0, the RMS value is 0.5774. For your problem, the peak voltage is 2 (rather than 1) so just calculate 2 * 0.5774 => 1.1547

The logic is to take the triangular function which is

 [bartlett(n)(1:(n-1));-bartlett(n)]

square it

  [bartlett(n)(1:(n-1));-bartlett(n)].^2

Take the sum of all the elements (a crude "discrete" integration)

 sum([bartlett(n)(1:(n-1));-bartlett(n)].^2)

Obtain the mean by dividing by the range of elements, i.e., the interval of the integration

 sum([bartlett(n)(1:(n-1));-bartlett(n)].^2)/(2*n-1)

And then take the square root.

You can graph the function

  plot([bartlett(n)(1:(n-1));-bartlett(n)])

to verify that this is the triangular function you want.

You can try this for a sine tone wave too:

  n=100000

  sqrt(sum(sin((1:.001:n)/pi).^2)/(n/.001))

Again, the peak voltage is 1, but in this case the RMS is .7071, exactly the known correct value which, for a sine wave, is Peak_Voltage (or 1/2 peak-to-peak voltage) / sqrt(2)

The standard way would be to use the calculus to calculate the integral over a specified interval. For simple functions like the above, this is quite easy, and the methods and results can be found in any calculus text.

\$\endgroup\$
1
  • \$\begingroup\$ For greater accuracy use the trapazoid method of integration: x=0:.0001: pi; sqrt(trapz(x, sin(x).^2) / (pi)) This gives more accuracy with fewer points. You can do the same for the triangular signal as well. \$\endgroup\$ Commented Feb 14 at 7:38
3
\$\begingroup\$

To do this analytically, note that the RMS value will be the same for each 2ms segment (since the sign does not matter once you square it, and it doesn’t matter whether time runs forward or backward, nor does the time scale matter.

So take the first segment and scale the time to 1. V(t)= 2t, and \$V^2(t) = 4t^2\$. Take the definite integral of that and we have \$\frac{4}{3}t^3\$ evaluated at 1 and 0.

Take the square root of that and you have \$\frac{2}{\sqrt{3}}\$.

\$\endgroup\$
1
\$\begingroup\$

Over a full cycle, the square of the negative and positive halves will be identical. Also, each quarter cycle of \$y^2\$ is symmetrical about the vertical axis, so the mean of the square of all quarter-cycles will yield the same value. This means you only need to consider a single quarter-cycle; RMS over a full cycle will be the same, since the other three share the same mean-square.

You could disregard period \$T\$, since RMS of a periodic function is independent of frequency/period, which would probably simplify the algebra somewhat, but I'll do it here accounting for time and period. Other answers here did it in other ways, but a different approach arriving at the same conclusion is always instructive.

Start by a defining \$y\$ as a function of period \$T\$ and time \$t\$, for the first quarter cycle:

$$ \begin{aligned} T &= 8\times 10^{-3} \\ \\ y &= 2\frac{4t}{T} \\ \\ &= \frac{8t}{T} \\ \\ \end{aligned} $$

RMS is "square root of the mean of the square". First we square the function:

$$ \begin{aligned} y^2 &= \left({\frac{8t}{T}}\right)^2 \\ \\ &= \frac{64t^2}{T^2} \\ \\ \end{aligned} $$

Then we take its mean \$p\$:

$$ \begin{aligned} p &= \frac{1}{T/4}\int_{t=0}^\frac{T}{4}{y^2\cdot dt} \\ \\ &= \frac{4}{T}\int_{t=0}^\frac{T}{4}{{\frac{64t^2}{T^2}}\cdot dt} \\ \\ &= \frac{256}{T^3}\int_{t=0}^\frac{T}{4}{t^2\cdot dt} \\ \\ &= \frac{256}{T^3}\left[\vphantom{\frac{1}{1}} \frac{t^3}{3} \right]_{t=0}^\frac{T}{4} \\ \\ &= \frac{256}{3T^3}\left[\vphantom{\frac{1}{1}} t^3 \right]_{t=0}^\frac{T}{4} \\ \\ &= \frac{256}{3T^3}\left[\left( \frac{T}{4}\right)^3 - 0^3 \right]_{t=0}^\frac{T}{4} \\ \\ &= \frac{256}{3T^3} \cdot \frac{T^3}{64} \\ \\ &= \frac{4}{3} \\ \\ \end{aligned} $$

Finally, the square-root, to reveal RMS value \$r\$:

$$ \begin{aligned} r &= \sqrt p \\ \\ &= \sqrt{\frac{4}{3}} \\ \\ &= \frac{2}{\sqrt 3} \end{aligned} $$

This agrees with the general formula for RMS value \$r\$ of a triangular waveform with amplitude \$A\$, and with zero mean; that is, centered on \$y=0\$, and extending to \$\pm A\$:

$$ r = \frac{A}{\sqrt 3} $$

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.