Finally, the initial version of this presentation is ready. This is an introduction level presentation on LaTeX -- the professional document preparation system. In addition to this presentation, I have created a project on overleaf for a practical demonstration. There are many useful online resources, my choices for interested LaTeX learners are Free & Interactive Online Introduction to LaTeX (three parts by Dr. John Lees-Miller) and TeXample.
Friday, November 27, 2015
Saturday, November 21, 2015
The Invasive Weed Optimization Algorithm: An Implemenation
I am working on implementation of the invasive weed optimization (IWO) algorithm since one year or so. The selection of this algorithm has linkage to my family business background which is very closely related with manufacture and maintain tools to support agriculture, vegetation. The original IWO algorithm was proposed in a paper by Mehrabian and Lucas (2006) with title, "a novel numerical optimization algorithm inspired from weed colonization." I have made a number of attempts to write a program code in MATALB. The basic working version is recently completed and pasted below. The algorithm has four major steps: (1) initialization, (2) reproduction, (3) spatial dispersal, and (4) competitive exclusion. The program code is pasted below.
% created by dr tariq javid as of 02-december-14
% last updated on 21-november-15
% f1 = sphere, f2 = griewant, f3 = rastrigin
clear all, clc
% --- user input
init_pop = input('number of initial population [10]: ');
iter_max = input('maximum number of iterations [100]: ');
dimn_prb = input('problem dimension [2]: ');
plnt_max = input('maximum number of plant population [15]: ');
seed_max = input('maximum number of seeds [5]: ');
seed_min = input('minimum number of seeds [0]: ');
nonl_mid = input('nonlinear modulation index [3]: ');
stdv_ini = input('initial value of standard deviation [3]: ');
stdv_fin = input('final value of standard devition [0.001]: ');
srch_ini = input('a. initial search area - lower [-40]: ');
srch_fin = input('b. initial search area - upper [-30]: ');
% --- default value
if isempty(init_pop), init_pop = 10 ; end
if isempty(iter_max), iter_max = 100 ; end
if isempty(dimn_prb), dimn_prb = 2 ; end
if isempty(plnt_max), plnt_max = 15 ; end
if isempty(seed_max), seed_max = 5 ; end
if isempty(seed_min), seed_min = 0 ; end
if isempty(nonl_mid), nonl_mid = 3 ; end
if isempty(stdv_ini), stdv_ini = 3 ; end
if isempty(stdv_fin), stdv_fin = 0.001; end
if isempty(srch_ini), srch_ini = -40 ; end
if isempty(srch_fin), srch_fin = -30 ; end
% --- function definition
f1 = @(x,y) x.^2 + y.^2; % for default values
% f2 = @(x,y) (x.^2 + y.^2)/4000 - cos(x/sqrt(2)) .* cos(y/sqrt(2)) + 1;
% f3 = @(x,y) 20 + x.^2 + y.^2 - 10 * (cos(2*pi*x) + cos(2*pi*y));
% --- initialize weeds as random numbers
weed_ini = srch_ini + (srch_fin - srch_ini).*rand(init_pop,dimn_prb)
% --- preparation of next step
temp_one = (stdv_ini - stdv_fin); temp_two = iter_max .^ nonl_mid ;
weed_pop = weed_ini;
figure, axis([-50 10 -50 10]), hold on
plot(weed_ini(:,1),weed_ini(:,2),'r^')
for iter_idx = 1:iter_max % main for loop
temp_thr = ((iter_max - iter_idx) .^ (nonl_mid)) / temp_two;
iter_now = temp_thr .* temp_one + stdv_fin;
% --- evaluate fitness of weeds
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
% --- determine number of seeds as per fitness
fit_max = min(comp_fit); fit_min = max(comp_fit);
slope = (seed_max - seed_min) / (fit_max - fit_min);
seed_cnt = zeros(size(comp_fit));
for seed_idx = 1:length(weed_pop)
seed_tmp = floor(slope * (comp_fit(seed_idx) - fit_min) + seed_min);
seed_cnt(seed_idx) = seed_tmp;
end
% --- spatial dispersal
for weed_idx = 1:length(weed_pop)
if seed_cnt(weed_idx) ~= 0 % to avoid nan and inf unexpected termination
weed_tmp = iter_now .* randn(seed_cnt(weed_idx),dimn_prb);
for seed_idx = 1:seed_cnt(weed_idx)
weed_tmp(seed_idx,1) = weed_tmp(seed_idx,1) + weed_pop(weed_idx,1);
weed_tmp(seed_idx,2) = weed_tmp(seed_idx,2) + weed_pop(weed_idx,2);
end
weed_pop = cat(1,weed_pop,weed_tmp);
end
end
% --- evaluate fitness of new population
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
% --- competitive exclusion
while length(weed_pop) > plnt_max
% --- i is index of maximum value i.e. worse fit
[~, i] = max(comp_fit);
comp_fit(i) = []; % remove maximum value from fitness
weed_pop(i,:) = []; % remove worse fit weed from population
end
% --- plot result for each iteration
plot(weed_pop(:,1),weed_pop(:,2),'b*');
end
weed_pop
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
[~, i] = min(comp_fit);
weed_idx = i
weed_sol = [weed_pop(i,1),weed_pop(i,2)]
weed_fit = comp_fit(i)
plot(weed_pop(i,1),weed_pop(i,2),'r^');
legend('initial,final','progress',2)
grid on, hold off
% created by dr tariq javid as of 02-december-14
% last updated on 21-november-15
% f1 = sphere, f2 = griewant, f3 = rastrigin
clear all, clc
% --- user input
init_pop = input('number of initial population [10]: ');
iter_max = input('maximum number of iterations [100]: ');
dimn_prb = input('problem dimension [2]: ');
plnt_max = input('maximum number of plant population [15]: ');
seed_max = input('maximum number of seeds [5]: ');
seed_min = input('minimum number of seeds [0]: ');
nonl_mid = input('nonlinear modulation index [3]: ');
stdv_ini = input('initial value of standard deviation [3]: ');
stdv_fin = input('final value of standard devition [0.001]: ');
srch_ini = input('a. initial search area - lower [-40]: ');
srch_fin = input('b. initial search area - upper [-30]: ');
% --- default value
if isempty(init_pop), init_pop = 10 ; end
if isempty(iter_max), iter_max = 100 ; end
if isempty(dimn_prb), dimn_prb = 2 ; end
if isempty(plnt_max), plnt_max = 15 ; end
if isempty(seed_max), seed_max = 5 ; end
if isempty(seed_min), seed_min = 0 ; end
if isempty(nonl_mid), nonl_mid = 3 ; end
if isempty(stdv_ini), stdv_ini = 3 ; end
if isempty(stdv_fin), stdv_fin = 0.001; end
if isempty(srch_ini), srch_ini = -40 ; end
if isempty(srch_fin), srch_fin = -30 ; end
% --- function definition
f1 = @(x,y) x.^2 + y.^2; % for default values
% f2 = @(x,y) (x.^2 + y.^2)/4000 - cos(x/sqrt(2)) .* cos(y/sqrt(2)) + 1;
% f3 = @(x,y) 20 + x.^2 + y.^2 - 10 * (cos(2*pi*x) + cos(2*pi*y));
% --- initialize weeds as random numbers
weed_ini = srch_ini + (srch_fin - srch_ini).*rand(init_pop,dimn_prb)
% --- preparation of next step
temp_one = (stdv_ini - stdv_fin); temp_two = iter_max .^ nonl_mid ;
weed_pop = weed_ini;
figure, axis([-50 10 -50 10]), hold on
plot(weed_ini(:,1),weed_ini(:,2),'r^')
for iter_idx = 1:iter_max % main for loop
temp_thr = ((iter_max - iter_idx) .^ (nonl_mid)) / temp_two;
iter_now = temp_thr .* temp_one + stdv_fin;
% --- evaluate fitness of weeds
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
% --- determine number of seeds as per fitness
fit_max = min(comp_fit); fit_min = max(comp_fit);
slope = (seed_max - seed_min) / (fit_max - fit_min);
seed_cnt = zeros(size(comp_fit));
for seed_idx = 1:length(weed_pop)
seed_tmp = floor(slope * (comp_fit(seed_idx) - fit_min) + seed_min);
seed_cnt(seed_idx) = seed_tmp;
end
% --- spatial dispersal
for weed_idx = 1:length(weed_pop)
if seed_cnt(weed_idx) ~= 0 % to avoid nan and inf unexpected termination
weed_tmp = iter_now .* randn(seed_cnt(weed_idx),dimn_prb);
for seed_idx = 1:seed_cnt(weed_idx)
weed_tmp(seed_idx,1) = weed_tmp(seed_idx,1) + weed_pop(weed_idx,1);
weed_tmp(seed_idx,2) = weed_tmp(seed_idx,2) + weed_pop(weed_idx,2);
end
weed_pop = cat(1,weed_pop,weed_tmp);
end
end
% --- evaluate fitness of new population
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
% --- competitive exclusion
while length(weed_pop) > plnt_max
% --- i is index of maximum value i.e. worse fit
[~, i] = max(comp_fit);
comp_fit(i) = []; % remove maximum value from fitness
weed_pop(i,:) = []; % remove worse fit weed from population
end
% --- plot result for each iteration
plot(weed_pop(:,1),weed_pop(:,2),'b*');
end
weed_pop
for weed_idx = 1:length(weed_pop)
comp_fit(weed_idx) = f1(weed_pop(weed_idx,1),weed_pop(weed_idx,2));
end
[~, i] = min(comp_fit);
weed_idx = i
weed_sol = [weed_pop(i,1),weed_pop(i,2)]
weed_fit = comp_fit(i)
plot(weed_pop(i,1),weed_pop(i,2),'r^');
legend('initial,final','progress',2)
grid on, hold off
Friday, November 13, 2015
15 Attributes of a Good Research Paper
The list of attributes is as follows. For an example, read [Paper].
- Motivation
- Importance
- Problem/Challenge
- Reason ... why challenging?
- Benefits
- Method
- Related Work
- Significance ... how different?
- Contribution
- Confidence
- Compare
- Discuss Results
- Limitations ... with possible solutions
- Future Direction
- Well Connected ... relevant references
Friday, November 6, 2015
From HIT to HIET on 27 February 2015
This photo is a good record when moved from Heavy Industries Taxila (HIT) to Hamdard Institute of Engineering & Technology (HIET). Right photo taken on 2015-05-30 at Karachi seaside: Muhammad Maaz. Left photo taken on 2015-02-27 at Islamabad Airport: Muhammad Maoz. I joined Hamdard University on 27 February 2015.
A session on Outcome Based Education (OBE) for HIET faculty members
A short session of about one hour for HIET faculty on outcome based education was conducted by myself and Dr. Muhammad Faisal Khan, Associate Professor; after Friday prayer on 6th November 2015. The presentation slides [Link] were selected from material provided during 2-Day International Workshop on Outcome Based Education (OBE) System held at NED UET from 27-28 October 2015 [Flyer]. Thanks to NED Photography Society for the photos below from workshop, which I have arranged in one for memory.
Tuesday, October 20, 2015
Continuing Professional Education (CPD) Activity: Python for Engineers and Scientists
I am learning Python for more than a year now. When asked for Pakistan Engineering Council (PEC) CPD courses, I decided to give a talk on Python. Alhamdullillah, this aim was fulfilled today, 2015/10/20. [LINK] Thanks to Syed Wasif Ali Shah for taking photograph.
Friday, August 7, 2015
A Presentation with Title, "Research: An Introduction"
I am learning from this book* for almost a decade now (since it was published in 2005 and now in second edition). Recently, I read chapter one, "Introduction to Research and the Research Requirements," again and prepared a presentation [Link].
* Health Promotion and Eduction Research Methods Using the Five-Chapter Thesis/Dissertation Model, Randall R. Corrrel and James F. McKenzie, Jones and Bartlett Publishers (2005).
* Health Promotion and Eduction Research Methods Using the Five-Chapter Thesis/Dissertation Model, Randall R. Corrrel and James F. McKenzie, Jones and Bartlett Publishers (2005).
Friday, July 24, 2015
Saturday, June 13, 2015
Smart Grids and Future Electric Energy Systems
I taught this MS/ME level course in Spring 2015. The primary resource for slides below is Proceedings of the IEEE special issue SMART GRID: THE ELECTRIC ENERGY SYSTEM OF THE FUTURE [Link].
## Title of Slide
01 Introduction to Smart Grid [Dr. Hamed Mohsenian-Rad]
02 Communication Technologies for Smart Grid
03 Power Line Communications
04 Smart Generation and Transmission with Coherent, Real-Time Data
05 Communications Network for Smart Grid
06 Time Synchronization & State Estimation
07 Communication Network and Control
08 Smart Grid Control System
09 Smart Distribution
10 Wind Energy Technologies in Smart Grid
11 Adaptive Stochastic Control for Smart Grid
12 Role of Energy Storage in Smart Grids
## Title of Slide
01 Introduction to Smart Grid [Dr. Hamed Mohsenian-Rad]
02 Communication Technologies for Smart Grid
03 Power Line Communications
04 Smart Generation and Transmission with Coherent, Real-Time Data
05 Communications Network for Smart Grid
06 Time Synchronization & State Estimation
07 Communication Network and Control
08 Smart Grid Control System
09 Smart Distribution
10 Wind Energy Technologies in Smart Grid
11 Adaptive Stochastic Control for Smart Grid
12 Role of Energy Storage in Smart Grids
Tuesday, April 28, 2015
Tuesday, April 21, 2015
Monday, March 16, 2015
Back to Karachi -- A Beautiful Weather Outlook
Finally, came back to Karachi with family and joined Hamdard University as Associate Professor. This photo dates 14-March-2015 location DHA.
Tuesday, February 24, 2015
Undergraduate Course Microprocessor and Interfacing Techniques (EE-303) on Piazza Website
The fall 2014 semester concluded here at HITEC University. I taught undergraduate course on Microprocessor and Interfacing Techniques (EE-303) to a class of about 160 students. In this class, I have extensively used following websites for resource delivery.
1. HITEC University Moodle -- provides link to useful material [LINK]
2. Google Drive -- to store bulky files
3. Blog [LINK] -- contains link to previous lecture slides
4. Piazza -- contains Q&As and resource links [LINK]
1. HITEC University Moodle -- provides link to useful material [LINK]
2. Google Drive -- to store bulky files
3. Blog [LINK] -- contains link to previous lecture slides
4. Piazza -- contains Q&As and resource links [LINK]
Wednesday, February 11, 2015
10 Common Mistakes in Postgraduate Level Reports
After each semester end, I have to read a lot of reports submitted by postgraduate students. Fall 2014 semester ends with 20+ reports submitted by students of the course, "GIS and Remote Sensing." After review of these reports, I have to communicate students that how they can improve their reports further (as there is always a room for it). Therefore, I come up with following list of 10 common mistakes (CMs) in submitted postgraduate reports.
CM#01: Missing page numbers.
CM#02: Figure/Table numbers are missing or do not follow a numbering sequence.
CM#03: Figure/Table does not have associated text description.
CM#04: Equations are not numbered and well-explained.
CM#05: Report contains short-sentences and incomplete sentences i.e. pharases.
CM#06: Font size changes frequently giving the impression of cut-and-paste work.
CM#07: Report has a presentation style.
CM#08: Sections and subsections are not properly numbered in the report.
CM#09: References are not numbered and not cited inside report.
CM#10: References are irrelevant and incomplete.
I suggest students to revise their reports accordingly and observe improvements by self-reflection. I strongly recommend to spend sometime on refreshing your report writing skills and ensure to adhere formatting guidelines before final submission of your future reports.
CM#01: Missing page numbers.
CM#02: Figure/Table numbers are missing or do not follow a numbering sequence.
CM#03: Figure/Table does not have associated text description.
CM#04: Equations are not numbered and well-explained.
CM#05: Report contains short-sentences and incomplete sentences i.e. pharases.
CM#06: Font size changes frequently giving the impression of cut-and-paste work.
CM#07: Report has a presentation style.
CM#08: Sections and subsections are not properly numbered in the report.
CM#09: References are not numbered and not cited inside report.
CM#10: References are irrelevant and incomplete.
I suggest students to revise their reports accordingly and observe improvements by self-reflection. I strongly recommend to spend sometime on refreshing your report writing skills and ensure to adhere formatting guidelines before final submission of your future reports.
Monday, February 9, 2015
An Implementation of Orthogonal DWT in Python
This paper [LINK] was written to implement Wavelet transform as an extension to the earlier work on Fourier transform implementation [LINK] using Python computer programming language. Two HITEC University students evaluated software code and incorporated various corrections in it. Their names are included in this paper as well.
Friday, January 30, 2015
GIS and Remote Sensing Lecture Slides
Fall 2014 semester is about to complete here at HITEC University. I taught GIS and Remote Sensing (EE-714) course to MS Electrical Engineering class. Again, it is an exciting moment for me as I fall in love with this course in 2011 which still growing day-by-day. In this post, I make all slides available on-line for access and use.
Lecture 01. [LINK] Introduction
Lecture 02. [LINK] Basic Concepts
Lecture 03. [LINK] Aerial photography
Lecture 04: [LINK] Photogrammetry -- I
Lecture 05: [LINK] Photogrammetry -- II
Lecture 06: [LINK] Sensing systems
Lecture 07: [LINK] Earth resource satellites
Lecture 08: [LINK] Visual image interpretation
Lecture 09: [LINK] Essential DIP
Lecture 10: [LINK] GIS Demystified
Lecture 11: [LINK] Coordinate space and map projection
Lecture 12: [LINK] RS and GIS integration
Additionally, on request of students past examination papers are available.
[LINK] Fall 2014 final term examination
[LINK] Fall 2014 sessional examination - 2
[LINK] Fall 2014 sessional examination - 1
[LINK] Fall 2013 final term examination
[LINK] Fall 2013 sessional examination - 2
[LINK] Fall 2013 sessional examination - 1
Friday, January 2, 2015
Welcome 2015 -- First Day of This Year at Khanpur Dam
A unique moment as first day of this year was a recreational tour. Photo below was taken by Dr. Asif Waheed of Mathematics Department, HITEC University.
Related links: | Khanpur Dame | Gandhara Castle Resort |
Related links: | Khanpur Dame | Gandhara Castle Resort |
Subscribe to:
Posts (Atom)