Code covered by the BSD License  

Highlights from
VINPFN

VINPFN

by

 

Transient simulations of Type A, B, and C PFNs connected to resistive or inductive loads.

pfnc(t, u, R_L, L_L, L, C, R, N, R_term, L_term)
% pfnc.m - PFN C simulation
% J. Clementson 2013-04-16

function du = pfnc(t, u, R_L, L_L, L, C, R, N, R_term, L_term)

I_L = 0;
for k = 1: N
    I_L = I_L -C(k)*u(2*k);
end

D = 0;
for k = 1: N
    D = D + 1/L(k)*(u(2*k-1) - u(1));
end

H = 0;
for k = 1: N
    H = H + 1/L(k);
end

Q = 0;
for k = 2: N
    Q = Q - R(1)/L(k)*C(1)*u(2) + R(k)/L(k)*C(k)*u(2*k);
end

for i = 1: N
    du(2*i-1) = u(2*i);
    du(2*i) = (u(1) - u(2*i-1))/L(i)/C(i) + R(1)/L(i)/C(i)*C(1)*u(2) ...
        - R(i)/L(i)/C(i)*C(i)*u(2*i) + (-u(1) + (L_term + L_L)*D + ...
        (R_term + R_L)*I_L - R(1)*C(1)*u(2) + (L_term + L_L)*Q)/L(i)/C(i)/(1 + (L_term + L_L)*H);
end

du = du';

Contact us