Page 1 of 1

HW2 Reproduce the m.file code given in slide 14 to simulate the flux rotation in four pole machine both in clockwise and

Posted: Fri Apr 29, 2022 8:52 am
by answerhappygod
Hw2 Reproduce The M File Code Given In Slide 14 To Simulate The Flux Rotation In Four Pole Machine Both In Clockwise And 1
Hw2 Reproduce The M File Code Given In Slide 14 To Simulate The Flux Rotation In Four Pole Machine Both In Clockwise And 1 (38.04 KiB) Viewed 28 times
Hw2 Reproduce The M File Code Given In Slide 14 To Simulate The Flux Rotation In Four Pole Machine Both In Clockwise And 2
Hw2 Reproduce The M File Code Given In Slide 14 To Simulate The Flux Rotation In Four Pole Machine Both In Clockwise And 2 (38.59 KiB) Viewed 28 times
HW2 Reproduce the m.file code given in slide 14 to simulate the flux rotation in four pole machine both in clockwise and counter clockwise direction.
% M-file, mag. field.m % M-file to calculate the net magnetic field produced % by a three-phase stator. % Set up the basic conditions bmax=1; % Normalize bmax to 1 freq=60;%60 Hz w=2*pi * freq; % angular velocity (rad/s) % First, generate the three component magnetic fields t=0:1/60000:1/60; Baa = sin(w*t). *(cos(0)+ 1i*sin (0)); Bbb = sin (w*t-2*pi/3) * (cos (2*pi/3) + 1i*sin (2*pi/3)); Bcc = sin(w*t +2*pi/3)* (cos(- 2*pi/3) + li*sin (-2*pi/3)); %Calculate Enet Bnet = Baa+Bbb + Bcc; %; Calculate a circle representing the expected maximum % value of Enet circle = 1.5*(cos(w*t) + 1i* sin (w*t)); %Plot the magnitude and direction of the resulting magnetic %fields. Note that Baa is black, Bbb is blue, Boc is %magenta, and Enet is red. for i=1: length(t) %Plot the reference circle plot(circle, 'k'); hold on; %Plot the four magnetic fields plot([0 real(Baa(w))],[O imag(Baa(10), 'K', 'LineWidth'.2); plot([O real(Bbb()],[O imag(Bbb[n)], 'b', 'LineWidth',2); plot([Oreal (Bcc()). [O imag(cc)], 'm', 'LineWidth 2); plot([Oreal(Bnet(ii)], [O imag(Bnet (ii)] ,' r', 'LineWidth'3); axis square; axis([-22-22]); drawnow hold off ; end