Professional Documents
Culture Documents
subplot(2,2,1)
plot(I,V,'-')
grid
ylabel('V rms in V')
xlabel('I rms in A')
axis square
title('Open circuit curve in rms')
subplot(2,2,2)
plot(i,psi,'-')
ylabel('psi in V')
xlabel('i in A')
axis square
title('Instantaneous flux versus current')
subplot(2,2,3)
plot(yin(:,1),yout(:,2),'-');
ylabel('Current error in rms amps')
xlabel('time in sec')
axis square
axis([-inf inf -0.1 0.1]);
title('Error from rms value curve')
subplot(2,2,4)
plot(yin(:,1),yout(:,1),'-');
ylabel('Current error in rms amps')
xlabel('time in sec')
axis square
axis([-inf inf -0.1 0.1]);
title('Error from instantaneous value curve')
/////////////////
Mginit
clear all
we = 377; % excitation frequency
% Enter Vrms and Irms of open-circuit curve
V = [ 0.00 7.40 20.50 37.30 47.31 57.12 68.85 72.80 81.19 87.82 95.46
100.7 107.04 112.37 116.04 119.75 121.92 125.61 127.92 130.25 132.53
134.85 136.1 137.5 ];
I = [ 0 0.0112 0.0310 0.0585 0.0740 0.0895 0.1084 0.1153 0.1308 0.1437
0.1583 0.1686 0.1841 0.2004 0.2142 0.2331 0.2477 0.2753 0.2933 0.3131
0.3381 0.3639 0.3828 0.4000];
psi = sqrt(2).*V; % peak psi array
npts = length(V);
K(1) = I(2)*sqrt(2)/psi(2);
i(1) = 0.;
theta(1) = 0;
for k = 2:1:npts
for j = 2:k
theta(j) = asin(psi(j)/psi(k));
theta(j-1) = asin(psi(j-1)/psi(k));
t(j) = theta(j) - theta(j-1);
s(j) = (sin(2*theta(j)) - sin(2*theta(j-1)))/2;
g(j) = cos(theta(j)) - cos(theta(j-1));
d(j) = t(j)*i(j-1)^2;
B(j) = -2*i(j-1)*(psi(k)*g(j) + psi(j-1)*t(j));
A(j) = (psi(k)^2)*(t(j) - s(j))/2 + 2*psi(k)*psi(j-1)*g(j) + psi(j-
1)^2*t(j);
end;
C(k) = d(k) - pi*I(k)^2/2;
for j = 1:(k-1);
C(k) = C(k) + K(j)^2*A(j) + K(j)*B(j) + d(j);
end;
K(k) = (- B(k) + sqrt(B(k)^2 - 4*A(k)*C(k)))/(2*A(k));
i(k) = 0;
for j = 2:k;
i(k) = i(k) + K(j)*(psi(j) - psi(j-1));
end;
end;
/////////////////////