Line | |
---|

1 | FlowSheet test_pso |
---|

2 | EQUATIONS |
---|

3 | f = (1 - x)^2 + 100 * (y - x^2)^2; |
---|

4 | |
---|

5 | VARIABLES |
---|

6 | x as Real (Lower = -10, Upper = 10); |
---|

7 | y as Real (Lower = -10, Upper = 10); |
---|

8 | f as Real; |
---|

9 | k as Integer; |
---|

10 | |
---|

11 | SPECIFY |
---|

12 | x = 1; |
---|

13 | y = 1; |
---|

14 | k = 1; |
---|

15 | |
---|

16 | OPTIONS |
---|

17 | Dynamic = false; |
---|

18 | |
---|

19 | end |
---|

20 | |
---|

21 | Optimization test_opt as test_pso |
---|

22 | MINIMIZE |
---|

23 | f; |
---|

24 | |
---|

25 | FREE |
---|

26 | x; |
---|

27 | y; |
---|

28 | |
---|

29 | OPTIONS |
---|

30 | Dynamic = false; |
---|

31 | FeasiblePath = true; |
---|

32 | NLPSolver ( |
---|

33 | File = "PSO", |
---|

34 | verbosity = 2, |
---|

35 | maxiterations = 100, |
---|

36 | number_of_particles = 50 |
---|

37 | ); |
---|

38 | end |
---|

39 | |
---|

40 | Optimization unificado |
---|

41 | MINIMIZE |
---|

42 | (1 - x)^2 + 100 * (y - x^2)^2; |
---|

43 | |
---|

44 | VARIABLES |
---|

45 | x as Real (Lower = -10, Upper = 10); |
---|

46 | y as Real (Lower = -10, Upper = 10); |
---|

47 | |
---|

48 | OPTIONS |
---|

49 | Dynamic = false; |
---|

50 | # FeasiblePath = true; |
---|

51 | NLPSolver ( |
---|

52 | File = "PSO", |
---|

53 | verbosity = 2, |
---|

54 | maxiterations = 100, |
---|

55 | number_of_particles = 50 |
---|

56 | ); |
---|

57 | end |
---|

**Note:** See

TracBrowser
for help on using the repository browser.