kill(all)$

electro(chem) , measurement with bridge ' Weathstone Bridge',part 2:version 1.0
peter.vlasschaert@gmail.com,12/01/2020

load packages 
============

load(lrats)$

see :part 1  ' website :electrochemistry "
see :https://en.wikipedia.org/wiki/Electrical_impedance

1e) definition : j : sqrt(-1)
===================

j : %i;

2e) General representation 'impedance'  ( representation ideal : R,L,C components, j = % i =sqrt(-1))
===============================
 passive components :  R > 0 ?  which values θ allowed.
1e)  Z ( = impedance) = R( =resistance) +/- j*X(=reactance)
2e)  -J*X +R  ≤  Z ≤  j*X+R                             

3e)Euler equation
==============
f: frequence
t :time

p1a:θ =ω*t;

p1b:θ =2*π*f*t;

p1ca:exp(j*θ) = cos(θ)+j*sin(θ);

p1cb: subst([θ =-θ],p1ca);

How to find : cos(θ),sin(θ)
====================

a)  method.
----------------

p1d:solve([p1ca,p1cb],cos(θ));

set : cos(θ) =a,sin(θ) =b

p1d1:subst([cos(θ)=a,sin(θ)=b],[p1ca,p1cb]);

p1d2:solve(p1d1,[a,b]),expand;

p1d3:subst([a=cos(θ),b=sin(θ)],p1d2)[1];

result : cos(θ)
==========

p1d4a:p1d3[1];

p1d4a1:lhs(p1d4a)=combine(rhs(p1d4a));

result : sin(θ)
==========

p1d4b:p1d3[2];

p1d4b1:lhs(p1d4b)=combine(rhs(p1d4b));

b)  method 
---------------

p1ea:cos(θ)=exponentialize(cos(θ));

p1eb:sin(θ)=exponentialize(sin(θ)),expand;

p1eb1::lhs(p1eb)=combine(rhs(p1eb));

period : cos(θ),sin(θ) = 2*π

plot :cos(θ)
=========

constraint :  R >0

fig 1: negative values not allowed : resistance
θ :  -π ≤ θ ≤ π

wxplot2d(cos(θ),[θ,-π,π]);

p1fa:π = float(π);

fig 2: negative values not allowed : resistance (= here positiv)
θ :  -π /2≤ θ ≤ π/2

wxplot2d(cos(θ),[θ,-π/2,π/2]);

p1fb:π/2 = float(π/2);

result  :  R> 0  <=>  -π/2 ≤ θ ≤ π/2

Complex plane: +/-: see : 'above'
==========================
2e) General representation 'impedance'  ( representation ideal : R,L,C components, j = % i =sqrt(-1))
 -J*X +R  ≤  Z ≤  j*X+R      => see 'below'    

1a)   + j  = > θ = π/2

p1c1:'subst([θ=π/2],exp(j*θ)) =subst([θ=π/2],exp(j*θ));

2a)   - j  = > θ = -π/2

p1c2:'subst([θ=-π/2],exp(j*θ)) =subst([θ=-π/2],exp(j*θ));

R :real   axis (  = value)
X :imag axis (  =value)
Z = complex number ( = impedance)

example 1
--------------

Z1 =serial circuit (R,L)
=================
X => XL =ω*L

p2a:Z1 = R+j*XL;
p2a1:Z1=R+j*ω*L;

resistance :R = realpart(rhs(p2a1));

reactance:X =imagpart(rhs(p2a1));

XL=subst([ω=2*π*f],rhs(%));

rem : XL = along pos imaginary axis

example 2
--------------

Z2 =serial circuit (R,C)
=================
X => XC =ω*C

p2b:Z2 = R+1/j*XC;
p2b1:Z2=R+1/(j*ω*C);

resistance :R = realpart(rhs(p2b1));

reactance:X =imagpart(rhs(p2b1));

XC=subst([ω=2*π*f],rhs(%));

rem : XC = along neg imaginary axis

plot sin(θ)
========
range :θ  =>   -π /2≤ θ ≤ π/2,see why above :because (R>0)

wxplot2d(sin(θ),[θ,-π/2,π/2]);