Effacer les filtres
Effacer les filtres

How do I create an PV system in Simulink?

9 vues (au cours des 30 derniers jours)
Johanna Rigby
Johanna Rigby le 8 Mar 2019
I'm quite new to simulink and I've been trying to get a PV system in simulink running for a few days now and I keep running into a multitude of errors. The most recent error that I have been unable to fix is:
An error occurred while running the simulation and the simulation was terminated
Caused by:
  • Solver encountered an error while simulating model 'untitled1' at time 0 and cannot continue. Please check the model for errors.
  • Solver could not solve the system of algebraic equations because a singular iteration matrix was encountered. Consider providing more accurate initial conditions. If the problem persists, check the model structure and values of parameters.
Here is the code inside the PandO block:
function D = PandO(Vpv,Ipv)
%#codegen
% ************************************************************
% MATLAB implementation of a Perturb and Observe algorithm
% for Maximum Power Point Tracking. This algorithm is designed
% to operate with a buck converter
%
% Created by: Carlos Osorio
% ************************************************************
% Define internal values for the voltage and power as persistent
% variables
persistent Dprev Pprev Vprev
% Initialize the internal values for the voltage and power on the
% first pass
if isempty(Dprev)
Dprev = 0.7;
Vprev = 190;
Pprev = 1000;
end
% Initialize algorithm parameters
deltaD = 0.025;
% Calculate measured array power
Ppv = Vpv*Ipv;
% Increase or decrease duty cycle based on conditions
if (Ppv-Pprev) ~= 0
if (Ppv-Pprev) > 0
if (Vpv-Vprev) > 0
D = Dprev - deltaD;
else
D = Dprev + deltaD;
end
else
if (Vpv-Vprev) > 0
D = Dprev + deltaD;
else
D = Dprev - deltaD;
end
end
else
D = Dprev;
end
% Update internal values
Dprev = D;
Vprev = Vpv;
Pprev = Ppv;
I've also attached a picture of the full simulink model. Just hoping to get some help with this as I've been struggling for a while now. Are there any glaring problems?
  1 commentaire
Arvind Sathyanarayanan
Arvind Sathyanarayanan le 8 Mar 2019
Modifié(e) : Arvind Sathyanarayanan le 8 Mar 2019
Try adding a ground block to your system and also try moving the the sovler configuration to power system domain maybe negative terminal of the the PV array.
It would be helpful if you could attach the model (in 2017b as I dont have 2018b).

Connectez-vous pour commenter.

Réponses (1)

Joel Van Sickel
Joel Van Sickel le 24 Août 2020
Hello Johanna,
as mentioned by Arvind, please at an electrical reference block. Also, you are putting a duty cycle into your converter. Make sure that the converter is set to average. Your location of solver configuration will work as is.
Regards,
Joel

Produits


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by