kill(all)$

electrical (3) ,How to find differential equations 'rlc circuit' in general. "version 1.0",part 3
peter.vlasschaert@gmail.com,24/12/2019

load packages
---------------------

load(lrats)$

see:
===
electrical (3) ,How to find differential equations 'rlc circuit' in general. "version 1.0",part 1
electrical (3) ,How to find differential equations 'rlc circuit' in general. "version 1.0",part 2

Z1= R1,Z2=R2

TF = Z2/(Z1+Z2)  : Transfer Function.

Voltage divider
============

p1:Vout = Z2/(Z1+Z2)*Vin;

Figure 1: example  Z1= R1,Z2=R2

p1a:subst([Z1= R1,Z2=R2],p1);

How to find  TF from differential equations.
================================
TF= TF(s)  ?

 i1  =>  R
 i2  =>  C
 i    =>   L

1e)  KCL = Kirchoff Current Law (see :part 1)  
==================================
Figure 2: yellow square 'junction'

p2:i(t)=i1+i2;

p2a:i1 = Vout(t)/R;
p2b:i2 = C*diff(Vout(t),t);

p2c:lhs(p2) = subst([p2a,p2b],rhs(p2));

i => closed current  loop  

2e)  KVL = Kirchoff Voltage Law (see :part 1)  
===================================
Figure 3: closed current (=i) loop

Z1 :  inductor                              =>  voltage over = VL = L*di/dt
Z2  : resistor // condensator     =>  voltage over = Vout

a)  VL
--------

p3:VL = L*diff(i(t),t);

b)  KVL 
-----------

p3a:Vin(t) = VL + Vout(t);

c)  VL & KVL
------------------

p3b:subst([p3],p3a);

3e)  combination  (1e)  &  2e))
=======================

a) differentation i(t)
--------------------------
use : 'p2c'

p4:diff(p2c,t);

b)  substitution
---------------------
use : 'p3b'

p4a:subst([p4],p3b);

p4b:expand(p4a);

c) divide both sides: 1/(C*L)
---------------------------------------

p4c:1/(C*L)*p4b;

p4d:expand(p4c);

4e)  find   TF(s) function
===================
use : 'p4d'

a)  LT = Laplace  Transform
----------------------------------------
use : 'p4d'

p5:laplace(p4d,t,s);

b)  IC = Initial Condition  = 0  for TF
------------------------------------------------
use :'p5'

p5a:[at(diff(Vout(t),t,1),t=0) =0,Vout(0)=0];
p5b:subst(p5a,p5);

c)  solve 'p5b' for 'laplace(Vout(t),t,s)
--------------------------------------------------

p5c:solve(p5b,'laplace(Vout(t),t,s))[1];

d) divide by *laplace(Vin(t),t,s)
------------------------------------------

p5d:p5c/'laplace(Vin(t),t,s);

e) TF = TF(s)
-------------

p5e: TF(s) = rhs(p5d);

How  to find : TF(s)  ' with principal of the voltage  divider'
===========================================
see Figure 1:

a)   parallel  R//C
------------------------
see : part
1/xt  =  sum(1/xi,i,1,n) , n=2   //
Z2 = xt

x1:impedance(R)  =R  , x2:impedance (C)= 1/(s*C)

p6:Z2=(R*1/(s*C)) /(R+1/(s*C));

b)  Z1 = s*L
----------------

p6a:Z1= s*L;

find  TF(s)
========
use : 'p1'

a)  voltage divider.
--------------------------

p6b:subst([p6,p6a],p1);

b) divide by Vin on both sides.
-----------------------------------------

p6c:p6b/Vin;

c)  TF(s).
-------------

p6d: TF(s) = ratsimp(rhs(p6c));

check : 'p5e' ? 'p6d'
===============

p6e:is(rhs(p5e) = rhs(p6d));