View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Grid-Connected PV Array

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.5 | 46 ratings Rate this file 398 Downloads (last 30 days) File Size: 439 KB File ID: #34752 Version: 1.2
image thumbnail

Grid-Connected PV Array


Pierre Giroux (view profile)


24 Jan 2012 (Updated )

Two demonstrations of a grid-connected PV array using SimPowerSystems.

| Watch this File

File Information

The following two models are included in the package:

• PVarray_Grid_IncCondReg_det.mdl is a detailed model of a 100-kW array connected to a 25-kV grid via a DC-DC boost converter and a three-phase three-level Voltage Source Converter (VSC). Maximum Power Point Tracking (MPPT) is implemented in the boost converter by means of a Simulink model using the “Incremental Conductance + Integral Regulator” technique.

• PVarray_Grid_PandO_avg.mdl is an average model of a 200-kW array connected to a 25-kV grid via two DC-DC boost converters and a single three-phase VSC. The MPPT controller based on the “Perturb and Observe” technique is implemented by means of a MATLAB Function block that generates embeddable C code.

A Help file containing useful information on the two models is also included.

Authors: Pierre Giroux, Gilbert Sybille, Hydro-Quebec Research Institute (IREQ)
Carlos Osorio, Shripad Chandrachood, The Mathworks

Required Products Simscape Power Systems
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (95)
09 Oct 2016 Vlad Danilchenko

Добрый день, поделитесь пожалуйста файлом, очень нужен. заранее спасибо.

Comment only
29 Sep 2016 aissam ahmed


Comment only
23 Sep 2016 Lumia Lee

Thanks for sharing with us.

27 May 2016 mi feng

thanks for your sharing

25 May 2016 Hung TRAN  
12 May 2016 Bhupendra Pandit  
27 Apr 2016 Mukesh Kumar

how can i see the replies from author on the comment given below?

Comment only
22 Apr 2016 widada

widada (view profile)

thanks for this job, it will help me in my project.
but i have a problem concerning the voltage and the current regulator, can you please explain me how to calculate their Kp and Ki coefficient.
this is my email:

Comment only
03 Apr 2016 zakaria zaki  
22 Mar 2016 Amer Humaidan

Great job ! thanks alot
may god bless you

Comment only
18 Mar 2016 mohamed meridjet


27 Jan 2016 Balakrushna Sahu

can anybody help me out of the following problem? When I compile the model it gives me error like" A installed compiler was not detected. Certain simulation modes, as well as host-based coder build requires that a compiler be installed. Please install one of the supported compilers for this release as listed at"

Comment only
17 Jan 2016 Jawairia Atiq  
04 Jan 2016 oguzhan yilmaz

Hello , Can you please send the file in MATLAB R2009a or MATLAB R2014 PV models?
I really need .
This will be a big help.
Thank you.

Comment only
09 Dec 2015 THON HERN

Hello sir. May I know how can I scale down the power to about 8kW ?

Comment only
03 Oct 2015 Iqbal Rizaf

Hello sir,

can you explain all parameters in that model simulink ? i need for final project.

please i hope, we can more conversation at mail (

best regards and very thanks,

Iqbal Riza Fathuddin

02 Oct 2015 usman jamil

hello Pierre Giroux
i want to add Energy storage system before VSC in [PVarray_Grid_IncCondReg]file

which may b helpful in case when sun radiation is not available..
can u please guide me regardig this???

17 Sep 2015 Mayur Randive

it's nice work....
thank you @ Pierre Giroux

Comment only
17 Sep 2015 Mayur Randive

hi ,
it's nice job..but
when I am simulating the model in R2013a getting errors saying
Undefined function or variable 'Ts_Control'. and 'Ts_Power'.
How can I overcome this problem... please provide the suggestions or mail to

Comment only
03 Aug 2015 DP

DP (view profile)

Dear Sir,

It is very useful for learning the PV array grid connected. I would like to request you to kindly help me out how can we upgrade the kW model to MW model.

Thanks in advance

Comment only
17 Apr 2015 DjaberLab

it's very usefull thank uo so much, just tell us which version of matlab can be execute.

second Q: I want to simulate shading effect of PV-array grid connected, in its stability or instability of gred.Thank uo again

18 Mar 2015 Faraz

Faraz (view profile)

Hi, how can I check if the system is operating at Maximum Power Point?

Comment only
13 Feb 2015 B P

B P (view profile)

Exelent. I need some help.

Comment only
10 Feb 2015 Abdellatif BOUAICHI

Failed to find 'Continuous/PID Controller' in library 'simulink' referenced by 'PVarray_Grid_PandO_avg/VSC Control1/Current Regulator/PI'.

Comment only
21 Jan 2015 Patrice Brunelle

Hi Bala,

This model should run in R2011b and later releases of MATLAB, but probably not in could in older ones. If you get a chance to install and run the Pre Release R2015a version of MATLAB you wil lsee that the PV Array block is now part of the SPS libraries. The new block will give you access to more than 10,000 manuafacturer preset of PV modules from the NREL System Advisory Model database.

Comment only
20 Jan 2015 bala

bala (view profile)

when I am simulating the model in R2009b getting errors saying
1)Initialization commands cannot be evaluated
2)error in evaluating system parameters
How can I overcome this problem... please provide the suggestions or mail to

02 Nov 2014 Yuewu

Yuewu (view profile)

01 Nov 2014 Alaeddine

nice work. Sir i just want to know more informations about the inverter and the VSC converter.this is my email:

Comment only
19 Oct 2014 Durga oli

My problems are similar
I am getting errors saying
1)Initialization commands cannot be evaluated
2)error in evaluating system parameters
How can I overcome this problem...

Comment only
12 Oct 2014 Mfundo

Mfundo (view profile)

@yuvaraj Kondaswamy depending on your OS, you can download the SDK from the windows website. Afterwhich you can follow this link Thereafter execute the SDK. I hope this helps everyone else with the query.

Comment only
09 Aug 2014 Mikhail

Mikhail (view profile)

Awesome model. Thank you so much!

06 Jul 2014 James

I am trying to run 'PVarray_Grid_PandO_avg.mdl' as a referenced model from the Kundur two area system average model 'power_pss'. I keep getting an algebraic loop error emanating from the PV array which I have unsuccessfully tried to break using rate transitions and other means...kindly provide any pointers.

06 Jul 2014 James

A bit more detail to my immediate prior post is that the model I am trying to run as a referenced model is the 'average model'.

06 Jul 2014 fri

fri (view profile)

Very good job, I have a similar work but I want to have a voltage Vref in the block MPPT instead of daty cycle can you help me thank you

02 Jul 2014 hanuma kumar

excellent work sir... but i am getting an array like "Attempt to reference field of non-structure array." can you please help me with this.. i'm also using r2011b.

23 May 2014 abdellah  
16 May 2014 momo

momo (view profile)

25 Apr 2014 bank

bank (view profile)

30 Jan 2014 sakthigokulrajan

i am running it in 2012a but still getting error . i have to go for r2011b for this can any one help

23 Jan 2014 GUNJAN

GUNJAN (view profile)

nice work.. sir when i run the model i am getting the constant duty ratio. it is not varying . what could be the resion pls. help me..

Comment only
03 Jan 2014 amira

amira (view profile)

30 Dec 2013 Francesco

excellent. I'll try to modify the model in order make simulation with time step hourly based. Could you give me any tip, please?

21 Nov 2013 Shivananda Pukhhrem

I need a help in designing the DC-DC boost converter.

Comment only
21 Oct 2013 mmhb1365

Thank You.

10 Oct 2013 SHYAM GEORGE

Thanx man.

Comment only
24 Sep 2013 mahmoud dabah

Hi all
May you help me how can I tune the dc voltage regulator and the current controller

24 Sep 2013 Karthick  
17 Sep 2013 MEHER

MEHER (view profile)

I am getting errors saying
1)Initialization commands cannot be evaluated
2)error in evaluating system parameters
How can I overcome this problem...
mail me @

Comment only
11 Sep 2013 GUNJAN

GUNJAN (view profile)

Hey, I have been trying to run the simulations but i get the following error
"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler."
i have windows'8 and it was running properly with windows-xp...pls. tell me the solution..

29 Jun 2013 mohamed

for 100 kw can you add a battry for this system please ? ,, i need it .

Comment only
27 Jun 2013 Hossein

This model just work in STC situation.
It has a wrong output in any different temperature....

Comment only
22 Jun 2013 kritika

While simulating in matlab R2008b i am getting error as shown below.someone please help me
"Failed to find 'Continuous/PID Controller' in library 'simulink' referenced by 'PVarray_Grid_PandO_avg/VSC Control1/Current Regulator/PI'."

Comment only
30 May 2013 king dota


22 May 2013 Ramachandra Rao

How does the Voltage regulator keeps DC voltage constant at 500 volts.. I really did not understand because the Vdc_ref is subtracted from Vdc_meas. Shouldnt it be the other way round.. Vdc_ref - Vdc_meas for the error input into the PI controller? Please help !

09 May 2013 Astitva

dear sir,
I m having a problem with this simulation model.
It pops up and says
1. Undefined function or variable 'Isat_array'
2. Initialization commands cannot be evaluated.
could you please respond to it, its very urgent and important.

Comment only
11 Apr 2013 GMATI

GMATI (view profile)

dear sir,
I'm fine to contact you for the first time. So, I need some help.
My big problem this days, it's the parameter that I would choose to release a boost inverter (190V to 311V with 3.2 A),
I need the parameter of L, C, Rl, Rc and R ( as load).
You can join me to mail:

Comment only
01 Apr 2013 Alireza

Hai, I have been trying to run the simulations but i get the following errors
1) "Attempt to reference field of non-structure array"
2) "Problem creating Accelerator MEX file for model 'PVarray_Grid_IncCondReg_det'."

Comment only
23 Mar 2013 Karthick

how did you arrive at the values for PI parameters in current controller, voltage controller and in phase locked loop? Did u get those values through tuning the controllers?

13 Mar 2013 praveen

Heyy guys!can anyone help me please?
I am getting errors like
this parameter has not been initialized
and undefined function and variable

Comment only
22 Feb 2013 haris

haris (view profile)

Hi guys i had implemented and worked perfect.i want to ask how we choose the gain value of di/dv + iv for the integral is 7 as i seen.

28 Jan 2013 Hadi Malek

This model is the best one that I've ever seen. Thanks

19 Dec 2012 Ayache Khadidja

I have simulate a PV cell using equations and I wanted to ghather all in a block ( subsystem)or the output will be a voltage, I have the current Ipv as output, I want to create voltage terminal to be able to associate the module and have a generator.
How can I do that?
Any idéa,

13 Nov 2012 Musheer Hadi

Hello, Please help me, how could I evaluate the panel parameters such Rs, Rp, Isat...etc..

you may contact me also at
Thanks a lot

Comment only
30 Oct 2012 Barbara Ramos

I'd like some help about the VSC converter.
I need to change the grid parameters.


Comment only
11 Oct 2012 KEUNHYE

The PV model is very useful. I have two question.
1. Simulation type is discrete of solver in power gui.
I'd like to implement at continuous of simulation type. Do you have a solution to change the solver's simulation type?
2. Why does it use discrete? I'd like to know the difference of discrete and continuous. Thank you

10 Oct 2012 Pierre Giroux

Pierre Giroux (view profile)

Hi Subesh and Buvana,
Thanks for your contribution.
The diode characteristic inside the PV Array blocks is now correctly implemented as Id=Isat*[exp(Vd/Vt)-1]. See latest update (oct. 9).

Comment only
10 Oct 2012 soumia kerr  
07 Oct 2012 Buvana Lefevre

Yes I do have MATLAB 2011b and the program runs fine.

Comment only
07 Oct 2012 piyush

piyush (view profile)

Can you confirm that its running on 2011b (if you have one copy of that version).

Comment only
07 Oct 2012 Buvana Lefevre

It could be that the version is not compatible.

Comment only
06 Oct 2012 piyush

piyush (view profile)

While simulating in matlab 2009a i am getting error as shown below.someone please help me

"Failed to find 'Continuous/PID Controller' in library 'simulink' referenced by 'PVarray_Grid_PandO_avg/VSC Control1/Current Regulator/PI'."

30 Aug 2012 Irfaan

Irfaan (view profile)


16 Jul 2012 akbar

akbar (view profile)

I try to connect this model to a diesel generator model. but it doesn't run. Can any body help me???

Comment only
05 Jul 2012 Buvana Lefevre


It looks like the Id indeed is calculated wrong. I had noticed it too.

Comment only
27 Jun 2012 Swasti Khuntia

@Prashant: Did you run it on 2011b? I guess change in MATLAB version may affect simulation !!!

25 Jun 2012 Prashant Tiwari

I tried to run this model but unfortunately i have received two errors like ,

Error in 'PVarray_Grid_IncCondReg_det/PV Array': Initialization commands cannot be evaluated.


Error evaluating parameter 'Value' in 'PVarray_Grid_IncCondReg_det/PV Array/Diode/Is': Undefined function or variable 'Isat_array'.

Could anyone help me out to resolve this problem.

Comment only
20 Jun 2012 Subesh Aryal

I just noticed something on the diode model (inside PV model). The diode current is calculated as Id = Isat*(exp(Vd/Vt-1) while it should be Id = Isat*(exp(Vd/Vt)-1). Can someone look into it? May be I am missing something here.

Comment only
11 Jun 2012 Musheer Hadi

nice work. thanx a lot sir
I need your support please because all PI blocks appear as bad links.
I need the parameters please

again thanks

01 Jun 2012 Subesh Aryal

I am doing a project similar to this. I am having a hard time trying to come up with Kp and Ki values of both voltage regulator and current regulator. I have been working on it for weeks with no luck whatsoever. Is there anyone who has looked into it and knows how to calculate those values?? Feedback is sincerely appreciated..

31 May 2012 Bole Top

can you tell me how did you calculated the Ki block in the inc cond MPPT control method? i'm trying to figure it up for a week :)

Comment only
17 May 2012 Mohamed Chakir  
10 May 2012 Patrice Brunelle

Hi Yuvaraj

Regarding the problem with C-compiler I recommend that you report the issue to the customer support service of The Mathworks.

Thanks you for your interest in the demo and to SimPowerSystem.

Comment only
09 May 2012 yuvaraj Kondaswamy

Hai, I have been trying to run the simulations but i get the following error
"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler."

I have installed the compiler. But still it's not working. Could you please let me what could be the problem? I am using the R2011b matlab version.


Comment only
09 May 2012 yuvaraj Kondaswamy

Excellent work

19 Apr 2012 Anushmita Kaushik  
09 Apr 2012 Anup Anurag

Can you please upload the files with all the values of resistances ?? and voltages ??

Comment only
04 Apr 2012 Erdal Bizkevelci  
14 Mar 2012 Suthee Kaewsongsri

Excellent job.

Comment only
06 Mar 2012 papoo

papoo (view profile)

is that possible to make a PV array model running in phasor type?
if we can not? so we can't make an integrated model using both wind turbine and PV arrays simultaneously?
I appreciate your writings in advance

Comment only
28 Feb 2012 papoo

papoo (view profile)

Perfect job,
I'm sure that anybody who sees your Simulink, wondering if you explain more on your PV Arrray block or Boost converter.
however, you did a great job,it worked properly for me.

28 Feb 2012 mahmoud

nice work
should you tell me how did you tune the pi controller?

Comment only
14 Feb 2012 Patrice Brunelle

The PVarray model was built using R2011b. It is possible that some features available in SPS 11b cannot be run in previous releases.

13 Feb 2012 Vladimir

Nice view model but I have some errors on R2007b. Is the version the run error problem?

Comment only
10 Feb 2012 Jun

Jun (view profile)

the model is very good...but when i running it..."Error in 'PVarray_Grid_IncCondReg_det/PV Array': Initialization commands cannot be evaluated."
version: 2010b
Is it because of software version?

Comment only
29 Jan 2012 janarthanan somasundaram

nice job..its not working properly when i run this

Comment only
09 Feb 2012 1.1

Fixed figure name + modified tags

09 Oct 2012 1.2

The two PV array models (detailed and average) have been updated.
Diode characteristic inside the PV Array blocks is now correctly implemented as Id=Isat*[exp(Vd/Vt)-1].
Thanks to Subesh and Buvana for raising this problem.

Contact us