# Checking whether the system is linear or non linear

Consider this system equation y(t)=x(t)*cos(3t). where,x(t)=input. Using the superposition theorem, we can prove that the system is linear.

For input x1(t), the output is y1(t)=x1(t)*cos(3t). For input x2(t), the output is y1(t)=x2(t)*cos(3t).

For input [x1(t)+x2(t)], the output is y(t)=[x1(t)+x2(t)]*cos(3t) That is, y(t)=y1(t)+y2(t). Hence the system is linear

But I can't get the meaning of this. y(t) is linear with respect to x(t) means when we plot a graph of y(t) v/s x(t),I should get a straight line passing through origin.

But for the above case, its not straight line.

Also ,if it is found to be linear, the system is linear for any x(t) or not? I mean if we take x(t)=t*u(t) or x(t)=t^2*u(t)...now is the system linear for both cases ??

Depending on the system equation behavior of the curve of input versus output can be of any shape.

System is said to be linear if it satisfies these two conditions:

• Superposition - if input applied is (x1+x2), then the output obtained will be y1+y2 .(equivalently we say that if x1 and x2 are applied simultaneously then out put will be the sum of the outputs obtained individually)
• Homogenity - if (k * x1) input is applied, then output obtained will be k * y1. Here k is any real number.

Reference by this site

• Thanks for this information. how does the graph y(t) v/s x(t) look like? – Ajay vishwanath Oct 5 '15 at 16:30
• Look at reference I linked. – TicTacToe Oct 5 '15 at 16:32

I don't have enough reputation to comment, so here it goes:

What do you mean by x1(t) and x2(t)?

1) If you mean you have an x function and these are different points of it, then those are different t values, say t1 and t2, then the cos(3t) is not the same, so the addition becomes x(t1) * cos(3 * t1) + x(t2) * cos(3 * t2).

2) If you mean those are two different functions, and y has a function as parameter too, then what exactly are you plotting? Also then the definition of y(t) should read like y(x)(t) or something like that...

According to my understanding, the linearity of the system is checked by fixing the time. The input signal x(t) is varied at fixed value of t (let 1 sec). Then see how the output y(t) is varying at the same value of t. If the relationship between y and x is linear (straight line) and crossing through origin then the system is linear. If you find any time t at which the system is not linear then the system is non-linear.

n=0:1:3;
x1=sin(0.2.*n);
x2=sin(0.5.*n);
y1=n.*x1;
y2=n.*x2;
a=5;
b=10;
y3=(a.*y1+b.*y2);
x3=(a.*x1+b.*x2);
y4=round(n.*x3);
y5=isequal(y3,y4);
if y5==1
disp('this is a linear function');
else
disp('this is a non linear function');
end

• Welcome to EE.SE. Please press on "edit" and improve your answer. Explain your code, the programming language you are using, and more importantly how does your code answer OP's question. – Hazem Jul 31 '18 at 9:16