Skip to content

Latest commit

 

History

History

DE

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Source code for simple differential evolution (DE)

The DE algorithm is implemented with the Julia language in view of its speed. We have used Julia 1.6.2, but any version in the 1.6 series should work. We write the code in Jupyter notebook for enhanced readability. Some technical details are also explained in the notebook. The core DE algorithm is implemented in our another package DifferentialEvolution.jl (it will be installed automatically if you follow the steps below).

Note that, for a fair runtime comparison, we also implement the DE algorithm in MATLAB (since the code of competing methods is in MATLAB) to measure and report the wall time in the paper.

Overview of files in the src directory

  • models.jl:

Julia code in a text file that defines the single- and double- diode models as well as functions to compute the SSE and RMSE. These functions are used in the notebook below.

  • DE.ipynb (main notebook)
  • DE_convergence.ipynb (notebook devoted to DE convergence curves)
  • DE_sharpND.ipynb: analyze a different set of data from a Sharp ND PV module
  • CV.ipynb: compute the coefficient of variation
  • Figures produced are stored in the ./src/img subfolder.

Julia code written with Jupyter notebook that produces all DE results and figures in our paper.

  • The ./src/data subfolder contains the two benchmark datasets.

How to view the code (as well as the produced results) online

You can view these files directly on GitHub just by clicking them, e.g., the pretty notebook DE.ipynb and the associated results generated by the code on our PC therein.

How to run the code locally

  1. Make sure that you have the Julia language (version >= 1.6.0) and the IJulia kernel for Jupyter notebook installed.
  2. Download or clone this rePVest repository into your local PC.
  3. Change into the rePVest root folder and launch the Julia REPL there.
  4. Activate the current environment rePVest by
    ]activate .
  5. Instantiate the above Julia environment as specified by our Project.toml and Manifest.toml by typing the following command in Julia REPL
    ]instantiate

During the instantiation process, all required packages will be installed automatically.

  1. In another terminal like Windows PowerShell, change into the DE/src subfolder , and launch Jupyter notebook by jupyter notebook. Then the notebook fileDE.ipynb can be opened and run there.

(You may also follow the instructions given by IJulia to start the Jupyter notebook.)

How to run the code online

The great binder service supports execution of Jupyter notebooks online. You can check and run our repository directly with binder online.

Note however that the cloud PC configuration and the installed Julia version in binder are different from ours. Thus, it is expected that the results and the measured running time differ from our reported ones.

MATLAB implementation

A MATLAB implementation of the simple DE method is provided in the "DE/matlab" subfolder mainly for runtime comparison purposes.