Common Function Forms

 

 

·       Many of the 2D functional relationships you will observe in your engineering career will be in one of the forms described below. 

 

1. Linear Functions

 

·       The equation for a straight line is

 

 

where m is the slope (rise/run) and b is the y-intercept (y value at x=0).  Note this is a first order polynomial function. 

 

·       This is observed, for example, with Ohm’s law for a resistor (V=IR)

 

v(i)=Ri+0.

 

2. Power Function

 

·       The power function is of the form

 

 

where b and m are constants, which can be selected to produce a family of curves.

 

·       By taking the log base 10 of both side of our function we can show that

 

 

Note that in the log “space” we have the equation for a straight line.  If we plot any power function on log-log axes, guess what? It will look like a straight line!  This information is helpful when trying to figure out if some experimental data you have collected (for example) is described by a power function.  Finding the underlying mathematical function describing observed data is called “function discovery” and is addressed on pages 166-169 in the text.

 

·       An example of a power function, is power as a function of voltage for a resistor

 

 

·       Let’s see if this actually looks like straight line on log-log axes.

 

 

clear;close all;clc

 

v=linspace(0,10,1000);

R=1;

p=(v.^2)/R;

 

figure

subplot(221)

plot(v,p)

xlabel('voltage (Volts)')

ylabel('Power (Watts)');

title('1 \Omega Resistor (linear axes)');

subplot(222)

semilogy(v,p);

xlabel('voltage (Volts)')

ylabel('Power (Watts)');

title('1 \Omega Resistor (semilogy axes)');

subplot(223)

semilogx(v,p);

xlabel('voltage (Volts)')

ylabel('Power (Watts)');

title('1 \Omega Resistor (semilogx axes)');

subplot(224)

loglog(v,p)

xlabel('voltage (Volts)')

ylabel('Power (Watts)');

title('1 \Omega Resistor (loglog)');

 

 

·       Light intensity is inversely proportional to distance squared from the source

 

 

·       Let’s visualize this relationship using several axes types.

 

clear;close all;clc

 

d=linspace(1,10,100);

i=d.^(-2);

 

figure

subplot(221)

plot(d,i);

axis([1,10,0,1]);

xlabel('distance');

ylabel('light intensity')

title('Intensity vs. Distance (linear axes)');

subplot(222)

semilogy(d,i)

axis([1,10,0,1]);

xlabel('distance');

ylabel('light intensity')

title('Intensity vs. Distance (semilogy axes)');

subplot(223)

semilogx(d,i)

axis([1,10,0,1]);

xlabel('distance');

ylabel('light intensity')

title('Intensity vs. Distance (semilogx axes)');

subplot(224)

loglog(d,i)

axis([1,10,0,1]);

xlabel('distance');

ylabel('light intensity')

title('Intensity vs. Distance (loglog axes)');

 

 

 

3. Exponential Functions

 

·       The number e=2.7183… is one of those interesting numbers (like =3.14159…).  The number e can only be expressed as an infinite series

·       An exponential function is of the form

 

 

·       This function is special because it is essentially its own derivative and integral.  Thus, it often shows up as the solution to equations involving derivatives (differential equations).  Differential equations describe most interesting systems such as a pendulum, a mass on a spring, a circuit containing capacitors and inductors, etc…

 

·       Exponential functions describe thing like population growth, cooling of an object, the voltage on a charged capacitor being transferred to a load etc…

 

·       Let’s plot an exponential and see what it looks like…

 

clear;close all;clc

 

figure

a=-5;

b=1;

t=linspace(0,2,1000);

y=b*exp(a*t);

plot(t,y)

xlabel('t');

ylabel('y(t)');

 

·       Look at what happens when we plot this exponential on semilogy axes…

 

clear;close all;clc

 

figure

a=-5;

b=1;

t=linspace(0,2,1000);

y=b*exp(a*t);

subplot(121)

plot(t,y,'b-')

xlabel('t');

ylabel('y(t)');

title('y(t)=e^{-5t} (linear axes)');

subplot(122)

semilogy(t,y,'b-')

xlabel('t');

ylabel('y(t)');

title('y(t)=e^{-5t} (semilogy axes)');