diff --git a/FraCTune-1.0/Case2-EnergyHarvester/.DS_Store b/FraCTune-1.0/Case2-EnergyHarvester/.DS_Store new file mode 100644 index 0000000..75c4407 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/.DS_Store differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Basinofattraction.m b/FraCTune-1.0/Case2-EnergyHarvester/Basinofattraction.m new file mode 100644 index 0000000..b17e87e --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Basinofattraction.m @@ -0,0 +1,82 @@ +clc; clear; close all; + +disp(' ------------------- ') +disp(' Basinofattraction.m ') +disp(' ------------------- ') + +% system parameters +global k lambda1 lambda2 lambda3 OrderD time lambda +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +% xdisp0 = 1.0; +% dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime = 0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% Load optimized controller parameters + load('Results_GA_SMC.mat','Xopt') +% load('Results_CE_SMC.mat','Xopt') +% load('Results_GA_FOSMC.mat','Xopt') +% load('Results_CE_FOSMC.mat','Xopt') +k = Xopt(1); +lambda1 = Xopt(2); +lambda2 = Xopt(3); +lambda3 = Xopt(4); +OrderD = Xopt(5); + +% Initial velocity (xdisp) and position (dxdisp) of EH +% Define ranges of velocity (m/s) and position (m) +xdisp_range = 0.8:0.01:1.2; +dxdisp_range = -12:0.1:12; + +% Initialize arrays to store valid initial conditions +valid_xdisp0 = []; +valid_dxdisp0 = []; + +% Run simulations over the grid of initial conditions +for xdisp0 = xdisp_range + for dxdisp0 = dxdisp_range + +% Run the simulation + sim('SMCControllerEHc.slx'); + % sim('FOSMCControllerEH.slx'); + + % Check final value of control signal + % time interval of analysis + T = time(end)-time(1); + % output power + power = lambda.*(v.^2); + % mean output power + power_mean_final = (1/T)*trapz(time,power); + u_final = max(abs(u)); + + % If power_mean_final is greater than 1% power_mean_final, store the initial conditions + if u_final < 5 %&& power_mean_final > 0.01647*0.98 + valid_xdisp0 = [valid_xdisp0; xdisp0]; % Store xdisp0 in degrees + valid_dxdisp0 = [valid_dxdisp0; dxdisp0]; % Store dxdisp0 in rad/s + end + end +end + +% Save the results + save('Basin_GA_SMC.mat' , 'valid_xdisp0', 'valid_dxdisp0'); +% save('Basin_CE_SMC.mat' , 'valid_xdisp0', 'valid_dxdisp0'); +% save('Basin_GA_FOSMC.mat', 'valid_xdisp0', 'valid_dxdisp0'); +% save('Basin_CE_FOSMC.mat', 'valid_xdisp0', 'valid_dxdisp0'); + + % Plot the valid initial conditions +figure(1); +plot(valid_xdisp0, valid_dxdisp0,'or','MarkerFaceColor','red','MarkerSize',12); diff --git a/FraCTune-1.0/Case2-EnergyHarvester/CEopt.m b/FraCTune-1.0/Case2-EnergyHarvester/CEopt.m new file mode 100644 index 0000000..3b4286a --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/CEopt.m @@ -0,0 +1,1216 @@ +% ----------------------------------------------------------------- +% CEopt.m +% ----------------------------------------------------------------- +% programmer: Americo Cunha Jr +% americo.cunhajr@gmail.com +% +% Originally programmed in: Jun 18, 2021 +% Last updated in: Apr 02, 2024 +% ----------------------------------------------------------------- +% This routine employs the Cross-entropy (CE) method to solve the +% following optimization problem: +% +% Xopt = arg min F(x) +% +% subject to +% +% lb <= x <= ub +% g(x) <= 0 +% h(x) = 0 +% where: +% - F : R^Nvars -> R is a given scalar objective function +% - lb : (1 x Nvars) vector of lower bounds for the decision variables +% - ub : (1 x Nvars) vector of upper bounds for the decision variables +% - g(x): R^Nvars -> R^m is a vector of m inequality constraint functions +% - h(x): R^Nvars -> R^p is a vector of p equality constraint functions +% +% The goal is to minimize the scalar objective function F(x) defined +% within a known rectangular domain (feasible region), while also +% satisfying the given equality and inequality constraints. The feasible +% region is further defined by the constraints g(x) <= 0 and h(x) = 0, +% in addition to the bounds lb <= x <= ub. +% +% The algorithm samples the feasible region using a truncated Gaussian +% distribution and updates its parameters with the aid of an elite set +% (defined by the better samples), aiming to transform this Gaussian +% distribution into a Dirac distribution centered at the global optimum. +% For constrained optimization problems, the CE method integrates a +% mechanism for handling the constraints, such as the augmented +% Lagrangian method, to incorporate the effects of constraints into the +% optimization process. +% +% Input: +% fun - Function handle for the objective function. This function +% must accept a 1 x Nvars row vector (representing a single +% sample) or an M x Nvars matrix (representing M samples with +% variables in columns) as input and return a scalar value or +% a row vector of M scalar values (for vectorized operations) +% respectively. +% xmean0 - (1 x Nvars) initial mean +% sigma0 - (1 x Nvars) intial standard deviation +% lb - (1 x Nvars) lower bound +% ub - (1 x Nvars) upper bound +% nonlcon - nonlinear constraint function +% CEobj - Struct containing parameters and settings for the CE method. +% +% CEobj fields include: +% * Verbose : boolean flag to enable/disable screem output +% * isConstrained : boolean flag to indicate a constrained problem +% * isVectorized : boolean flag to indicate a vectorized function +% * Nvars : number of design variables in x +% * EliteFactor : proportion of samples for the elite set +% * Nsamp : number of samples to draw per iteration +% * MaxIter : maximum number of iterations +% * MaxStall : maximum number of stall iterations +% * MaxFcount : maximum number of objective function evaluations +% * MinFval : minimum admissible value for objective function +% * TolAbs : absolute tolerance +% * TolRel : relative tolerance +% * TolCon : constraint violation tolerance +% * TolFun : function value change tolerance +% * alpha : smoothing parameter for the mean update +% * beta : smoothing parameter for the std. dev. update +% * q : exponent in dynamic smoothing parameter +% * NonlconAlgorithm : algorithm to handle nonlinear constraints +% * InitialPenalty : initial penalty value for the augmented Lagrangian +% * PenaltyFactor : factor by which the penalty parameter is increased +% * xmean : history of mean value over iterations +% * xmedian : history of median over iterations +% * xbest : history of best sample point over iterations +% * Fmean : history of objective function mean over elite set +% * Fmedian : history of objective function median over elite set +% * Fbest : history of objective function best value found +% * sigma : history of standard deviation over iterations +% * ErrorS : history of standard deviation error +% * ErrorC : history of constraint violation error (for constrained problems) +% * iter : total number of iterations performed +% * stall : number of iterations without significant progress +% * Fcount : total number of function evaluations performed +% * ConvergenceStatus: boolean flag indicating if the algorithm converged +% (true) or not (false). +% +% This struct can also include additional fields for customized behavior +% or extensions of the CE method. +% +% Output: +% Xopt - (1 x Nvars) optimal point +% Fopt - scalar optimal value +% ExitFlag - Flag indicating the reason for algorithm termination: +% 0 - algorithm is running or has not been initialized +% 1 - maximum number of iterations reached +% 2 - no significant change in objective function (stalled) +% 3 - maximum number of function evaluations reached +% 4 - function change and constranint error smaller than tolerance +% 5 - std dev and constraint errors smaller than tolerance +% 6 - minimum function value criterion met +% CEobj - The updated Cross-Entropy object struct containing the final +% state of the algorithm and possibly additional diagnostic +% information. +% +% Reference: +% Reuven Y. Rubinstein, Dirk P. Kroese +% The Cross-Entropy Method: A Unified Approach to Combinatorial +% Optimization, Monte-Carlo Simulation, and Machine Learning +% Springer-Verlag, 2004. +% ----------------------------------------------------------------- +function [Xopt,Fopt,ExitFlag,CEobj] = ... + CEopt(fun,xmean0,sigma0,lb,ub,nonlcon,CEobj) + + % check number of arguments + if nargin < 5 + error('Too few inputs.') + elseif nargin > 7 + error('Too many inputs.') + end + + % consistency check for the mandatory inputs parameters + [lb,ub,xmean0,sigma0,Nvars] = CheckInput(lb,ub,xmean0,sigma0); + + % check if CEobj is not provided or is empty + if nargin < 7 || isempty(CEobj) + CEobj = struct(); + end + + % set the default parameters for CEobj (if necessary) + CEobj = InitializeCEobj(CEobj,Nvars); + + % consistency check for CEobj parameters + CheckCEobj(CEobj); + + % check if nonlcon is not provided or is empty + if nargin < 6 || isempty(nonlcon) + CEobj.isConstrained = false; + + % objective function + ObjFun = @(x) fun(x); + else + CEobj.isConstrained = true; + + % objective function + if strcmp(CEobj.NonlconAlgorithm,'AugLagrLog') + ObjFun = @(x,Lg,Lh,p) AugLagrangian1(x,fun,nonlcon,Lg,Lh,p); + else + ObjFun = @(x,Lg,Lh,p) AugLagrangian2(x,fun,nonlcon,Lg,Lh,p); + end + end + + % decide the appropriate optimization solver + if ~CEobj.isConstrained + + % CE solver for an unconstrained problem + [Xopt,Fopt,ExitFlag,CEobj] = ... + UnconstrSolverCE(ObjFun,Nvars,xmean0,sigma0,lb,ub,CEobj); + else + + % CE solver for a constrained problem + [Xopt,Fopt,ExitFlag,CEobj] = ... + ConstrSolverCE(ObjFun,Nvars,xmean0,sigma0,lb,ub,nonlcon,CEobj); + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% CheckInput - verify input parameters for possibles errors +% ----------------------------------------------------------------- +function [lb,ub,xmean0,sigma0,Nvars] = ... + CheckInput(lb,ub,xmean0,sigma0) + + % ensure lb and ub are row vectors + lb = lb(:)'; + ub = ub(:)'; + + % check if lb and ub are empty + if isempty(lb) || isempty(ub) + error('lb and ub must be non-empty') + end + + % number of variables + Nvars = length(lb); + + % check for consistency in lb and ub + if Nvars ~= length(ub) + error('lb and ub must have the same dimension') + end + if any(isnan(lb)) || any(isnan(ub)) + error('lb and ub cannot have a NaN components') + end + if any(lb >= ub) + error('lb < ub for all components') + end + + % define xmean0 (if necessary) + if isempty(xmean0) + xmean0 = (ub+lb)/2; + xmean0(isinf(xmean0)) = 0.0; + xmean0(isnan(xmean0)) = 0.0; + end + + % define sigma0 (if necessary) + if isempty(sigma0) + sigma0 = (ub-lb)/sqrt(12); + sigma0(isinf(sigma0)) = 1.0; + sigma0(isnan(sigma0)) = 1.0; + end + + % ensure xmean0 and sigma0 are row vectors + xmean0 = xmean0(:)'; + sigma0 = sigma0(:)'; + + % check for consistency in xmean0 and sigma0 + if size(xmean0) ~= size(sigma0) + error('xmean0 and sigma0 must have the same dimensions') + end + if any(isnan(xmean0)) || any(isnan(sigma0)) + error('xmean0 and sigma0 cannot have a NaN components') + end + if any(isinf(xmean0)) || any(isinf(sigma0)) + error('xmean0 and sigma0 cannot have a Inf components') + end + if any(xmean0 < lb) || any(xmean0 > ub) + error('xmean0 must be in [lb,ub] interval') + end + if any(sigma0 <= 0.0) + error('All components of sigma0 must be positive') + end + + % check for dimension consistency in xmean0 + if length(xmean0) ~= Nvars + error('xmean0 must be a 1 x Nvars vector') + end + + % check for dimension consistency in sigma0 + if length(sigma0) ~= Nvars + error('sigma0 must be a 1 x Nvars vector') + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% InitializeCEobj - initialize and set default parameters for CEobj +% ----------------------------------------------------------------- +function CEobj = InitializeCEobj(CEobj,Nvars) + + % names and values for default fields of CEobj + DefaultParams = struct( ... + 'Verbose' ,true , ... + 'isConstrained' ,false , ... + 'isVectorized' ,false , ... + 'Nvars' ,Nvars , ... + 'EliteFactor' ,0.05 , ... + 'Nsamp' ,100 , ... + 'MaxIter' ,100*Nvars , ... + 'MaxStall' ,50 , ... + 'MaxFcount' ,+Inf , ... + 'MinFval' ,-Inf , ... + 'TolAbs' ,1.0e-6 , ... + 'TolRel' ,1.0e-3 , ... + 'TolCon' ,1.0e-3 , ... + 'TolFun' ,1.0e-3 , ... + 'alpha' ,0.4 , ... + 'beta' ,0.4 , ... + 'q' ,10 , ... + 'NonlconAlgorithm','AugLagLog', ... + 'InitialPenalty' ,10 , ... + 'PenaltyFactor' ,100 ... + ); + + % assign values for undefined fields in CEobj + DefaultFields = fieldnames(DefaultParams); + for i = 1:numel(DefaultFields) + if ~isfield(CEobj, DefaultFields{i}) + CEobj.(DefaultFields{i}) = DefaultParams.(DefaultFields{i}); + end + end + + % get the strange fields in CEobj + StrangeFields = rmfield(CEobj,DefaultFields); + + % remove the strange fields from CEobj + CEobj = rmfield(CEobj,fieldnames(StrangeFields)); + + % order the default fields in CEobj + CEobj = orderfields(CEobj,DefaultParams); + + % preallocate memory or initiate objects + CEobj.xmean = NaN*ones(CEobj.MaxIter,Nvars); + CEobj.xmedian = NaN*ones(CEobj.MaxIter,Nvars); + CEobj.xbest = NaN*ones(CEobj.MaxIter,Nvars); + CEobj.Fmean = NaN*ones(CEobj.MaxIter,1 ); + CEobj.Fmedian = NaN*ones(CEobj.MaxIter,1 ); + CEobj.Fbest = NaN*ones(CEobj.MaxIter,1 ); + CEobj.sigma = NaN*ones(CEobj.MaxIter,Nvars); + CEobj.ErrorS = NaN*ones(CEobj.MaxIter,1 ); + CEobj.ErrorC = NaN*ones(CEobj.MaxIter,1 ); + CEobj.iter = 0; + CEobj.stall = 0; + CEobj.Fcount = 0; +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% CheckCEobj - check parameters consistency for CEobj +% ----------------------------------------------------------------- +function CheckCEobj(CEobj) + + % flag to show output on screem + if mod(CEobj.Verbose,1) ~= 0 + error('Verbose must be integer') + end + + % elite samples percentage + if ~isnumeric(CEobj.PenaltyFactor) || ... + CEobj.EliteFactor <= 0 || ... + CEobj.EliteFactor > 1 + error('EliteFactor must be such that 0 < EliteFactor <= 1') + end + + % number of samples + if ~isnumeric(CEobj.Nsamp) || CEobj.Nsamp <= 1 + error('Nsamp must be greather than 1') + end + + % maximum number of iterations + if mod(CEobj.MaxIter,1) ~= 0 || CEobj.MaxIter < 1 + error('MaxIter must be a positive integer') + end + + % maximum number of stall iterations + if mod(CEobj.MaxStall,1) ~= 0 || CEobj.MaxStall < 1 + error('MaxStall must be a positive integer') + end + + % maximum number of function evaluations + if (mod(CEobj.MaxFcount,1) == 0 && CEobj.MaxFcount < 1) || ... + (mod(CEobj.MaxFcount,1) ~= 0 && CEobj.MaxFcount ~= Inf) + error('MaxFcount must be a positive integer or infinity') + end + + % minimum function value + if ~isnumeric(CEobj.MinFval) + error('MinFval must be numeric') + end + + % absolute tolerance + if ~isnumeric(CEobj.TolAbs) || any(CEobj.TolAbs <= 0.0) + error('TolAbs must be positive real') + end + + % relative tolerance + if ~isnumeric(CEobj.TolRel) || CEobj.TolRel < 0.0 + error('TolRel must be non-negative real') + end + + % constraint tolerance + if ~isnumeric(CEobj.TolCon) || CEobj.TolCon < 0.0 + error('TolCon must be non-negative real') + end + + % function tolerance + if ~isnumeric(CEobj.TolFun) || CEobj.TolFun < 0.0 + error('TolFun must be non-negative') + end + + % smoothing parameter (0 < alpha <= 1) + if ~isnumeric(CEobj.alpha) || CEobj.alpha <= 0 || CEobj.alpha > 1 + error('alpha must be such that 0 < alpha <= 1') + end + + % dynamic smoothing parameter + if ~isnumeric(CEobj.beta) || CEobj.beta <= 0 + error('beta must be non-negative') + end + + % dynamic smoothing parameter + if ~isnumeric(CEobj.q) || CEobj.q <= 0 + error('q must be non-negative') + end + + % nonlinear constraint algorithm + if ~ischar(CEobj.NonlconAlgorithm) || ... + (~strcmp(CEobj.NonlconAlgorithm,'AugLagLog') && ... + ~strcmp(CEobj.NonlconAlgorithm,'AugLagMax')) + error('Unknown option for NonlconAlgorithm') + end + + % initial penalty + if ~isnumeric(CEobj.InitialPenalty) || CEobj.InitialPenalty <= 0 + error('InitialPenalty must be must be non-negative') + end + + % penalty factor + if ~isnumeric(CEobj.PenaltyFactor) || CEobj.PenaltyFactor <= 1 + error('PenaltyFactor must be greather than 1') + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% UnconstrSolverCE - solve an unconstrained optimization problem +% ----------------------------------------------------------------- +function [Xopt,Fopt,ExitFlag,CEobj] = ... + UnconstrSolverCE(fun,Nvars,xmean0,sigma0,lb,ub,CEobj) + + % initialize parameters + t = 0; % iteration counter + stall = 0; % stall iterations counter + Fcount = 0; % function evaluation counter + EliteFactor = CEobj.EliteFactor; % elite factor + Nsamp = CEobj.Nsamp; % total number of samples + Nelite = EliteFactor*Nsamp; % number of elite samples + MaxIter = CEobj.MaxIter; % maximum of iterations + TolAbs = CEobj.TolAbs; % absolute tolerance + TolRel = CEobj.TolRel; % relative tolerance + alpha = CEobj.alpha; % smoothing parameter for mean + beta = CEobj.beta; % smoothing parameter for std. dev. + q = CEobj.q; % dynamic update parameter + Xopt = NaN*xmean0; % optimal point + Fopt = +Inf; % optimal value + ExitFlag = 0; % termination condition flag + + % preallocate memory for design variables samples + X = zeros(Nsamp,Nvars); + + % preallocate memory for objective function (if necessary) + if ~CEobj.isVectorized + F = NaN*ones(Nsamp,1); + end + + % loop to sample the domain and update the distribution + while ExitFlag == 0 && t <= MaxIter + + % update level counter + t = t + 1; + + % sample the domain from a truncated Gaussian distribution + X = DomainSampling(xmean0,sigma0,lb,ub,Nvars,Nsamp,X); + + % evaluate objective function + if ~CEobj.isVectorized + % case where fun is not a vectorized function + for n = 1:Nsamp + F(n) = fun(X(n,:)); + end + else + % case where fun is a vectorized function + F = fun(X); + end + + % update function evalution counter + Fcount = Fcount + Nsamp; + + % define elite samples set + EliteSetId = DefineEliteSet(F,Nelite); + + % update the distribution parameters + [xmean,xmedian,xbest,Fmean,Fmedian,Fbest,sigma] = ... + UpdateDistribution(F,X,EliteSetId,xmean0,sigma0,alpha,beta,q,t); + + % update standard deviation error + [ErrorS,SmallErrorS] = ComputeErrorS(sigma,sigma0,TolAbs,TolRel); + + % update old parameters + xmean0 = xmean; + sigma0 = sigma; + + % update the optimum + if Fbest < Fopt + Xopt = xbest; + Fopt = Fbest; + stall = 0; + else + % stall iterations counter + stall = stall + 1; + end + + % update optimization process history + CEobj.iter = t; + CEobj.stall = stall; + CEobj.Fcount = Fcount; + CEobj.xmean(t,:) = xmean; + CEobj.xmedian(t,:) = xmedian; + CEobj.xbest(t,:) = xbest; + CEobj.Fmean(t) = Fmean; + CEobj.Fmedian(t) = Fmedian; + CEobj.Fbest(t) = Fbest; + CEobj.sigma(t,:) = sigma; + CEobj.ErrorS(t) = ErrorS; + + % print iteration progress on the screen + if CEobj.Verbose + PrintProgress(t,Nvars,CEobj); + end + + % check the convergence + ExitFlag = CheckConv(Fopt,SmallErrorS,[],CEobj); + end + + % convergence check and update of 'Convergenobjatus' field + if ExitFlag > 0 + CEobj.ConvergenceStatus = true; + else + CEobj.ConvergenceStatus = false; + end + + % print resume + if CEobj.Verbose + PrintEnd(Xopt,Fopt,ExitFlag,CEobj); + end + + % delete empty entries from sampling records + CEobj = DeleteEmptyEntries(t,CEobj); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% ConstrSolverCE - solve a constrained optimization problem +% ----------------------------------------------------------------- +function [Xopt,Fopt,ExitFlag,CEobj] = ... + ConstrSolverCE(fun,Nvars,xmean0,sigma0,lb,ub,nonlcon,CEobj) + + % initialize parameters + t = 0; % iteration counter + stall = 0; % stall iterations counter + Fcount = 0; % function evaluation counter + EliteFactor = CEobj.EliteFactor; % elite factor + Nsamp = CEobj.Nsamp; % total number of samples + Nelite = EliteFactor*Nsamp; % number of elite samples + MaxIter = CEobj.MaxIter; % maximum of iterations + TolAbs = CEobj.TolAbs; % absolute tolerance + TolRel = CEobj.TolRel; % relative tolerance + TolCon = CEobj.TolCon; % constraint tolerance + alpha = CEobj.alpha; % smoothing parameter for mean + beta = CEobj.beta; % smoothing parameter for std. dev. + q = CEobj.q; % dynamic update parameter + Xopt = NaN*xmean0; % optimal point + Fopt = +Inf; % optimal value + ExitFlag = 0; % termination condition flag + + % initialize penalty parameters + Penalty = CEobj.InitialPenalty; + PenaltyFactor = CEobj.PenaltyFactor; + + % initialize Lagrange multipliers + [G0,H0] = nonlcon(xmean0); + if isempty(G0), G0 = 0.0; end + if isempty(H0), H0 = 0.0; end + lambdaG = zeros(size(G0)); + lambdaH = zeros(size(H0)); + + % preallocate memory for design variables samples + X = zeros(Nsamp,Nvars); + + % preallocate memory for objective function (if necessary) + if ~CEobj.isVectorized + F = NaN*ones(Nsamp,1); + end + + % loop to sample the domain and update the distribution + while ExitFlag == 0 && t <= MaxIter + + % update level counter + t = t + 1; + + % sample the domain from a truncated Gaussian distribution + X = DomainSampling(xmean0,sigma0,lb,ub,Nvars,Nsamp,X); + + % evaluate augmented Lagrangian + if ~CEobj.isVectorized + % case where fun is not a vectorized function + for n = 1:Nsamp + F(n) = fun(X(n,:),lambdaG,lambdaH,Penalty); + end + else + % case where fun is a vectorized function + F = fun(X,lambdaG,lambdaH,Penalty); + end + + % update function evalution counter + Fcount = Fcount + Nsamp; + + % define elite samples set + EliteSetId = DefineEliteSet(F,Nelite); + + % update the distribution parameters + [xmean,xmedian,xbest,Fmean,Fmedian,Fbest,sigma] = ... + UpdateDistribution(F,X,EliteSetId,xmean0,sigma0,alpha,beta,q,t); + + % standard deviation error + [ErrorS,SmallErrorS] = ComputeErrorS(sigma,sigma0,TolAbs,TolRel); + + % update Lagrange multipliers + [lambdaG,lambdaH,G,H] = ... + UpdateLagrangeMult(xbest,nonlcon,lambdaG,lambdaH,Penalty); + + % constraint error + [ErrorC,SmallErrorC] = ... + ComputeErrorC(G,H,lambdaG,lambdaH,Penalty,TolCon); + + % update pentalty parameter + Penalty = UpdatePenalty(Penalty,PenaltyFactor,SmallErrorC); + + % update old parameters + xmean0 = xmean; + sigma0 = sigma; + + % update the optimum + if Fbest < Fopt + Xopt = xbest; + Fopt = Fbest; + stall = 0; + else + % stall iterations counter + stall = stall + 1; + end + + % update optimization process history + CEobj.iter = t; + CEobj.stall = stall; + CEobj.Fcount = Fcount; + CEobj.xmean(t,:) = xmean; + CEobj.xmedian(t,:) = xmedian; + CEobj.xbest(t,:) = xbest; + CEobj.Fmean(t) = Fmean; + CEobj.Fmedian(t) = Fmedian; + CEobj.Fbest(t) = Fbest; + CEobj.sigma(t,:) = sigma; + CEobj.ErrorS(t) = ErrorS; + CEobj.ErrorC(t) = ErrorC; + + % print iteration progress on the screen + if CEobj.Verbose + PrintProgress(t,Nvars,CEobj); + end + + % check the convergence + ExitFlag = CheckConv(Fopt,SmallErrorS,SmallErrorC,CEobj); + end + + % convergence check and update of 'ConvergenceStatus' field + if ExitFlag > 0 + CEobj.ConvergenceStatus = true; + else + CEobj.ConvergenceStatus = false; + end + + % print resume + if CEobj.Verbose + PrintEnd(Xopt,Fopt,ExitFlag,CEobj); + end + + % delete empty entries from sampling records + CEobj = DeleteEmptyEntries(t,CEobj); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% AugLagrangian1 - augmented Lagrangian function (log formulation) +% ----------------------------------------------------------------- +function [AL,F,G,H] = ... + AugLagrangian1(x,fun,nonlcon,lambdaG,lambdaH,Penalty) + + % objetive function + F = fun(x); + + % nonlinear constraints + [G,H] = nonlcon(x); + if isempty(G), G = 0.0; end + if isempty(H), H = 0.0; end + + % shift + s = lambdaG/Penalty; + + % augmented Lagrangian function + AL = F - sum((s.*lambdaG).*log(s-G+eps),2) + ... + H*(lambdaH')+ 0.5*Penalty*sum(H.^2,2); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% AugLagrangian2 - augmented Lagrangian function (max formulation) +% ----------------------------------------------------------------- +function [AL,F,G,H] = AugLagrangian2(x,fun,nonlcon,... + lambdaG,lambdaH,Penalty) + + % objetive function + F = fun(x); + + % nonlinear constraints + [G,H] = nonlcon(x); + if isempty(G), G = 0.0; end + if isempty(H), H = 0.0; end + + % shifted equality constraint + H_s = H + lambdaH/Penalty; + + % shifted inequality constraint + G_s = G + lambdaG/Penalty; + + % augmented Lagrangian function + AL = F + 0.5*Penalty*(sum(H_s.^2,2) + sum(max(0,G_s).^2,2)); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% DefineEliteSet - define elite samples set +% ----------------------------------------------------------------- +function EliteSetId = DefineEliteSet(F,Nelite) + + % sort ObjFunc evaluations (order statistics) + [Fsort,Isort] = sort(F); + + % elite samples indices + EliteSetId = Isort(1:Nelite); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% UpdateDistribution - update distribution parameters +% ----------------------------------------------------------------- +function [xmean,xmedian,xbest,Fmean,Fmedian,Fbest,sigma] = ... + UpdateDistribution(F,X,EliteSetId,xmean0,sigma0,alpha,beta,q,t) + + % elite samples and values + Felite = F(EliteSetId); + Xelite = X(EliteSetId,:); + + % estimators for the ObjFunc minimum point + xmean = mean(Xelite); + xmedian = median(Xelite); + xbest = Xelite(1,:); + + % estimators for the ObjFunc minimum value + Fmean = mean(Felite); + Fmedian = median(Felite); + Fbest = Felite(1); + + % estimator for the standard deviation + sigma = std(Xelite); + + % smoothing the mean + xmean = Smoothing(xmean,xmean0,alpha); + + % dynamic smoothing parameter + beta_t = beta*(1 - (1-1/t)^q); + + % smoothing the standard deviation + sigma = Smoothing(sigma,sigma0,beta_t); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% Smoothing - smoothing scheme for variable update +% ----------------------------------------------------------------- +function xnew = Smoothing(xnew,xold,s) + + % apply a smoothing scheme based on the parameter s + xnew = s*xnew + (1-s)*xold; +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% ComputeErrorS - compute standard deviation error +% ----------------------------------------------------------------- +function [ErrorS,SmallErrorS] = ... + ComputeErrorS(sigma,sigma0,TolAbs,TolRel) + + % error weigths vector + ewt = ErrorWeights(sigma,TolAbs,TolRel); + + % standard devition error + ErrorS = wrmsNorm(sigma-sigma0,ewt); + + % convergence metric based on standard deviation + SmallErrorS = ErrorS <= 1.0; +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% ErrorWeights - vector with the error weights +% ----------------------------------------------------------------- +function w = ErrorWeights(x,TolAbs,TolRel) + + % error weights vector + w = 1./(TolAbs + abs(x)*TolRel); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% wrmsNorm - weigthed root-mean-square norm +% ----------------------------------------------------------------- +function wnorm = wrmsNorm(v,w) + + % weighted-root-mean-square norm + wnorm = norm(v.*w/length(v)); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% UpdateLagrangeMult - update Lagrange multipliers +% ----------------------------------------------------------------- +function [lambdaG,lambdaH,G,H] = ... + UpdateLagrangeMult(x,nonlcon,lambdaG,lambdaH,Penalty) + + % nonlinear constraints at x + [G,H] = nonlcon(x); + if isempty(G), G = 0.0; end + if isempty(H), H = 0.0; end + + % update Lagrange multipliers for equality constraints + lambdaH = lambdaH + Penalty*H; + + % update Lagrange multipliers for inequality constraints + lambdaG = max(0,lambdaG + Penalty*G); +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% ComputeErrorC - compute constraint error +% ----------------------------------------------------------------- +function [ErrorC,SmallErrorC] = ... + ComputeErrorC(G,H,lambdaG,lambdaH,Penalty,TolCon) + + % constraints violation metrics + ViolationEq = max(abs(H)); + ViolationIn = max(min(-G,lambdaG/Penalty)); + + % constraints violation error + ErrorC = max(ViolationIn,ViolationEq); + + % convergence indicator for constraint violation + SmallErrorC = abs(ErrorC) <= TolCon; +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% UpdatePenalty - update penalty parameter +% ----------------------------------------------------------------- +function Penalty = UpdatePenalty(Penalty,PenaltyFactor,SmallErrorC) + + % update penalty parameter + if ~SmallErrorC + Penalty = PenaltyFactor*Penalty; + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% CheckConv - verify the convergence +% ----------------------------------------------------------------- +function ExitFlag = CheckConv(Fopt,SmallErrorS,SmallErrorC,CEobj) + + % check if SmallErrorC is empty + if isempty(SmallErrorC) + SmallErrorC = true; + end + + % default exit flag + ExitFlag = 0; + + % check if maximum of iterations is reached + if CEobj.iter >= CEobj.MaxIter + ExitFlag = 1; + return + end + + % check if maximum of stall iterations is reached + if CEobj.stall >= CEobj.MaxStall + ExitFlag = 2; + return + end + + % check if the maximum of function evaluations is reached + if CEobj.Fcount >= CEobj.MaxFcount + ExitFlag = 3; + return + end + + % check if both the function change and constraint error are small + if CEobj.iter >= CEobj.MaxStall + + Idx1 = CEobj.iter; + Idx0 = CEobj.iter - CEobj.MaxStall + 1; + + if range(CEobj.Fbest(Idx0:Idx1)) <= CEobj.TolFun && SmallErrorC + ExitFlag = 4; + return + end + end + + % check if standard devition and constraint errors are small + if SmallErrorS && SmallErrorC + ExitFlag = 5; + return + end + + % check if the admissible minimum is reached + if Fopt <= CEobj.MinFval + ExitFlag = 6; + return + end + +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% PrintProgress - print iteration progress on the screen +% ----------------------------------------------------------------- +function PrintProgress(t,Nvars,CEobj) + + % print header in the first level + if t == 1 && Nvars <= 5 + if CEobj.isConstrained + MyHeader = ['\n iter func value error std dev',... + ' error constr design variable(s) \n']; + else + MyHeader = ['\n iter func value error std dev',... + ' design variable(s) \n']; + end + fprintf(MyHeader); + elseif t == 1 && Nvars > 5 + MyHeader = ['It is not possible to print more than',... + ' 5 design variables on the screen \n']; + fprintf(MyHeader); + if CEobj.isConstrained + MyHeader = ['\n iter func value error std dev',... + ' error constr \n']; + else + MyHeader = '\n iter func value error std dev \n'; + end + fprintf(MyHeader); + end + + % initial string with (t, F, Error) + if CEobj.isConstrained + MyString = '\n %5g %+.9E %.9E %.9E'; + else + MyString = '\n %5g %+.9E %.9E'; + end + + % print values on screen + if Nvars <= 5 + % string with (t, F, err, x) + for i=1:Nvars + MyString = strcat(MyString,' %+.6E'); + end + % values with x + if CEobj.isConstrained + fprintf(MyString,t,CEobj.Fmean(t) ,... + CEobj.ErrorS(t),... + CEobj.ErrorC(t),... + CEobj.xmean(t,:)); + else + fprintf(MyString,t,CEobj.Fmean(t) ,... + CEobj.ErrorS(t),... + CEobj.xmean(t,:)); + end + else + % values without x + if CEobj.isConstrained + fprintf(MyString,t,CEobj.Fmean(t),CEobj.ErrorS(t),CEobj.ErrorC(t)); + else + fprintf(MyString,t,CEobj.Fmean(t),CEobj.ErrorS(t)); + end + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% PrintEnd - Display a summary of the optimization results +% ----------------------------------------------------------------- +function PrintEnd(Xopt, Fopt, ExitFlag, CEobj) + + % Interpret ExitFlag and display appropriate message + switch ExitFlag + case 1 + Msg = 'Maximum number of iterations reached. '; + case 2 + Msg = ['Solution stalled: no significant change in ', ... + 'objective function over a set number of iterations.']; + case 3 + Msg = 'Maximum number of function evaluations reached.'; + case 4 + Msg = ['Objective function range has not changed significantly ', ... + 'after many iterations. ']; + if CEobj.isConstrained + Msg = [Msg, 'Additionally, constraint violations are small ,', ... + 'indicating a potential solution. ']; + end + case 5 + Msg = ['Standard deviation variation is small, suggesting ', ... + 'convergence towards a solution. ']; + if CEobj.isConstrained + Msg = [Msg,'Constraint violations are also small, ', ... + 'indicating satisfactory adherence to constraints. ']; + end + case 6 + Msg = 'Minimum function value criterion met. '; + otherwise + Msg = 'Unknown termination reason. '; + end + fprintf('\n\n%s\n',Msg); + + % Provide warnings or recommendations based on ExitFlag + if ExitFlag == 1 || ExitFlag == 3 + Msg = ['\nConsider increasing the maximum number of iterations ',... + 'or function evaluations.']; + fprintf(Msg); + elseif ExitFlag == 2 || ExitFlag == 4 || ExitFlag == 5 + Msg = '\nSolution appears to be optimal within specified tolerances.'; + fprintf(Msg); + elseif ExitFlag == 6 + Msg = ['\nOptimization successfully found a solution meeting ',... + 'the minimum function value criterion.']; + fprintf(Msg); + end + + disp(' '); + disp(' '); + disp('--------------------------------------------------------'); + disp(' Summary of the Optimization Process with the CE method '); + disp('--------------------------------------------------------'); + + % Display the optimal value found + fprintf('Optimal Value Found: %+.6E\n', Fopt); + + % Display the optimal point found + fprintf('Optimal Point Found: ['); + for i = 1:length(Xopt) + fprintf('%+.6E ', Xopt(i)); + if mod(i, 5) == 0 && i ~= length(Xopt) + % Break line for readability + fprintf('...\n '); + end + end + fprintf(']\n'); + + % Display the number of iterations performed + fprintf('Iterations Performed: %d\n', CEobj.iter); + + % Display the number of stall iterations + fprintf('Iterations on Stall: %d\n', CEobj.stall); + + % Display the total number of function evaluations + fprintf('Function Evaluations: %d\n', CEobj.Fcount); + disp('--------------------------------------------------------'); +end + +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% DeleteEmptyEntries - delete empty entries from sampling records +% ----------------------------------------------------------------- +function CEobj = DeleteEmptyEntries(t,CEobj) + + if t < CEobj.MaxIter + CEobj.xmean = CEobj.xmean(1:t,:); + CEobj.xmedian = CEobj.xmedian(1:t,:); + CEobj.xbest = CEobj.xbest(1:t,:); + CEobj.Fmean = CEobj.Fmean(1:t,1); + CEobj.Fmedian = CEobj.Fmedian(1:t,1); + CEobj.Fbest = CEobj.Fbest(1:t,1); + CEobj.sigma = CEobj.sigma(1:t,:); + CEobj.ErrorS = CEobj.ErrorS(1:t,1); + CEobj.ErrorC = CEobj.ErrorC(1:t,1); + end + if ~CEobj.isConstrained + CEobj.ErrorC = []; + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% DomainSampling - sample from truncated Gaussian distribution +% ----------------------------------------------------------------- +function X = DomainSampling(mu,sigma,lb,ub,Nvars,Ns,X) + + % limit vectors for standard truncated Gaussian + l = ones(Ns,1)*((lb - mu)./sigma); + u = ones(Ns,1)*((ub - mu)./sigma); + + % generate samples from truncated Gaussian distribution + for n=1:Nvars + X(:,n) = mu(n) + sigma(n)*trandn(l(:,n),u(:,n)); + end +end +% ----------------------------------------------------------------- + +% ----------------------------------------------------------------- +% trandn +% ----------------------------------------------------------------- +% This function is an efficient generator of a random vector of +% dimension length(l) = length(u) from the standard multivariate +% normal distribution, truncated over the region [l,u]. Infinite +% values for bounds 'u' and 'l' are accepted. +% +% Remark: +% If you wish to simulate a random variable 'Z' from the +% non-standard Gaussian N(m,s^2) conditional on l < Z < u, then +% first simulate X = trandn((l-m)/s,(u-m)/s) and set Z = m + s*X. +% +% Input: +% l - (Nvars x 1) lower bound +% u - (Nvars x 1) upper bound +% +% Output: +% x - (Nvars x 1) random vector with multiv. distribution N(0,1) +% +% References: +% Botev, Z. I. (2016). "The normal law under linear restrictions: +% simulation and estimation via minimax tilting". Journal of the +% Royal Statistical Society: Series B (Statistical Methodology). +% https://doi.org/10.1111/rssb.12162 +% +% MATLAB Central File Exchange: +% Z. Botev, Truncated Normal Generator +% shorturl.at/hntuB +% ----------------------------------------------------------------- +function x = trandn(l,u) + l = l(:); u = u(:); % make 'l' and 'u' column vectors + if length(l)~=length(u) + error('Truncation limits have to be vectors of the same length') + end + x = NaN(size(l)); + a = .66; % treshold for switching between methods + % threshold can be tuned for maximum speed for each Matlab version + % three cases to consider: + % case 1: a < l < u + I = l > a; + if any(I) + tl = l(I); tu = u(I); x(I) = ntail(tl,tu); + end + % case 2: l < u < -a + J = u < -a; + if any(J) + tl=-u(J); tu = -l(J); x(J) = -ntail(tl,tu); + end + % case 3: otherwise use inverse transform or accept-reject + I = ~(I|J); + if any(I) + tl = l(I); tu = u(I); x(I) = tn(tl,tu); + end +end + +% --- ntail --- +% This function samples a column vector of dimension +% length=length(l)=length(u) from the standard multivariate +% normal distribution, truncated over the region [l,u], where +% l > 0 and l and u are column vectors. It uses a sampling +% algorithm based on acceptance-rejection from a Rayleigh +% distribution similar to Marsaglia (1964). +function x = ntail(l,u) + c = l.^2/2; n = length(l); f = expm1(c-u.^2/2); + x = c - reallog(1+rand(n,1).*f); % sample using Rayleigh + % keep list of rejected + I = find(rand(n,1).^2.*x>c); d = length(I); + while d > 0 % while there are rejections + cy = c(I); % find the thresholds of rejected + y = cy - reallog(1+rand(d,1).*f(I)); + idx = rand(d,1).^2.*y tol, uses accept-reject from randn + I = abs(u-l) > tol; x = l; + if any(I) + tl = l(I); tu = u(I); x(I) = trnd(tl,tu); + end + % case: abs(u-l) < tol, uses inverse-transform + I = ~I; + if any(I) + tl = l(I); tu = u(I); + pl = erfc(tl/sqrt(2))/2; pu = erfc(tu/sqrt(2))/2; + x(I) = sqrt(2)*erfcinv(2*(pl-(pl-pu).*rand(size(tl)))); + end +end + +% --- trnd --- +% This function uses an acceptance-rejection sampling strategy +% to simulate from truncated normal. +function x = trnd(l,u) + x = randn(size(l)); % sample normal + % keep list of rejected + I = find(x < l | x > u); d=length(I); + while d>0 % while there are rejections + ly = l(I); % find the thresholds of rejected + uy = u(I); + y = randn(size(ly)); + idx = y > ly & y < uy; % accepted + x(I(idx)) = y(idx); % store the accepted + I = I(~idx); % remove accepted from list + d = length(I); % number of rejected + end +end +% ----------------------------------------------------------------- \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/FOSMCControllerEH.slx b/FraCTune-1.0/Case2-EnergyHarvester/FOSMCControllerEH.slx new file mode 100644 index 0000000..254c4ac Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/FOSMCControllerEH.slx differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_FOSMC.m b/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_FOSMC.m new file mode 100644 index 0000000..10015e7 --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_FOSMC.m @@ -0,0 +1,109 @@ +% ----------------------------------------------------------------- +% MainCEoptCase2_FOSMC.m +% ----------------------------------------------------------------- +% programmer: Julio Cesar de Castro Basilio +% basilio.julio@posgraduacao.uerj.br +% +% Originally programmed in: Nov 30, 2024 +% Last updated in: Nov 30, 2024 +% ----------------------------------------------------------------- +% Case 2: Bistable Energy Harvesting with Fractional-order Sliding Mode Control +% (this case may take several minutes to run) +% Optimizer: Cross-Entropy Method +% ----------------------------------------------------------------- + +clc; clear; close all; + +disp(' -------------------------- ') +disp(' MainGAoptExample2_FOSMC.m ') +disp(' -------------------------- ') +disp('Case 2: Bistable Energy Harvesting with Fractional-order Sliding Mode Control') +disp('(this case may take several minutes to run)') +disp(' Optimizer: Cross-Entropy Method') + +% random number generator (fix the seed for reproducibility) + rng_stream = RandStream('mt19937ar','Seed',30081984); + RandStream.setGlobalStream(rng_stream); + +% system parameters +global k lambda1 lambda2 lambda3 OrderD time lambda +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +xdisp0 = 1.0; +dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime = 0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% objective and constraint functions +fun = @(x) MyObjFunc(x); +nonlcon = @(x) MyConstFunc(x); + +% lower and upper bounds for design variables +lb = [0 ; 0 ; 0 ; 0 ; 0.001]; +ub = [20; 20; 20; 20; 1.990]; + +% initialize mean and std. dev. vectors +xmean0 = (ub+lb)/2; +sigma0 = (ub-lb)/sqrt(12); + +% cross-entropy optimizer struct + CEobj.EliteFactor = 0.05; % Elite samples percentage + CEobj.Nsamp = 100; % Number of samples + CEobj.TolCon = 1.0e-2; % Constraint tolerance + CEobj.TolRel = 1.0e-2; % Relative tolerance + +% CE solver +tic +[Xopt,Fopt,ExitFlag,CEobj] = CEopt(fun,xmean0,sigma0,lb,ub,nonlcon,CEobj); +elapsedTime = toc; + +save Results_CE_FOSMC + +% objective functcion +function F = MyObjFunc(x) + global k lambda1 lambda2 lambda3 OrderD time lambda + k=x(1); + lambda1=x(2); + lambda2=x(3); + lambda3=x(4); + OrderD=x(5); + + sim('FOSMCControllerEH.slx'); + +% time interval of analysis +T = time(end)-time(1); +% output power +power = lambda.*(v.^2); +% mean output power +power_mean = (1/T).*trapz(time,power); + +F = 1/power_mean; +end + +% inequality constraints +function [G,H] = MyConstFunc(x) + global k lambda1 lambda2 lambda3 OrderD + k=x(1); + lambda1=x(2); + lambda2=x(3); + lambda3=x(4); + OrderD=x(5); + + sim('FOSMCControllerEH.slx'); + + G = max(abs(u)) - 5; + H = []; +end \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_SMC.m b/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_SMC.m new file mode 100644 index 0000000..343b49b --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/MainCEoptCase2_SMC.m @@ -0,0 +1,103 @@ +% ----------------------------------------------------------------- +% MainCEoptCase2_SMC.m +% ----------------------------------------------------------------- +% programmer: Julio Cesar de Castro Basilio +% basilio.julio@posgraduacao.uerj.br +% +% Originally programmed in: Nov 30, 2024 +% Last updated in: Nov 30, 2024 +% ----------------------------------------------------------------- +% Case 2: Bistable Energy Harvesting with Sliding Mode Control +% (this case may take several minutes to run) +% Optimizer: Cross-Entropy Method +% ----------------------------------------------------------------- + +clc; clear; close all; + +disp(' -------------------------- ') +disp(' MainGAoptExample2_SMC.m ') +disp(' -------------------------- ') +disp('Case 2: Bistable Energy Harvesting with Sliding Mode Control') +disp('(this case may take several minutes to run)') +disp(' Optimizer: Cross-Entropy Method') + +% random number generator (fix the seed for reproducibility) + rng_stream = RandStream('mt19937ar','Seed',30081984); + RandStream.setGlobalStream(rng_stream); + +% system parameters +global k lambda1 time lambda +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +xdisp0 = 1.0; +dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime=0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% objective and constraint functions +fun = @(x) MyObjFunc(x); +nonlcon = @(x) MyConstFunc(x); + +% lower and upper bounds for design variables +lb = [0 ; 0]; +ub = [20; 20]; + +% initialize mean and std. dev. vectors +xmean0 = (ub+lb)/2; +sigma0 = (ub-lb)/sqrt(12); + +% cross-entropy optimizer struct +CEobj.EliteFactor = 0.05; % Elite samples percentage +CEobj.Nsamp = 100; % Number of samples +CEobj.TolCon = 1.0e-2; % Constraint tolerance +CEobj.TolRel = 1.0e-2; % Relative tolerance + +% CE solver +tic +[Xopt,Fopt,ExitFlag,CEobj] = CEopt(fun,xmean0,sigma0,lb,ub,nonlcon,CEobj); +elapsedTime = toc; + +save Results_CE_SMC + +% objective functcion +function F = MyObjFunc(x) + global k lambda1 time lambda + k=x(1); + lambda1=x(2); + + sim('SMCControllerEH.slx'); + +% time interval of analysis +T = time(end)-time(1); +% output power +power = lambda.*(v.^2); +% mean output power +power_mean = (1/T).*trapz(time,power); + +F = 1/power_mean; +end + +% inequality constraints +function [G,H] = MyConstFunc(x) + global k lambda1 + k=x(1); + lambda1=x(2); + + sim('SMCControllerEH.slx'); + + G = max(abs(u)) - 5; + H = []; +end \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_FOSMC.m b/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_FOSMC.m new file mode 100644 index 0000000..e8595bc --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_FOSMC.m @@ -0,0 +1,122 @@ +% ----------------------------------------------------------------- +% MainGAoptCase2_FOSMC.m +% ----------------------------------------------------------------- +% programmer: Julio Cesar de Castro Basilio +% basilio.julio@posgraduacao.uerj.br +% +% Originally programmed in: Nov 30, 2024 +% Last updated in: Nov 30, 2024 +% ----------------------------------------------------------------- +% Case 1: Bistable Energy Harvesting with Fractional-order Sliding Mode Control +% (this case may take several minutes to run) +% Optimizer: Genetic Algorithm Method +% ----------------------------------------------------------------- + +clc; clear; close all; + +disp(' -------------------------- ') +disp(' MainGAoptExample2_FOSMC.m ') +disp(' -------------------------- ') +disp('Case 2: Bistable Energy Harvesting with Fractional-order Sliding Mode Control') +disp('(this case may take several minutes to run)') +disp(' Optimizer: Genetic Algorithm Method') + +% random number generator (fix the seed for reproducibility) + rng_stream = RandStream('mt19937ar','Seed',30081984); + RandStream.setGlobalStream(rng_stream); + +% system parameters +global k lambda1 lambda2 lambda3 OrderD time lambda +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +xdisp0 = 1.0; +dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime=0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% objective and constraint functions +fun = @(x) MyObjFunc(x); +nonlcon = @(x) MyConstFunc(x); + +Nvars=5; + +% lower and upper bounds for design variables +lb = [0 ; 0 ; 0 ; 0 ; 0.001]; +ub = [20; 20; 20; 20; 1.990]; + +% initialize mean and std. dev. vectors +xmean0 = (ub+lb)/2; +sigma0 = (ub-lb)/sqrt(12); + +% GA optimizer struct + GAobj.EliteFactor = 0.05; % Elite samples percentage + GAobj.Nsamp = 100; % Number of samples + GAobj.MaxIter = 15; % Maximum number of iterations + GAobj.TolCon = 1.0e-2; % Constraint tolerance + GAobj.TolFun = 1.0e-3; % Function tolerance + +% GA solver +tic +options = optimoptions(@ga, 'Display','iter',... + 'PopulationSize',GAobj.Nsamp,... + 'EliteCount', ceil(GAobj.EliteFactor*GAobj.Nsamp),... + 'InitialPopulationMatrix',xmean0',... + 'Generations', GAobj.MaxIter,... + 'TolFun', GAobj.TolFun,... + 'TolCon', GAobj.TolCon,... + 'OutputFcns',@ga_save_each_gen); + + +[Xopt,Fopt,exitflag,output,population,scores] = ga(fun,Nvars,[],[],[],[],lb,ub,nonlcon,options); +elapsedTime = toc; + +save Results_GA_FOSMC + +% objective functcion +function F = MyObjFunc(x) + global k lambda1 lambda2 lambda3 OrderD time lambda + k=x(1); + lambda1=x(2); + lambda2=x(3); + lambda3=x(4); + OrderD=x(5); + + sim('FOSMCControllerEH.slx'); + +% time interval of analysis +T = time(end)-time(1); +% output power +power = lambda.*(v.^2); +% mean output power +power_mean = (1/T).*trapz(time,power); + +F = 1/power_mean; +end + +% inequality constraints +function [G,H] = MyConstFunc(x) + global k lambda1 lambda2 lambda3 OrderD + k=x(1); + lambda1=x(2); + lambda2=x(3); + lambda3=x(4); + OrderD=x(5); + + sim('FOSMCControllerEH.slx'); + + G = max(abs(u)) - 5; + H = []; +end \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_SMC.m b/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_SMC.m new file mode 100644 index 0000000..0adab80 --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/MainGAoptCase2_SMC.m @@ -0,0 +1,115 @@ +% ----------------------------------------------------------------- +% MainGAoptCase2_SMC.m +% ----------------------------------------------------------------- +% programmer: Julio Cesar de Castro Basilio +% basilio.julio@posgraduacao.uerj.br +% +% Originally programmed in: Nov 30, 2024 +% Last updated in: Nov 30, 2024 +% ----------------------------------------------------------------- +% Case 2: Bistable Energy Harvesting with Sliding Mode Control +% (this case may take several minutes to run) +% Optimizer: Genetic Algorithm Method +% ----------------------------------------------------------------- + +clc; clear; close all; + +disp(' -------------------------- ') +disp(' MainGAoptExample2_SMC.m ') +disp(' -------------------------- ') +disp('Case 2: Bistable Energy Harvesting with Sliding Mode Control') +disp('(this case may take several minutes to run)') +disp(' Optimizer: Genetic Algorithm Method') + +% random number generator (fix the seed for reproducibility) + rng_stream = RandStream('mt19937ar','Seed',30081984); + RandStream.setGlobalStream(rng_stream); + +% system parameters +global k lambda1 time lambda +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +xdisp0 = 1.0; +dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime=0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% objective and constraint functions +fun = @(x) MyObjFunc(x); +nonlcon = @(x) MyConstFunc(x); + +Nvars=2; + +% lower and upper bounds for design variables +lb = [0 ; 0]; +ub = [20; 20]; + +% initialize mean and std. dev. vectors +xmean0 = (ub+lb)/2; +sigma0 = (ub-lb)/sqrt(12); + +% GA optimizer struct +GAobj.EliteFactor = 0.05; % Elite samples percentage +GAobj.Nsamp = 100; % Number of samples +GAobj.MaxIter = 15; % Maximum number of iterations +GAobj.TolCon = 1.0e-2; % Constraint tolerance +GAobj.TolFun = 1.0e-3; % Function tolerance + +% GA solver +tic +options = optimoptions(@ga, 'Display','iter',... + 'PopulationSize',GAobj.Nsamp,... + 'EliteCount', ceil(GAobj.EliteFactor*GAobj.Nsamp),... + 'InitialPopulationMatrix',xmean0',... + 'Generations', GAobj.MaxIter,... + 'TolFun', GAobj.TolFun,... + 'TolCon', GAobj.TolCon,... + 'OutputFcns',@ga_save_each_gen); + +[Xopt,Fopt,exitflag,output,population,scores] = ga(fun,Nvars,[],[],[],[],lb,ub,nonlcon,options); +elapsedTime = toc; + +save Results_GA_SMC + +% objective functcion +function F = MyObjFunc(x) + global k lambda1 time lambda + k=x(1); + lambda1=x(2); + + sim('SMCControllerEH.slx'); + + % time interval of analysis + T = time(end)-time(1); + % output power + power = lambda.*(v.^2); + % mean output power + power_mean = (1/T).*trapz(time,power); + + F = 1/power_mean; +end + +% inequality constraints +function [G,H] = MyConstFunc(x) + global k lambda1 + k=x(1); + lambda1=x(2); + + sim('SMCControllerEH.slx'); + + G = max(abs(u)) - 5; + H = []; +end \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/.DS_Store b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/.DS_Store new file mode 100644 index 0000000..6379711 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/.DS_Store differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_FOSMC.mat new file mode 100644 index 0000000..981d672 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_SMC.mat new file mode 100644 index 0000000..ee7f0a6 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_CE_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_FOSMC.mat new file mode 100644 index 0000000..d2df438 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_SMC.mat new file mode 100644 index 0000000..58607fb Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Basin_GA_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/GA_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/GA_FOSMC.mat new file mode 100644 index 0000000..6fce9ad Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/GA_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/funcaoobjetivo_per_generations.m b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/funcaoobjetivo_per_generations.m new file mode 100644 index 0000000..42002af --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/funcaoobjetivo_per_generations.m @@ -0,0 +1,88 @@ +close all +clear all +clc + +num_gen=66; + +J = zeros(num_gen,2); +X_param = zeros(num_gen,6); +Ind = zeros(num_gen,1); + +J(:,1)=[1:1:num_gen]; +X_param(:,1)=[1:1:num_gen]; + +load('gen_0000'); + +%if min(Score_gen)>0 + + [J(1,2),Ind(1)]=min(Score_gen); + +%else +% [J(1,2),Ind(1)]=min(Score_gen*0); +%end +X_param(1,2:6)=Population_gen(Ind(1),:); + + +for n = 1:9 + +load(sprintf(['gen_000', num2str(n)])); + + +%if min(Score_gen)>0 + + [J(1+n,2),Ind(1+n)]= min(Score_gen); + +%else +% [J(1+n,2),Ind(1+n)]= min(Score_gen*0); +%end +X_param(1+n,2:6)=Population_gen(Ind(1+n),:); + +%J(1+n,2)=min(Score_gen); + +end + +for n = 10:num_gen-1 + +load(sprintf(['gen_00', num2str(n)])); + +%if min(Score_gen)>0 + + [J(1+n,2),Ind(1+n)]= min(Score_gen); + +%else +% [J(1+n,2),Ind(1+n)]= min(Score_gen*0); +%end +X_param(1+n,2:6)=Population_gen(Ind(1+n),:); +%J(1+n,2)=min(Score_gen); + +end + +% for n = 100:103 +% +% load(sprintf(['gen_0', num2str(n)])); +% +% [J(1+n,2),Ind(1+n)]=min(Score_gen(Score_gen>0)); +% +% X_param(1+n,2:6)=Population_gen(Ind(1+n),:); +% +% %J(1+n,2)=min(Score_gen); +% +% end + +J_GA_FOSMC=J; +X_param_GA_FOSMC=X_param; + +save('GA_FOSMC.mat','J_GA_FOSMC','X_param_GA_FOSMC') + +figure(1) +plot(J(:,1),J(:,2),'o','linewidth',2) +%title('Minimum obj function per generation/iteration') +xlabel('Iterations/Generation'); +ylabel('Minimum obj function'); +%ylim([-1 0]) + +figure(2) +plot(X_param(:,2:6),'linewidth',2) +%title('Minimum obj function per generation/iteration') +xlabel('Iterations/Generation'); +%ylabel('Minimum obj function'); \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0000.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0000.mat new file mode 100644 index 0000000..ed73c59 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0000.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0001.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0001.mat new file mode 100644 index 0000000..939633b Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0001.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0002.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0002.mat new file mode 100644 index 0000000..2d579a8 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0002.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0003.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0003.mat new file mode 100644 index 0000000..2fc8f8d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0003.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0004.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0004.mat new file mode 100644 index 0000000..5366acc Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0004.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0005.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0005.mat new file mode 100644 index 0000000..7809234 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0005.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0006.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0006.mat new file mode 100644 index 0000000..4cd554a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0006.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0007.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0007.mat new file mode 100644 index 0000000..7140e21 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0007.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0008.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0008.mat new file mode 100644 index 0000000..81947fc Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0008.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0009.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0009.mat new file mode 100644 index 0000000..8fbe674 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0009.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0010.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0010.mat new file mode 100644 index 0000000..563b39c Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0010.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0011.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0011.mat new file mode 100644 index 0000000..03e68ef Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0011.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0012.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0012.mat new file mode 100644 index 0000000..fa9035a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0012.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0013.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0013.mat new file mode 100644 index 0000000..7560fe7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0013.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0014.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0014.mat new file mode 100644 index 0000000..e59d838 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0014.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0015.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0015.mat new file mode 100644 index 0000000..d7d729c Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0015.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0016.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0016.mat new file mode 100644 index 0000000..c81906d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0016.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0017.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0017.mat new file mode 100644 index 0000000..e227349 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0017.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0018.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0018.mat new file mode 100644 index 0000000..ae10b96 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0018.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0019.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0019.mat new file mode 100644 index 0000000..7ca1450 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0019.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0020.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0020.mat new file mode 100644 index 0000000..b768f23 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0020.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0021.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0021.mat new file mode 100644 index 0000000..e6c8458 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0021.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0022.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0022.mat new file mode 100644 index 0000000..efb6ae8 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0022.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0023.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0023.mat new file mode 100644 index 0000000..0e29747 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0023.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0024.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0024.mat new file mode 100644 index 0000000..66e7520 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0024.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0025.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0025.mat new file mode 100644 index 0000000..ea399b7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0025.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0026.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0026.mat new file mode 100644 index 0000000..4224348 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0026.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0027.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0027.mat new file mode 100644 index 0000000..2b07869 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0027.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0028.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0028.mat new file mode 100644 index 0000000..cf6eec9 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0028.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0029.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0029.mat new file mode 100644 index 0000000..89ae44a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0029.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0030.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0030.mat new file mode 100644 index 0000000..6e960d5 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0030.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0031.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0031.mat new file mode 100644 index 0000000..7c236d2 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0031.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0032.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0032.mat new file mode 100644 index 0000000..9edc0e7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0032.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0033.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0033.mat new file mode 100644 index 0000000..134c0c8 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0033.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0034.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0034.mat new file mode 100644 index 0000000..6c63016 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0034.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0035.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0035.mat new file mode 100644 index 0000000..3b70870 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0035.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0036.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0036.mat new file mode 100644 index 0000000..b4ba7e3 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0036.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0037.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0037.mat new file mode 100644 index 0000000..27843a4 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0037.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0038.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0038.mat new file mode 100644 index 0000000..8f8c733 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0038.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0039.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0039.mat new file mode 100644 index 0000000..61051b0 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0039.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0040.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0040.mat new file mode 100644 index 0000000..506fbdb Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0040.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0041.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0041.mat new file mode 100644 index 0000000..99daa87 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0041.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0042.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0042.mat new file mode 100644 index 0000000..959dd1c Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0042.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0043.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0043.mat new file mode 100644 index 0000000..81b3910 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0043.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0044.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0044.mat new file mode 100644 index 0000000..1db4964 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0044.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0045.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0045.mat new file mode 100644 index 0000000..6e9928f Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0045.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0046.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0046.mat new file mode 100644 index 0000000..2ce2bff Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0046.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0047.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0047.mat new file mode 100644 index 0000000..3e004e2 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0047.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0048.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0048.mat new file mode 100644 index 0000000..4f130bc Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0048.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0049.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0049.mat new file mode 100644 index 0000000..583248d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0049.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0050.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0050.mat new file mode 100644 index 0000000..5ca69ca Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0050.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0051.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0051.mat new file mode 100644 index 0000000..0e99247 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0051.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0052.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0052.mat new file mode 100644 index 0000000..569b9d5 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0052.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0053.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0053.mat new file mode 100644 index 0000000..2c5c8a2 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0053.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0054.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0054.mat new file mode 100644 index 0000000..659e3d8 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0054.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0055.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0055.mat new file mode 100644 index 0000000..de878d6 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0055.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0056.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0056.mat new file mode 100644 index 0000000..56fdbfb Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0056.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0057.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0057.mat new file mode 100644 index 0000000..ea69410 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0057.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0058.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0058.mat new file mode 100644 index 0000000..acd4972 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0058.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0059.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0059.mat new file mode 100644 index 0000000..9edc29d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0059.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0060.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0060.mat new file mode 100644 index 0000000..080c1bb Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0060.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0061.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0061.mat new file mode 100644 index 0000000..d45eb47 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0061.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0062.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0062.mat new file mode 100644 index 0000000..3e39e88 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0062.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0063.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0063.mat new file mode 100644 index 0000000..d25e02a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0063.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0064.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0064.mat new file mode 100644 index 0000000..d03ec2f Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0064.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0065.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0065.mat new file mode 100644 index 0000000..1fe75eb Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/FOSMC_GA/gen_0065.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_FOSMC.mat new file mode 100644 index 0000000..6fce9ad Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_SMC.mat new file mode 100644 index 0000000..2d956f2 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/GA_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Basins_of_attraction.m b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Basins_of_attraction.m new file mode 100644 index 0000000..c2fa62f --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Basins_of_attraction.m @@ -0,0 +1,34 @@ +clc; clear; close all; + +% Load the results +load('Basin_GA_FOSMC.mat'); +valid_xdisp0_GA_FOSMC = valid_xdisp0; +valid_dxdisp0_GA_FOSMC = valid_dxdisp0; + +load('Basin_CE_FOSMC.mat'); +valid_xdisp0_CE_FOSMC = valid_xdisp0; +valid_dxdisp0_CE_FOSMC = valid_dxdisp0; + +load('Basin_CE_SMC.mat'); +valid_xdisp0_GA_SMC = valid_xdisp0; +valid_dxdisp0_GA_SMC = valid_dxdisp0; + +load('Basin_GA_SMC.mat'); +valid_xdisp0_CE_SMC = valid_xdisp0; +valid_dxdisp0_CE_SMC = valid_dxdisp0; + +% Plot the valid initial conditions +figure(1); +plot(valid_xdisp0_CE_FOSMC, valid_dxdisp0_CE_FOSMC, 'or','DisplayName','FOSMC + CE','MarkerFaceColor','red','MarkerSize',6); +hold on +plot(valid_xdisp0_GA_SMC, valid_dxdisp0_GA_SMC, 'om','DisplayName','SMC + GA','MarkerFaceColor','magenta','MarkerSize',12); +plot(valid_xdisp0_CE_SMC, valid_dxdisp0_CE_SMC, 'ob','DisplayName','SMC + CE','MarkerFaceColor','blue','MarkerSize',6); +plot(valid_xdisp0_GA_FOSMC, valid_dxdisp0_GA_FOSMC, 'og','DisplayName','FOSMC + GA','MarkerFaceColor','green','MarkerSize',12); +xlabel('xdisp_0 (m)','FontSize', 12); +ylabel('dxdisp_0 (m/s)','FontSize', 12); +title('Valid Conditions (xdisp_{0}, dxdisp_{0}) para u_{end} < 5'); +grid on; +legend('Location','best','FontSize', 12); +xlim([0.75 1.25]) +ax = gca; +ax.FontSize = 12; \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Results_EH.m b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Results_EH.m new file mode 100644 index 0000000..a7dd011 --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Plot_Results_EH.m @@ -0,0 +1,333 @@ +close all; clear all; clc; + +%% OPTIMIZATION PERFORMANCE +load('GA_FOSMC.mat','J_GA_FOSMC','X_param_GA_FOSMC') +load('Results_CE_FOSMC.mat') +Fbest_CE_FOSMC = CEobj.Fbest; +X_param_CE_FOSMC_xbest = CEobj.xbest; +load('GA_SMC.mat','J_GA_SMC','X_param_GA_SMC') +load('Results_CE_SMC.mat') +Fbest_CE_SMC = CEobj.Fbest; +X_param_CE_SMC_xbest = CEobj.xbest; + +figure(1) +plot(J_GA_SMC(:,2),'-m', 'linewidth', 4,'DisplayName','SMC + GA','MarkerFaceColor','magenta','MarkerSize',5); +hold on +plot(Fbest_CE_SMC,'-b', 'linewidth', 4,'DisplayName','SMC + CE','MarkerFaceColor','blue','MarkerSize',5); +plot(J_GA_FOSMC(:,2),'-g', 'linewidth', 4,'DisplayName','FOSMC + GA','MarkerFaceColor','green','MarkerSize',5); +plot(Fbest_CE_FOSMC,'-r', 'linewidth', 4,'DisplayName','FOSMC + CE','MarkerFaceColor','red','MarkerSize',5); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('Optimal Objective Function','FontSize', 14); +legend('Location','best','FontSize', 12); +ax = gca; +ax.FontSize = 14; + +figure(2) +plot(J_GA_SMC(:,2),'-m', 'linewidth', 4,'DisplayName','SMC + GA','MarkerFaceColor','magenta','MarkerSize',5); +hold on +plot(Fbest_CE_SMC,'-b', 'linewidth', 4,'DisplayName','SMC + CE','MarkerFaceColor','blue','MarkerSize',5); +plot(J_GA_FOSMC(:,2),'-g', 'linewidth', 4,'DisplayName','FOSMC + GA','MarkerFaceColor','green','MarkerSize',5); +plot(Fbest_CE_FOSMC,'-r', 'linewidth', 4,'DisplayName','FOSMC + CE','MarkerFaceColor','red','MarkerSize',5); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('Optimal Objective Function','FontSize', 14); +legend('Location','best','FontSize', 12); +ax = gca; +ax.FontSize = 14; +ylim([40 70]) + +figure(3) +subplot(2, 2, 1);% Subplot for the parameter k +plot(X_param_GA_SMC(:,2), "-m", 'linewidth', 2, 'DisplayName', 'SMC + GA'); +hold on; +plot(X_param_GA_FOSMC(:,2), "-g", 'linewidth', 2, 'DisplayName', 'FOSMC + GA'); +plot(X_param_CE_SMC_xbest(:,1), "-b", 'linewidth', 2, 'DisplayName', 'SMC + CE'); +plot(X_param_CE_FOSMC_xbest(:,1), "-r", 'linewidth', 2, 'DisplayName', 'FOSMC + CE'); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('k','FontSize', 14); +legend('Location','best','FontSize', 12); +title('Parameter k'); +ax = gca; +ax.FontSize = 14; +subplot(2, 2, 2);% Subplot for the parameter lambda1 +plot(X_param_GA_SMC(:,3), "-m", 'linewidth', 2, 'DisplayName', 'SMC + GA'); +hold on; +plot(X_param_GA_FOSMC(:,3), "-g", 'linewidth', 2, 'DisplayName', 'FOSMC + GA'); +plot(X_param_CE_SMC_xbest(:,2), "-b", 'linewidth', 2, 'DisplayName', 'SMC + CE'); +plot(X_param_CE_FOSMC_xbest(:,2), "-r", 'linewidth', 2, 'DisplayName', 'FOSMC + CE'); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('\lambda1','FontSize', 14); +legend('Location','best','FontSize', 12); +title('Parameter \lambda1'); +ax = gca; +ax.FontSize = 14; +subplot(2, 2, 3);% Subplot for the parameter lambda2 +plot(X_param_GA_FOSMC(:,4), "-g", 'linewidth', 2, 'DisplayName', 'FOSMC + GA'); +hold on; +plot(X_param_CE_FOSMC_xbest(:,3), "-r", 'linewidth', 2, 'DisplayName', 'FOSMC + CE'); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('\lambda2','FontSize', 14); +legend('Location','best','FontSize', 12); +title('Parâmetro \lambda2'); +ax = gca; +ax.FontSize = 14; +subplot(2, 2, 4);% Subplot for the parameter lambda3 +plot(X_param_GA_FOSMC(:,5), "-g", 'linewidth', 2, 'DisplayName', 'FOSMC + GA'); +hold on; +plot(X_param_CE_FOSMC_xbest(:,4), "-r", 'linewidth', 2, 'DisplayName', 'FOSMC + CE'); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('\lambda3','FontSize', 14); +legend('Location','best','FontSize', 12); +title('Parameter \lambda3'); +ax = gca; +ax.FontSize = 14; + +figure(4) +plot(X_param_GA_FOSMC(:,6),"-g",'linewidth',2,'DisplayName','FOSMC + GA'); +hold on +plot(X_param_CE_FOSMC_xbest(:,5),"-r",'linewidth',2,'DisplayName','FOSMC + CE'); +xlabel('For every 100 functions evaluated','FontSize', 14); +ylabel('\alpha','FontSize', 14); +legend('Location','best','FontSize', 12); +ax = gca; +ax.FontSize = 14; + +%% SIMULATION RESULTS +clear all; clc; + +% system parameters +ksi = 0.01; +chi = 0.05; +lambda = 0.05; +kappa = 0.5; +fa = 0.2; +Omega = 0.8; +phi = 0.59; +f_ref = 0.2; +Omega_ref = 0.8; +xdisp0 = 1.0; +dxdisp0 = 0.0; + +% Time / Samples +t0 = 0.0; +sampleTime=0.1; +t1 = 100; +tspan = t0:sampleTime:t1; +time = tspan'; +simulationTime=t1; + +% Load data results +load('Results_GA_FOSMC.mat') + k=Xopt(1); + lambda1=Xopt(2); + lambda2=Xopt(3); + lambda3=Xopt(4); + OrderD=Xopt(5); + Xopt_FOSMC_GA = Xopt; + sim('FOSMCControllerEH.slx'); + xdisp_FOSMC_GA=xdisp; + u_FOSMC_GA=u; + dxdisp_FOSMC_GA=dxdisp; + v_FOSMC_GA=v; + % time interval of analysis + T = time(end)-time(1); + % output power + power_FOSMC_GA = lambda.*(v_FOSMC_GA.^2); + % mean output power + power_mean_FOSMC_GA = (1/T)*trapz(time,power_FOSMC_GA); + ISU_FOSMC_GA=trapz(tout,((u_FOSMC_GA.^2))); + F_FOSMC_GA = Fopt; + elapsedTime_FOSMC_GA = elapsedTime; + F_count_FOSMC_GA = output.funccount; +load('Results_CE_FOSMC.mat') + k=Xopt(1); + lambda1=Xopt(2); + lambda2=Xopt(3); + lambda3=Xopt(4); + OrderD=Xopt(5); + Xopt_FOSMC_CE = Xopt; + sim('FOSMCControllerEH.slx'); + xdisp_FOSMC_CE=xdisp; + u_FOSMC_CE=u; + dxdisp_FOSMC_CE=dxdisp; + v_FOSMC_CE=v; + % time interval of analysis + T = time(end)-time(1); + % output power + power_FOSMC_CE = lambda.*(v_FOSMC_CE.^2); + % mean output power + power_mean_FOSMC_CE = (1/T)*trapz(time,power_FOSMC_CE); + ISU_FOSMC_CE=trapz(tout,((u_FOSMC_CE.^2))); + F_FOSMC_CE = Fopt; + elapsedTime_FOSMC_CE = elapsedTime; + F_count_FOSMC_CE = CEobj.Fcount; +load('Results_GA_SMC.mat') + k=Xopt(1); + lambda1=Xopt(2); + Xopt_SMC_GA = Xopt; + sim('SMCControllerEH.slx'); + xdisp_SMC_GA=xdisp; + u_SMC_GA=u; + dxdisp_SMC_GA=dxdisp; + v_SMC_GA=v; + % time interval of analysis + T = time(end)-time(1); + % output power + power_SMC_GA = lambda.*(v_SMC_GA.^2); + % mean output power + power_mean_SMC_GA = (1/T)*trapz(time,power_SMC_GA); + ISU_SMC_GA=trapz(tout,((u_SMC_GA.^2))); + F_SMC_GA = Fopt; + elapsedTime_SMC_GA = elapsedTime; + F_count_SMC_GA = output.funccount; +load('Results_CE_SMC.mat') + k=Xopt(1); + lambda1=Xopt(2); + Xopt_SMC_CE = Xopt; + sim('SMCControllerEH.slx'); + xdisp_SMC_CE=xdisp; + u_SMC_CE=u; + dxdisp_SMC_CE=dxdisp; + v_SMC_CE=v; + % time interval of analysis + T = time(end)-time(1); + % output power + power_SMC_CE = lambda.*(v_SMC_CE.^2); + % mean output power + power_mean_SMC_CE = (1/T)*trapz(time,power_SMC_CE); + ISU_SMC_CE=trapz(tout,((u_SMC_CE.^2))); + F_SMC_CE = Fopt; + elapsedTime_SMC_CE = elapsedTime; + F_count_SMC_CE = CEobj.Fcount; + +figure(5) +plot3(xdisp_ref,dxdisp_ref,time,'-k','linewidth',2,'DisplayName','Espaço de Fase Referência'); +hold on +plot3(xdisp_SMC_GA,dxdisp_SMC_GA,time,'-m','linewidth',2,'DisplayName','SMC + GA') +plot3(xdisp_SMC_CE,dxdisp_SMC_CE,time,'-b','linewidth',2,'DisplayName','SMC + CE') +plot3(xdisp_FOSMC_GA,dxdisp_FOSMC_GA,time,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot3(xdisp_FOSMC_CE,dxdisp_FOSMC_CE,time,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Displacement [meters]'); +ylabel('Speed ​​[meters/sec]'); +zlabel('Time [seconds]'); +legend('Location','best'); + +figure(6) +plot(xdisp_ref,dxdisp_ref,'-k','linewidth',8,'DisplayName','Espaço de Fase Referência'); +hold on +plot(xdisp_SMC_GA,dxdisp_SMC_GA,'-m','linewidth',6,'DisplayName','SMC + GA') +plot(xdisp_SMC_CE,dxdisp_SMC_CE,'-b','linewidth',4,'DisplayName','SMC + CE') +plot(xdisp_FOSMC_GA,dxdisp_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(xdisp_FOSMC_CE,dxdisp_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Displacement [meters]'); +ylabel('Speed ​​[meters/sec]'); +legend('Location','best'); + +figure(7) +plot(time,u_SMC_GA,'-m','linewidth',2,'DisplayName','SMC + GA'); hold on +plot(time,u_SMC_CE,'-b','linewidth',2,'DisplayName','SMC + CE') +plot(time,u_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(time,u_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +plot(time,(u_FOSMC_CE*0)+5,"--k",'linewidth',1,'DisplayName','Restrição'); +plot(time,(u_FOSMC_CE*0)-5,"--k",'linewidth',1,'DisplayName','Restrição'); +xlabel('Time [seconds]'); +ylabel('Control Signal'); +ylim([-6 6]) +legend('Location','best'); + +figure(8) +plot(time,power_SMC_GA,'-m','linewidth',7,'DisplayName','SMC + GA'); hold on +plot(time,power_SMC_CE,'-b','linewidth',5,'DisplayName','SMC + CE') +plot(time,power_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA'); +plot(time,power_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Time [seconds]'); +ylabel('Generated Power'); +legend('Location','best'); + +figure(9) +plot(time,xdisp_ref,'-k','linewidth',8,'DisplayName','Referencia'); hold on +plot(time,xdisp_SMC_GA,'-m','linewidth',7,'DisplayName','SMC + GA') +plot(time,xdisp_SMC_CE,'-b','linewidth',5,'DisplayName','SMC + CE') +plot(time,xdisp_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(time,xdisp_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Time [seconds]'); +ylabel('Displacement [meters]'); +legend('Location','best'); + +figure(10) +plot(time,dxdisp_ref,'-k','linewidth',8,'DisplayName','Referencia'); hold on +plot(time,dxdisp_SMC_GA,'-m','linewidth',7,'DisplayName','SMC + GA') +plot(time,dxdisp_SMC_CE,'-b','linewidth',5,'DisplayName','SMC + CE') +plot(time,dxdisp_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(time,dxdisp_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Time [seconds]'); +ylabel('Speed ​​[meters/sec]'); +legend('Location','best'); + +figure(11) +subplot(2, 1, 1); +plot(time,xdisp_ref,'-k','linewidth',8,'DisplayName','Referencia'); hold on +plot(time,xdisp_SMC_GA,'-m','linewidth',7,'DisplayName','SMC + GA') +plot(time,xdisp_SMC_CE,'-b','linewidth',5,'DisplayName','SMC + CE') +plot(time,xdisp_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(time,xdisp_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Time [seconds]'); +ylabel('Displacement [meters]'); +legend('Location','best'); +subplot(2, 1, 2); +plot(time,dxdisp_ref,'-k','linewidth',8,'DisplayName','Referencia'); hold on +plot(time,dxdisp_SMC_GA,'-m','linewidth',7,'DisplayName','SMC + GA') +plot(time,dxdisp_SMC_CE,'-b','linewidth',5,'DisplayName','SMC + CE') +plot(time,dxdisp_FOSMC_GA,'-g','linewidth',2,'DisplayName','FOSMC + GA') +plot(time,dxdisp_FOSMC_CE,'-r','linewidth',2,'DisplayName','FOSMC + CE') +xlabel('Time [seconds]'); +ylabel('Speed ​​[meters/sec]'); +legend('Location','best'); + + +disp('RESULTS') +disp('--------------------------------------------------------') +disp('Optimal Objective Function:') +fprintf(' F_SMC_GA = %5.9f\n',F_SMC_GA); +fprintf(' F_SMC_CE = %5.9f\n',F_SMC_CE); +fprintf(' F_FOSMC_GA = %5.9f\n',F_FOSMC_GA); +fprintf(' F_FOSMC_CE = %5.9f\n',F_FOSMC_CE); +disp('--------------------------------------------------------') +disp('Optimal Control Parameters:') +fprintf(' k_SMC_GA = %5.5f\n',Xopt_SMC_GA(1)); +fprintf(' k_SMC_CE = %5.5f\n',Xopt_SMC_CE(1)); +fprintf(' k_FOSMC_GA = %5.5f\n',Xopt_FOSMC_GA(1)); +fprintf(' k_FOSMC_CE = %5.5f\n',Xopt_FOSMC_CE(1)); +fprintf(' lambda1_SMC_GA = %5.5f\n',Xopt_SMC_GA(2)); +fprintf(' lambda1_SMC_CE = %5.5f\n',Xopt_SMC_CE(2)); +fprintf(' lambda1_FOSMC_GA = %5.5f\n',Xopt_FOSMC_GA(2)); +fprintf(' lambda1_FOSMC_CE = %5.5f\n',Xopt_FOSMC_CE(2)); +fprintf(' lambda2_FOSMC_GA = %5.5f\n',Xopt_FOSMC_GA(3)); +fprintf(' lambda2_FOSMC_CE = %5.5f\n',Xopt_FOSMC_CE(3)); +fprintf(' lambda3_FOSMC_GA = %5.5f\n',Xopt_FOSMC_GA(4)); +fprintf(' lambda3_FOSMC_CE = %5.5f\n',Xopt_FOSMC_CE(4)); +fprintf(' OrderD_FOSMC_GA = %5.5f\n',Xopt_FOSMC_GA(5)); +fprintf(' OrderD_FOSMC_CE = %5.5f\n',Xopt_FOSMC_CE(5)); +disp('--------------------------------------------------------') +disp('Average Power:') +fprintf(' power_mean_SMC_GA = %5.5f\n',power_mean_SMC_GA); +fprintf(' power_mean_SMC_CE = %5.5f\n',power_mean_SMC_CE); +fprintf(' power_mean_FOSMC_GA = %5.5f\n',power_mean_FOSMC_GA); +fprintf(' power_mean_FOSMC_CE = %5.5f\n',power_mean_FOSMC_CE); +disp('--------------------------------------------------------') +disp('Integral of the Square of the Control Signal:') +fprintf(' ISU_SMC_GA = %5.5f\n',ISU_SMC_GA); +fprintf(' ISU_SMC_CE = %5.5f\n',ISU_SMC_CE); +fprintf(' ISU_FOSMC_GA = %5.5f\n',ISU_FOSMC_GA); +fprintf(' ISU_FOSMC_CE = %5.5f\n',ISU_FOSMC_CE); +disp('--------------------------------------------------------') +disp('Functions Evaluated:') +fprintf(' F_count_SMC_GA = %5.5f\n',F_count_SMC_GA); +fprintf(' F_count_SMC_CE = %5.5f\n',F_count_SMC_CE); +fprintf(' F_count_FOSMC_GA = %5.5f\n',F_count_FOSMC_GA); +fprintf(' F_count_FOSMC_CE = %5.5f\n',F_count_FOSMC_CE); +disp('--------------------------------------------------------') +disp('Simulation Time:') +fprintf(' elapsedTime_SMC_GA = %5.2f minutes\n',elapsedTime_SMC_GA/60); +fprintf(' elapsedTime_SMC_CE = %5.2f minutes\n',elapsedTime_SMC_CE/60); +fprintf(' elapsedTime_FOSMC_GA = %5.2f minutes\n',elapsedTime_FOSMC_GA/60); +fprintf(' elapsedTime_FOSMC_CE = %5.2f minutes\n',elapsedTime_FOSMC_CE/60); diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_FOSMC.mat new file mode 100644 index 0000000..8c68910 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_SMC.mat new file mode 100644 index 0000000..1411e9a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_CE_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_FOSMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_FOSMC.mat new file mode 100644 index 0000000..e6368f0 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_FOSMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_SMC.mat new file mode 100644 index 0000000..f2a4de5 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/Results_GA_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/GA_SMC.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/GA_SMC.mat new file mode 100644 index 0000000..2d956f2 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/GA_SMC.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/funcaoobjetivo_per_generations.m b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/funcaoobjetivo_per_generations.m new file mode 100644 index 0000000..e9cdedd --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/funcaoobjetivo_per_generations.m @@ -0,0 +1,88 @@ +close all +clear all +clc + +num_gen=51; + +J = zeros(num_gen,2); +X_param = zeros(num_gen,3); +Ind = zeros(num_gen,1); + +J(:,1)=[1:1:num_gen]; +X_param(:,1)=[1:1:num_gen]; + +load('gen_0000'); + +%if min(Score_gen)>0 + + [J(1,2),Ind(1)]=min(Score_gen); + +%else +% [J(1,2),Ind(1)]=min(Score_gen*0); +%end +X_param(1,2:3)=Population_gen(Ind(1),:); + + +for n = 1:9 + +load(sprintf(['gen_000', num2str(n)])); + + +%if min(Score_gen)>0 + + [J(1+n,2),Ind(1+n)]= min(Score_gen); + +%else +% [J(1+n,2),Ind(1+n)]= min(Score_gen*0); +%end +X_param(1+n,2:3)=Population_gen(Ind(1+n),:); + +%J(1+n,2)=min(Score_gen); + +end + +for n = 10:num_gen-1 + +load(sprintf(['gen_00', num2str(n)])); + +%if min(Score_gen)>0 + + [J(1+n,2),Ind(1+n)]= min(Score_gen); + +%else +% [J(1+n,2),Ind(1+n)]= min(Score_gen*0); +%end +X_param(1+n,2:3)=Population_gen(Ind(1+n),:); +%J(1+n,2)=min(Score_gen); + +end + +% for n = 100:103 +% +% load(sprintf(['gen_0', num2str(n)])); +% +% [J(1+n,2),Ind(1+n)]=min(Score_gen(Score_gen>0)); +% +% X_param(1+n,2:6)=Population_gen(Ind(1+n),:); +% +% %J(1+n,2)=min(Score_gen); +% +% end + +J_GA_SMC=J; +X_param_GA_SMC=X_param; + +save('GA_SMC.mat','J_GA_SMC','X_param_GA_SMC') + +figure(1) +plot(J(:,1),J(:,2),'o','linewidth',2) +%title('Minimum obj function per generation/iteration') +xlabel('Iterations/Generation'); +ylabel('Minimum obj function'); +%ylim([-1 0]) + +figure(2) +plot(X_param(:,2:3),'linewidth',2) +%title('Minimum obj function per generation/iteration') +xlabel('Iterations/Generation'); +%ylabel('Minimum obj function'); \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0000.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0000.mat new file mode 100644 index 0000000..cbd6672 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0000.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0001.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0001.mat new file mode 100644 index 0000000..ac0ec80 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0001.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0002.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0002.mat new file mode 100644 index 0000000..e61c964 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0002.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0003.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0003.mat new file mode 100644 index 0000000..e3a5ba9 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0003.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0004.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0004.mat new file mode 100644 index 0000000..630cd95 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0004.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0005.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0005.mat new file mode 100644 index 0000000..76ee37a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0005.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0006.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0006.mat new file mode 100644 index 0000000..390ac67 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0006.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0007.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0007.mat new file mode 100644 index 0000000..21ca14d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0007.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0008.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0008.mat new file mode 100644 index 0000000..b581eb0 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0008.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0009.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0009.mat new file mode 100644 index 0000000..ec392a7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0009.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0010.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0010.mat new file mode 100644 index 0000000..adbf474 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0010.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0011.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0011.mat new file mode 100644 index 0000000..d6b4a45 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0011.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0012.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0012.mat new file mode 100644 index 0000000..c6334e4 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0012.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0013.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0013.mat new file mode 100644 index 0000000..4928a1b Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0013.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0014.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0014.mat new file mode 100644 index 0000000..af2b110 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0014.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0015.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0015.mat new file mode 100644 index 0000000..209db29 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0015.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0016.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0016.mat new file mode 100644 index 0000000..92d377d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0016.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0017.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0017.mat new file mode 100644 index 0000000..6a9bc79 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0017.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0018.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0018.mat new file mode 100644 index 0000000..154a10c Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0018.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0019.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0019.mat new file mode 100644 index 0000000..28f8de7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0019.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0020.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0020.mat new file mode 100644 index 0000000..0b72118 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0020.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0021.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0021.mat new file mode 100644 index 0000000..3be3259 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0021.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0022.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0022.mat new file mode 100644 index 0000000..8c68ec1 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0022.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0023.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0023.mat new file mode 100644 index 0000000..8b1c11c Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0023.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0024.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0024.mat new file mode 100644 index 0000000..3412621 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0024.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0025.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0025.mat new file mode 100644 index 0000000..de9de55 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0025.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0026.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0026.mat new file mode 100644 index 0000000..165a4db Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0026.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0027.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0027.mat new file mode 100644 index 0000000..d01077a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0027.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0028.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0028.mat new file mode 100644 index 0000000..bba7468 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0028.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0029.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0029.mat new file mode 100644 index 0000000..fe2cf3e Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0029.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0030.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0030.mat new file mode 100644 index 0000000..26ac337 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0030.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0031.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0031.mat new file mode 100644 index 0000000..90e686f Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0031.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0032.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0032.mat new file mode 100644 index 0000000..a188257 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0032.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0033.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0033.mat new file mode 100644 index 0000000..a07eafe Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0033.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0034.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0034.mat new file mode 100644 index 0000000..1fc2b34 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0034.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0035.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0035.mat new file mode 100644 index 0000000..b8051f7 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0035.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0036.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0036.mat new file mode 100644 index 0000000..2a18084 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0036.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0037.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0037.mat new file mode 100644 index 0000000..3bd1c89 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0037.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0038.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0038.mat new file mode 100644 index 0000000..305007e Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0038.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0039.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0039.mat new file mode 100644 index 0000000..c837671 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0039.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0040.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0040.mat new file mode 100644 index 0000000..a864771 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0040.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0041.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0041.mat new file mode 100644 index 0000000..7b7550d Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0041.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0042.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0042.mat new file mode 100644 index 0000000..47e2d56 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0042.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0043.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0043.mat new file mode 100644 index 0000000..65b1cd4 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0043.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0044.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0044.mat new file mode 100644 index 0000000..6fc7514 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0044.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0045.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0045.mat new file mode 100644 index 0000000..1404a69 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0045.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0046.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0046.mat new file mode 100644 index 0000000..97187ad Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0046.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0047.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0047.mat new file mode 100644 index 0000000..e5b26ad Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0047.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0048.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0048.mat new file mode 100644 index 0000000..d6eec14 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0048.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0049.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0049.mat new file mode 100644 index 0000000..3f41d32 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0049.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0050.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0050.mat new file mode 100644 index 0000000..102c623 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/SMC_GA/gen_0050.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat new file mode 100644 index 0000000..f0af869 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml new file mode 100644 index 0000000..518522b --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml @@ -0,0 +1,6 @@ + + + + StaCNEf6qY6t9D6obUhXewdCkXdkmlrVfs+/itR6yaQoSd7dhHnTHnfN3dnSwrkIAJuKaYsdsN8673gqQxV0eA== + + \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat new file mode 100644 index 0000000..381217a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat new file mode 100644 index 0000000..8cb1048 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml new file mode 100644 index 0000000..c1b5d0f --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml @@ -0,0 +1,6 @@ + + + + XbvPHLNyXAN/NZbuLvkOe0wlDiEY6tj/VR6Y4brBsUI9sGCcMdmVF/TqrVWPoovodH5c+UdPcz4aX6jwXIV+Ew== + + \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/varInfo.mat b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/varInfo.mat new file mode 100644 index 0000000..2d8376b Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/Results_and_Plots/slprj/sim/varcache/SMCControllerEH/varInfo.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/SMCControllerEH.slx b/FraCTune-1.0/Case2-EnergyHarvester/SMCControllerEH.slx new file mode 100644 index 0000000..4acb82a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/SMCControllerEH.slx differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/ga_save_each_gen.m b/FraCTune-1.0/Case2-EnergyHarvester/ga_save_each_gen.m new file mode 100644 index 0000000..e48e010 --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/ga_save_each_gen.m @@ -0,0 +1,7 @@ +function [state,options,optchanged]=ga_save_each_gen(options,state,flag) + Score_gen=state.Score; + Population_gen=state.Population; + Generation_gen=state.Generation; + optchanged=[]; + save(['gen_' num2str(Generation_gen,'%.4d') '.mat'],'Score_gen','Population_gen','Generation_gen') +end \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat new file mode 100644 index 0000000..f0af869 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/checksumOfCache.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml new file mode 100644 index 0000000..518522b --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/tmwinternal/simulink_cache.xml @@ -0,0 +1,6 @@ + + + + StaCNEf6qY6t9D6obUhXewdCkXdkmlrVfs+/itR6yaQoSd7dhHnTHnfN3dnSwrkIAJuKaYsdsN8673gqQxV0eA== + + \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat new file mode 100644 index 0000000..381217a Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/FOSMCControllerEH/varInfo.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat new file mode 100644 index 0000000..8cb1048 Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/checksumOfCache.mat differ diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml new file mode 100644 index 0000000..c30046f --- /dev/null +++ b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/tmwinternal/simulink_cache.xml @@ -0,0 +1,6 @@ + + + + s861swXQti70vymy5ELBq3uw8wfl5+aRhub4/TeNyiQdlamDegs1GN+vkZJTjsua/J6EGvv0lcCp1T8M8yQLIA== + + \ No newline at end of file diff --git a/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/varInfo.mat b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/varInfo.mat new file mode 100644 index 0000000..2d8376b Binary files /dev/null and b/FraCTune-1.0/Case2-EnergyHarvester/slprj/sim/varcache/SMCControllerEH/varInfo.mat differ