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.

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

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

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

du = zeros(1, 2*N);
for i = 1: N
    du(2*i-1) = u(2*i);
    if i == 1
        du(2) = (S - u(1))/(L(1)+L_term+L_L)/C(1) - (R(1)+R_term+R_L)/(L(1)+L_term+L_L)*u(2);
    end
    if i >= 2
        du(2*i) = - u(2*i-1)/L(i)/C(i) - R(i)*C(1)/L(i)/C(i)*u(2) - R(i)/L(i)*u(2*i) ...
            - C(1)/C(i)*(1/(L(1)+L_term+L_L)/C(1)*(S - u(1)) - (R(1)+R_term+R_L)/(L(1)+L_term+L_L)*u(2));
    end
end

du = du';

Contact us