You are on page 1of 41

STTP_SPECTRA@SVNIT

July 08, 2015

Implementation of
Optimization Algorithms using
LabVIEW:
Applications in Photovoltaics

Vipul Kheraj
Department of Applied Physics,
Sardar Vallabhbhai National Institute of Technology
(SVNIT), Surat

Outline of the Talk


Introduction to LabVIEW
How to programme in LabVIEW?
Genetic Algorithm (a quick intro)
Implementation of GA for a simple problem
ARC design using GA
A brief intro to TLBO
Solar Cell parameters using TLBO

What is LabVIEW?
Laboratory

Virtual

Instrument

Engineering

Workbench
Graphical Programming Language for Engineers &
Scientists
Powerful

Software

tool

for

Designing

Test,

Measurement & Control Systems


Development

Platform

for

Automation,

Interfacing, Data Acquisition & Analysis

Why LabVIEW?
Provides Complete Integrated Environment to...
Interface With Real-World Signals
Analyze Data for Meaningful Information
Display Results in Flexible Manner

High-Level, Application Specific Development Tools


and Libraries
Built-In Data Processing, Data Analysis And Storage
Functions
Less Software Complexities

How to make a LabVIEW Programme?

1st T: LabVIEW Terminology


LabVIEW Programs are Called Virtual Instruments
(VIs)
A VI Consists of
Front Panel
Controls (Inputs)
Indicators (Outputs)

Block Diagram
Programming Codes for Front Panel
Wiring for Data Flow

Controls, Functions and Tools Palettes

DEMO

VI Front Panel
Panel Toolbar

Boolean
Control

Double
Indicator

Waveform Graph

VI Block Diagram
Thermometer
Terminal
Call to
subVI
Temperature
Graph

Knob
Terminal

Stop Loop
Terminal

Numeric
Constant
While Loop

Stop Button
Terminal

Control Palette
(Place items on the
Front Panel Window)
Control:
Numeric

Customize
Palette
View

Indicator:
Numeric Slide

Function Palette
(Place items on the
Block Diagram Window)

Structure:
While Loop

Status Toolbar

Run Button
Continuous Run Button
Abort Execution

Additional Buttons on the diagram toolbar


Execution Highlighting Button
Retain Wire Values Button
Step Function Buttons

2nd T: LabVIEW Tools


Tools can be mainly divided in to Four
parts according to their roles
Data Input/Output
Functions
Loops
Decision making tools

Loops
While Loops

While Loop

For Loops

For Loop

terminal counts iteration


Always runs at least once
Runs until stop condition is
met to

terminal counts
iterations
Run according to input N
of count terminal

Decision Making in LabVIEW


Case Structure

Select

Data Types in LabVIEW

3rd T: Programming Techniques


Dataflow Programming
Creating an Array
Shift Register
Local Variables
Building Arrays with Loops
Create SubVI
Debugging Techniques

Dataflow Programming
Block diagram execution
Dependent on the flow of
data
Block diagram does NOT
execute left to right

Node executes when


data is available to ALL
input terminals
Nodes supply data to
all output terminals
when done
Useful to introduce
time delay

Creating an Array
From the ControlsModernArray, Matrix,
and Cluster subpalette, select the Array
icon.

Drop it on the Front Panel.

Shift Register

Useful to access data from previous iteration


Available at left or right border of loop structures
Right-click the border and select Add Shift
Register
Right terminal stores data on completion of iteration
Left terminal provides stored data at beginning of
next iteration
Initial
Value
Before
Loop
Begins

Final
Value

First
Iteration

Second
Iteration

Last
Iteration

Local Variables
Local Variables allow data to be passed between
parallel loops.
A single control or indicator can be read or written
to from more than one location in the program
Local Variables break the dataflow paradigm and should
be used sparingly

Building Arrays with Loops


becomes
(Auto-Indexing) Wirethicker

Loops can accumulate Auto-Indexing Enabled


arrays
at
their
boundaries with autoindexing
For Loops auto-index
0 1 2 3 4 5
by default
Auto-Indexing Disabled
While Loops output
only the final value by
default
Right-click tunnel and
5
enable/disable
autoOnly one value (last
indexing
Wire remains the
same size

iteration) is passed
out of the loop

Create SubVI
Enclose area to be converted into a subVI
Select EditCreate SubVI from the Edit
Menu

Debugging Techniques
Finding Errors
Click on broken Run button.
Window showing error appears.

Execution Highlighting
Click on Execution Highlighting button;
data flow is animated using bubbles.
Values are displayed on wires.

Probes
Right-click on wire to display probe and it
shows data as it flows through wire segment.
You can also select Probe tool from Tools
palette and click on wire.

The best way to learn


LabVIEW is
1.CTRL+H
2.Find Examples
3.Practice, Practice, & More
Practice
Highly Addictive!

Genetic Algorithm

The Gene is by far the most

sophisticated program around.


-

Bill Gates

Ty
pic

al

flo
wc
ha
rt

of

GA

First proposed by John Holland in the early 70s.


Stochastic global search optimization algorithm inspired
by Darwins theory of natural selection.
It is essentially mimicking the process of natural
.
evolution
underlying the
idea of survival of the fittest
where the fitness of individual is improved by successive
iteration through the processes of selection, crossover
and mutation.

Lets make a GA based


program to solve some simple
equation using LabVIEW

Lets open a new VI

Benefits of GA

Concept is easy to understand

Modular, separate from application

Many ways to speed up and improve a GAbased application as knowledge about


problem domain is gained

Substantial history and range of use

Issues with GA

Choosing parameters and operators:

representation

population size, mutation rate, ...

selection, deletion policies

crossover, mutation operators

Termination Criteria

Performance, scalability

Solution is only as good as the evaluation


function (often hardest part)

AR Coating
Design using
GA
30

GA terminology in context
of multilayer ARC design
GA terms

Equivalent AR design problem term

Initial Population

Number of randomly generated stack designs


for multilayer AR coating

Individual

A particular stack containing thickness of each


layer

Search space

Range of minimum and maximum thicknesses of


the layer

Fitness function

Averaged reflectivity of multilayer AR stack


over the wavelength range

Implementation of program

Scanning range of wavelengths

Sequence of coating materials

Number of layers

Range of layer thicknesses [dmin, dmax]

Population size

No of iterations

Define the selection, crossover and mutation operators

es
n
t
Fi

n
o
i
ct
n
u
sF

T is set of layer thicknesses and denoted as T = Ti (t1, t2, t3


tn) , where n represents the number of layers in a stack and i = 1,
2, 3.N. N represents the number of AR stacks

Initial Population

Roulette Wheel Selection Method


Selection probability of an individual is proportional to its fitness.
The fittest individuals of the population are the one with lowest average
reflectivity and will have greater chance to be selected for crossover
(recombination).

Pi
The probability of selection of ith individual,

1 / Raveraged (k , T )

1 / R
N

i 1

averaged

( k , T )

Crossover and Mutation operators

GUI of AR coating design


programme

Click here to see Program

Effects of population size

Effects of Crossover Operator

Comparison of different genetic operators in terms of reaching


global optimum

AR coating design over


wavelength range 1450-1650 nm
Multilayer Stack Design

Stack
Design

InP

Substrate

MgF2

594

Si

399

MgF2

3114

Air

Average Reflectivity
(%)
Reflectivity (%) at
Centre wavelength
(1550 nm)

0.00063 %
0.00049 %

Concluding Remarks
LabVIEW is cool!
The
real
life
scientific
and
engineering design problems can be
effectively solved using GA/TLBO
with LabVIEW as a tool!

Acknowledgement

Dr. C. J. Panchal, MSU, Baroda


SVNIT, Surat
My Departmental Colleagues
Students
Sanjay, Kinjal, Aditi, Akshay

Questions so
far
???

You might also like