Skip to content

Conversation

HCA97
Copy link

@HCA97 HCA97 commented Apr 25, 2021

No description provided.

@Sinuhecas
Copy link

Hi,
Any hint to solve this equation with geneticalgorithm? Thanks in advance

def objective(x):
return x[0]x[3](x[0]+x[1]+x[2])+x[2]

def constraint1(x):
return x[0]*x[1]*x[2]*x[3]-25.0

def constraint2(x):
sum_eq = 40.0
for i in range(4):
sum_eq = sum_eq - x[i]**2
return sum_eq

initial guesses

n = 4
x0 = np.zeros(n)
x0[0] = 1.0
x0[1] = 5.0
x0[2] = 5.0
x0[3] = 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants