MPPT Technique Neural Network Circuit
Version 1.0.0 (38,5 KB) von
Pratyush
Integration of Neural Network(NN) with InC circuit.
Integration of Neural Network(NN) with InC circuit.
This is the code for changing i/p and o/p as per your requirments...
function [Y,Xf,Af] = myNeuralNetworkFunction(X,~,~)
%MYNEURALNETWORKFUNCTION neural network simulation function.
%
% Auto-generated by MATLAB, 13-Nov-2024 15:05:49.
%
% [Y] = myNeuralNetworkFunction(X,~,~) takes these arguments:
%
% X = 1xTS cell, 1 inputs over TS timesteps
% Each X{1,ts} = Qx2 matrix, input #1 at timestep ts.
%
% and returns:
% Y = 1xTS cell of 1 outputs over TS timesteps.
% Each Y{1,ts} = Qx1 matrix, output #1 at timestep ts.
%
% where Q is number of samples (or series) and TS is the number of timesteps.
%#ok<*RPMT0>
% ===== NEURAL NETWORK CONSTANTS =====
% Input 1
x1_step1.xoffset = [0.34146221813891;15.0104475071389];
x1_step1.gain = [0.00200170112993274;0.100104560887701];
x1_step1.ymin = -1;
% Layer 1
b1 = [4.4926755370075115437;3.7582508693957881185;-1.7178246808533850221;-0.42321728898381044681;-1.0121917497679715492;-0.5602599447159295476;0.98177130623752151273;1.0110391144616179826;3.8802463640733879657;-4.3159390076281392012];
IW1_1 = [-4.4373465039460890935 -0.091140891909045410046;-4.0198780905126039187 1.4224829521803272758;2.8676544763773348379 -3.8113641058862355315;1.8754270232383681537e-06 0.26642234920289015188;2.8116719440426085619 3.209660242645796302;-4.4195262035258426891 -1.2105949685752719347;-4.3878874281663111931e-06 0.43662968215577296904;-0.0018603078415276865735 -1.6459666922922007171;3.4841924243950130879 2.05207965616648913;-4.8574496319011446488 -1.0916554345038218532];
% Layer 2
b2 = -0.41226234203600070627;
LW2_1 = [5.4325352850174853691e-06 -3.9054222298266312848e-06 -2.066503219577792473e-06 -3.4163990961468950758 1.5140737145842605934e-07 8.7828638458003640692e-08 -1.2606508274188612528 -0.0035780854653371303199 5.2143431482006447628e-06 1.4632106345507084842e-06];
% Output 1
y1_step1.ymin = -1;
y1_step1.gain = 0.271278721139538;
y1_step1.xoffset = 27.0137535076954;
% ===== SIMULATION ========
% Format Input Arguments
isCellX = iscell(X);
if ~isCellX
X = {X};
end
% Dimensions
TS = size(X,2); % timesteps
if ~isempty(X)
Q = size(X{1},1); % samples/series
else
Q = 0;
end
% Allocate Outputs
Y = cell(1,TS);
% Time loop
for ts=1:TS
% Input 1
X{1,ts} = X{1,ts}';
Xp1 = mapminmax_apply(X{1,ts},x1_step1);
% Layer 1
a1 = tansig_apply(repmat(b1,1,Q) + IW1_1*Xp1);
% Layer 2
a2 = repmat(b2,1,Q) + LW2_1*a1;
% Output 1
Y{1,ts} = mapminmax_reverse(a2,y1_step1);
Y{1,ts} = Y{1,ts}';
end
% Final Delay States
Xf = cell(1,0);
Af = cell(2,0);
% Format Output Arguments
if ~isCellX
Y = cell2mat(Y);
end
end
% ===== MODULE FUNCTIONS ========
% Map Minimum and Maximum Input Processing Function
function y = mapminmax_apply(x,settings)
y = bsxfun(@minus,x,settings.xoffset);
y = bsxfun(@times,y,settings.gain);
y = bsxfun(@plus,y,settings.ymin);
end
% Sigmoid Symmetric Transfer Function
function a = tansig_apply(n,~)
a = 2 ./ (1 + exp(-2*n)) - 1;
end
% Map Minimum and Maximum Output Reverse-Processing Function
function x = mapminmax_reverse(y,settings)
x = bsxfun(@minus,y,settings.ymin);
x = bsxfun(@rdivide,x,settings.gain);
x = bsxfun(@plus,x,settings.xoffset);
end
Zitieren als
Pratyush (2026). MPPT Technique Neural Network Circuit (https://de.mathworks.com/matlabcentral/fileexchange/175733-mppt-technique-neural-network-circuit), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2024b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0 |