%% Generate 4-D Flux Linkage Matrix F
% Specify the motor parameters.

PM = 0.1;     % Permanent magnet flux
N = 6;        % Number of pole pairs
Ld = 0.0002;  % D-axis inductance
Lq = 0.0002;  % Q-axis inductance
L0 = 0.00018; % Zero-sequence inductance
Rs = 0.013;   % Stator resistance

%
% Define the phase current vectors.

iA = linspace(-250,250,5);
iB = iA;
iC = iA;

%
% Specify the rotor angle vector based on the number of pole pairs.

X = pi/180*linspace(0,360/N,180/N+1);

%
% Tabulate flux linkage partial derivatives and torque in terms of A-,B-,C-currents and rotor angle

F = ee_generateIdealPMSMfluxData(PM,Ld,Lq,L0,iA,iB,iC,X);

% The function returns a 4-D flux linkage matrix F. The matrix dimensions correspond to the three phase currents and the rotor angle
% Copyright 2018 The MathWorks, Inc.