fun = function(f,Cs,Cp,L,R)
{
var Vs = new Phasor(5,0);
var Le = 470*n;
var Ce = 122*p;
var Zle = new Phasor(2*8,2*ZL(Le,f));
var Zce = new Phasor(0,-ZC(Ce,f));
var Zcs = new Phasor(0,-2*ZC(Cs,f));
var Zcp = new Phasor(0,-ZC(Cp,f));
var Zl = new Phasor(R,ZL(L,f));
var a1 = Zle.add(Zce);
var b1 = Zle;
var c1 = Zle;
var a2 = Zle;
var b2 = Zle.add(Zcs).add(Zcp);
var c2 = Zle.add(Zcs);
var a3 = Zle;
var b3 = Zle.add(Zcs);
var c3 = Zle.add(Zcs).add(Zl);
var res = solve_phasor_system3(a1,b1,c1,Vs, a2,b2,c2,Vs, a3,b3,c3,Vs);
var Ice = res[0];
var Icp = res[1];
var Il = res[2];
var Is = Ice.add(Icp).add(Il);
return [Il.mag()*L*1/(500*n), Is.mag(),(Is.mag()**2)*Zle.re];
}
capa = function()
{
set_range("rangeFreq",10,14,0.1,1);
set_range("rangeL",100,3000,1,2);
set_range("rangeCs",10,500,1,3);
set_range("rangeR",0.05,3,0.01,4);
f1 = x => fun(rangeFreq*M,rangeCs*p,x,rangeL*n,rangeR)[0];
f2 = x => fun(rangeFreq*M,rangeCs*p,x,rangeL*n,rangeR)[1];
f3 = x => fun(rangeFreq*M,rangeCs*p,x,rangeL*n,rangeR)[2];
xmin = 20*p;
xmax = 800*p;
ymin = -0.5;
ymax = 1.5;
markersY = [];
markersX = [];
grad_auto();
plots();
}
freq = function()
{
set_range("rangeCp",10,1000,0.1,1);
set_range("rangeL",100,3000,1,2);
set_range("rangeCs",10,500,1,3);
set_range("rangeR",0.05,3,0.01,4);
f1 = x => fun(x,rangeCs*p,rangeCp*p,rangeL*n,rangeR)[0];
f2 = x => fun(x,rangeCs*p,rangeCp*p,rangeL*n,rangeR)[1];
f3 = x => fun(x,rangeCs*p,rangeCp*p,rangeL*n,rangeR)[2];
xmin = (13-5)*M;
xmax = (13+5)*M;
ymin = -0.5;
ymax = 1.5;
markersY = [13*M,12*M,14*M];
grad_auto();
plots();
}
induct = function()
{
set_range("rangeFreq",10,14,0.1,1);
set_range("rangeCp",10,1000,1,2);
set_range("rangeCs",10,500,1,3);
set_range("rangeR",0.05,3,0.01,4);
f1 = x => fun(rangeFreq*M,rangeCs*p,rangeCp*p,x,rangeR)[0];
f2 = x => fun(rangeFreq*M,rangeCs*p,rangeCp*p,x,rangeR)[1];
f3 = x => fun(rangeFreq*M,rangeCs*p,rangeCp*p,x,rangeR)[2];
xmin = 100*n;
xmax = 2000*n;
ymin = -0.5;
ymax = 1.5;
markersY = [];
markersX = [];
grad_auto();
plots();
}
plot_grid = 1;
freq();