How to enter a matrix of variables within the linear equality function in genetic algorithm ?

조회 수: 2 (최근 30일)
My linear equality function is as shown below:
A*b*A' - c = 0
In my current problem:
A is a 1 by 4 matrix
b is a 4 by 4 matrix
c is just a constant
and A*b*A' would return a number that is equal to c
I want it to work in such a way that the genetic algorithm does not change any values in 'b' because b in my problem(resistance of lines) should remain a constant.
whereas i want the algorithm to make changes in A where A is subject to certain bounds.
I have been able to solve the question by expanding A*b*A', ie do the matrix multiplications on paper with A having variables x(4),x(5),x(6),x(7)
(x(4)*x(4)*(5.697)+x(4)*x(5)*(-1.91)+x(4)*x(6)*(-2.01)+x(4)*x(7)*(-1.77)+x(4)*x(5)*(-1.91)+x(5)*x(5)*(5.3801)+x(5)*x(6)*(-3.47)+x(4)*x(6)*(-2.01)+x(5)*x(6)*(-3.47)+x(6)*x(6)*(8.31)+x(6)*x(7)*(-2.8)+x(4)*x(7)*(-1.77)+x(6)*x(7)*(-2.8)+x(7)*x(7)*(4.6)) - c
but then the expanded version looks like this
I would like to mention that i do have initial values for x(4),x(5),x(6),x(7)
I want to tweak the variables in A keeping b as a constant while fulfilling the equality function where the variables in A are subject to upper and lower bounds
Help is very much appreciated, Thanks!

답변 (1개)

Alan Weiss
Alan Weiss 2019년 4월 15일
You should not use a genetic algorithm to solve this equation. Instead, use lsqnonlin, which accepts bound constraints.
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by