genetic algorithm
Show older comments
Hello
I want to solve a optimal problem by genetic algorithm:
A system has one thermal plant and one hydro plant. The input - output characteristic of the thermal plant is:
F = 0.00035PT2 + 0.4PT + 3 Btu/h
The input - output characteristic of the hydro plant is:
W = 0.0015PH2 + 0.8PH + 2 m3/s
The daily water consumption of the hydro plant is:
WΣ = 1.5 × 107 m3
The load demand of the system is:
From 0 o'clock to 8 o'clock: 350MVA.
From 8 o'clock to 18 o'clock: 700MVA.
From 18 o'clock to 24 o'clock: 500MVA.
The power output limit of the thermal plant is: 50 ≤ PT ≤ 600 MW
The power output limit of the hydro plant is: 50 ≤ PH ≤ 450 MW
I wrote code as following but its result is wrong. Please help me as soon as possible. Thank you very much
------- (function ga.m) -------
ObjectiveFunction = @simple_fitness;
nvars = 2;
LB = [50 50];
UB = [600 450];
ConstraintFunction = @simple_constraint;
options = gaoptimset('MutationFcn',@mutationadaptfeasible);
options = gaoptimset(options,'PlotFcns',{@gaplotbestf,@gaplotmaxconstr},'Display','iter'); [x,fval] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB,ConstraintFunction,options)
------- (function simple _fitness.m) -------
function y = simple_fitness(x) y = 0.00035*x(1)^2 + 0.4*x(1)+ 3;
------ function simple_constraint.m ------
function [c, ceq] = simple_constraint(x)
c = [x(1)+x(2)-350; (0.0015*x(2)^2 + 0.8*x(2) + 2)*3600-1.5*10^7/24];
ceq = [];
1 Comment
Walter Roberson
on 22 Oct 2011
You didn't really ask a question: you just said that the output was wrong.
Answers (1)
Categories
Find more on Heat Transfer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!