• Welcome to the new Internet Infidels Discussion Board, formerly Talk Freethought.

Complex Variables and Linear Systems

steve_bank

Diabetic retinopathy and poor eyesight. Typos ...
Joined
Nov 9, 2017
Messages
13,722
Location
seattle
Basic Beliefs
secular-skeptic
A linear system is comprised of linear differential equations which can be solved using algebraic manipulation and linear algebra. Non linear systems require iterative techniques for solution.


Complex variable and the S LaPlacea domain is a major part of Linear Systems.

One use is solving differential equations.

The differential equation for a series resisisor capacitor circuit is
Vout(t) = i(t)* R] + [ i*dt/C+Vc].

Where the equation for a capacitor is i = C*dv/dt.

The impedance equation is where f is frequwncy
(1/ (2*pi*f*C))/(R + 1/(2p*f*C) = 1/(2*pi*f*R*C +1)

The complex frequency variable is S = 0 + if. Capacitive impedance is -i, inductive impedance is +i, hence the square root of a negative number can appear requiring complex numbers.

Substituting S for 2*pi*f in the impedance equation the S domain equation for an RC circuit is

1/(SRC + 1)

A single pole fepresents a 1st order dufferntial equation. RC is the time constant for the exponetial transient part of the solution. It is called tau. Excite a first order system with a sine and the output amplitude change will have an expoential envelope. 1- e^(-t/tau). The time constant can be electrical or mechanical, lie the time response of a shock absorber. The solution of the differntial equation in the time domain is found by taking the inverse LaPlace Transform.

Time and frequency are linked. The 3db or 50% bandwidth in hertz of a sinle pole or zero is f = 1/2*pi*tau.

For the mathematicly inclined.
https://www.math.arizona.edu/~brio/NLAPUNR.pdf
MIT video
https://ocw.mit.edu/courses/mathema...ce-transform-basics/laplace-transform-basics/

Finding the iverse LaPlace trasform by hand is commonly none by doing a partial fraction expansion of the function in S from tables of transforms and using transform tables for each term.
partil fractions. Symbolic tools like Mathcad will take a function in S and give the partial fraction expansion.
https://lpsa.swarthmore.edu/LaplaceXform/InvLaplace/InvLaplaceXformPFE.html

All linear functions can be expressed as (Sz1+1)*(Sz2+1).../(Sp1+1)*(Sp2+1).. a ratio of poynomials in S. The numerator is called zeros, it can evaluate to zero. The denominator has poles. A pale can not evaluate to zero.

Anytime you see 2*p in dynamic systems sines and cosies are likely to be involved meaning a Fourier series. Poles and zeros represent different sines at different frequencies and phase shifts. It is linked to the Fourier series as a decomposition of a real signal. I believee Fourier used the series a s a solution to diffeqs

There is an existence theorem that says the area under the impukse response curve must be finite. This is a statemnt of the Laws Of Thermodynamics, inject energy into a system and eventually it has to run down. An oscillator can be modeled as a function in S that will oscillate forever, mathematical but can never be built.

A single pole low pass function is called a lag or delay, it functions as an integrator. Put a sine into a low pass function as frewuncy goes up you get the integral of the sine. A high pass function is a lead or differentiator. The derivative of the input. Analog control systems use PID, proportional, integral,derivative. This was the basis of the old analog computers.

Convolution in the time domain is multiplication in the frequency domain. Multiplying functions in S is convolution.

A low pass function is 1/(Stau1+1); A high pass is (Stau2+1)/1 (S*tau2)/(Stau2) +1).


Multiplying the two n the frequenct doman is a band pass function. [ 1/(Stau1+1)] *
[(S*tau2)/(Stau2)+1)]

The time domin solution is found by the inverse transform.

The LaPlce transfom of a unit step function is (e^(-1*S(i)))/S(i)). To find the time doman step function response convolve the step function with the function in S and take the inverse trasform.

(e^(-1*S(i)))/S(i))*(1/(Stau1+1))

1st order and 2nd order systems are common.

For your computing enjoyment C++ has complex variables. The way it is implemetd i must be attached to a number like 1i instead of just i.

#include<complex>
typedef complex<double> compvar;

void main(void)
{
int j;
const int N = 10000;
double imagfreq,tau1,tau2,f1,f2,k;
compvar y,S;
double* mag = new double[N];
double* phase = new double[N];
f1 = 400;
f2 = 500;
tau1 = 1. / (_PI2 * f1);
tau2 = 1. /( _PI2 * f2);
cout << tau1 << setw(10) << tau2 << "\n";
k = 1;
ofstream out_file;
out_file.open("data.txt");
out_file << N << "\n";
for(j = 0; j< N; j++){
imagfreq = k * 10.;//frequency Hz 1,2,3...
k = k +.1;
S = (0. + imagfreq*1i)*_PI2;//complex frequency
//y = (S*tau1)/( ((S * tau1) +1.) * ((S * tau2) + 1.) );//band pass
y = (S*tau1) / ((S * tau1) + 1.);//high pass
//y = 1. / ((S * tau1) + 1.);//low pass
mag[j] = 10 * log(abs(y));//frequency response in decibels
phase[j] = arg(y)*(90/(_PI/2));//radians to degrees
//cout << abs(imagfreq) << setw(10) << mag[j] << setw(10) << phase[j] << "\n";
out_file << abs(imagfreq) << setw(10) << mag[j] << setw(10) << phase[j] << "\n";
}
out_file.close();
}//main()
 
Sin pulse into a 1st ordr system electrical or mechanical. Expoential response.

vin.png

vout.png
 
High, low, bandpass functions.


lpmag.png

hppmag.png

bpmag.png
 
Back
Top Bottom