# Control Systems Engineering : Response of a system to a Harmonic Input

## Homework Statement

In my notes it is stated that an integrator adds a phase lag of -Pi/2 and thus can cause instability. I want to understand what this really means and am deviating from the notes somewhat so do not know if I am barking up the wrong tree.

## Homework Equations

Given a system with a transfer function G(s) input U(s), the output X(s)=G(s)U(s)

## The Attempt at a Solution

To understand this I have been investigating the general response of a system to a harmonic input. I performed calculations based on G(s) = 1/s. I first chose a cosine input u(t) = cos(wt) and then repeated the calculations with a second input u(t) = sin(wt) and looked at the steady state response.

For the cosine input, the output at steady state was a cosine output with altered magnitude and phase, giving me the phase lag of 90 I was looking for. From thinking about it, I understand that if the feedback path to a summation for an error is 180 out of phase, it will effectively switch the sign of the summation and therefor create a runaway condition, so adding phase lags of -90 could be dangerous ... if that makes sense!?

However, for the sine input, the output at steady state was a sine output with altered magnitude and phase, again giving me the phase lag of 90 I was looking for except this time there was an added omega, which I interpret as a dc offset, which contradicts something later in my notes.

I have been through it many times, and keep getting the DC offset, is this correct?

With both of these, I came to the general conclusion that for any given G(s) the steady state response to a harmonic input will be a waveform of equal frequency yet altered magnitude and phase + sX(s) evaluated at s=0. Is this also correct or do I need to look into more inputs?

Thanks!

rude man
Homework Helper
Gold Member
Whether you use sin(ωt) or cos(ωt) makes no difference. Your system has no conception of phase except the phase difference between the input and feedback voltages.

I don't understand your whole point about harmonics anyway. Your system input is sin(ωt) so how is it supposed to know if tjat input is a harmonic or not? It would not know nor care.

And as for that dc offset - my goodness! No idea how you got that. Show me your block diagram with input.

Sorry, when I said harmonic I meant simply an oscillating input.

My system is a simple one, no feedback.

X(s) = G(s)U(s)

where X(s) is the output, G(s) is the system transfer function and U(s) is the input. The block diagram would be

U(s)------>[G(s)]-------->X(s)

input ----->[system]----->output

when I have G(s) = 1/s, u(t) = cos(wt) i get the result x(t) = (1/w)cos(wt-Pi/2)

The output is at the same frequency as the input, but altered in magnitude and phase.

when I have G(s) = 1/s, u(t) = sin(wt) i get the result x(t) = (1/w) + (1/w)sin(wt-Pi/2)

The output is at the same frequency as the input, but altered in magnitude and phase however I have a DC component of 1/w. I would be fine with my result, I got the phase shift I was looking for and it seems logical, all except for the DC offset of 1/w.

rude man
Homework Helper
Gold Member
Sorry, when I said harmonic I meant simply an oscillating input.

My system is a simple one, no feedback.

X(s) = G(s)U(s)

where X(s) is the output, G(s) is the system transfer function and U(s) is the input. The block diagram would be

U(s)------>[G(s)]-------->X(s)

input ----->[system]----->output

when I have G(s) = 1/s, u(t) = cos(wt) i get the result x(t) = (1/w)cos(wt-Pi/2)

The output is at the same frequency as the input, but altered in magnitude and phase.

when I have G(s) = 1/s, u(t) = sin(wt) i get the result x(t) = (1/w) + (1/w)sin(wt-Pi/2)

The output is at the same frequency as the input, but altered in magnitude and phase however I have a DC component of 1/w. I would be fine with my result, I got the phase shift I was looking for and it seems logical, all except for the DC offset of 1/w.

Show me your detailed steps for the sine input.

u(t) = sin(ωt) transforms to U(s) = $\frac{ω}{s^{2}+ω^{2}}$ = $\frac{1}{2j}$[$\frac{1}{s-jω}$-$\frac{1}{s+jω}$] = $\frac{ω}{(s+jω)(s-jω)}$

G(s) = $\frac{1}{s}$

X(s) = G(s)U(s) = $\frac{s}{s}$$\frac{ω}{(s+jω)(s-jω)}$

From partial fractions

X(s) = A$\frac{1}{s}$+B$\frac{1}{s-jω}$+C$\frac{1}{s+jω}$

A = sX(s)|$_{s=0}$ = $\frac{s}{s}$$\frac{ω}{(s+jω)(s-jω)}$|$_{s=0}$ =1/ω

This is where I how I get the extra term. The B and C evaluates to the sin of altered magnitude and phase.

Last edited:
rude man
Homework Helper
Gold Member
What you did was right, and the output x(t) = (1/ω)[1 - cos(ωt)] after you join the two complex-conjugate terms into one real term.

Notice that at t = 0, x(t) = 0, also as required.

In the time domain, ∫0tsin(ωt')dt' = (-1/ω)cos(ωt) |0t = (1/ω)[1 - cos(ωt)] which double-checks your Laplace solution.

BTW you wrote X(s) wrong at the third line.

Amazing, thankyou. I see I should have put 1/s on the third line.

Is there anyway you could explain intuitively where that extra component of (1/ω) comes from? My math is bad, but I get the answer, i just don't get it!

I suppose I am trying to think of the system physically adding up the signal rather than the maths, I just cant see why integrating (literally adding the input up over time) gives a dc component, why doesn't it just cancel out?

Thanks again.

rude man
Homework Helper
Gold Member
Over time it does cancel out. The 1/w term divided by a long time means the average integrator output approaches zero.

Think of what happens after 1/2 cycle of the input. That's got a dc component, right? So at the end of 1/2 cycle of input the output is (1/w)[1 - cos(π)] = 2/w. At the end of an entire input cycle the dc input = 0 and the integrator output = (1/w)[1 - cos(2π)] = 0 also. Similarly, at the end of every half cycle the input is finite, and at the end of every full input cycle the output is zero. Just as you should expect.

but surely, for example ω=1 for the input u(t) = sin(ωt)

x(t) = (1/ω)(1-cos(wt)) = 1/ω - cos(wt) = 1 - cos(t)

That is a cosine not oscillating around zero like the input, but around 1. Shifted up. It will oscillate around 1 for all t. If say ω = 0.1, x(t) = 10 - cos(t), that results in cosine oscillating around 10 for all t.

I see that for higher frequencies 1/ω will tend to zero but at low frequencies it still has a significant shift up.

Why is this, or am I wrong!?

rude man
Homework Helper
Gold Member
What you say is OK. I don't see a contradiction. Yes there is an offset of 1 but the output is nevertheless zero after any integer multiple cycles of input.

When you use the Laplace transform of sin(wt) or cos(wt) this gives the transient as well as the steady-state solution. Usually we are interested in the steady-state transfer function only. In other words, we don't care where t = 0 is. With phasors there is no distinction between sin and cos inputs. When dealing with phasor sinusoids (sin or cos) the input phase is by default = 0. This is like calling one node "ground"or zero volts in a circuit. Then the transfer function becomes Vout = Vin/s|s=jw = Vin/jw and that indicates a -π/2 phase shift between input and output. It's unusual to use the Laplace transforms for sin or cos unless you really are interested in the transient as well as steady-state solution.

PS actually phasors would be V/√2).

Last edited:
rude man
Homework Helper
Gold Member
but surely, for example ω=1 for the input u(t) = sin(ωt)

x(t) = (1/ω)(1-cos(wt)) = 1/ω - cos(wt) = 1 - cos(t)
It would be 1/w - (1/w)cos(t)

That is a cosine not oscillating around zero like the input, but around 1. Shifted up. It will oscillate around 1 for all t. If say ω = 0.1, x(t) = 10 - 10cos(t), that results in cosine oscillating around 10 for all t.
Why is this, or am I wrong!?

see above in red. Yes, the output would vary between 0 and 20 for all t.

Last edited: