0

I have an integral that looks like that:

enter image description here

I want to the values of ai that minimize H.

I am trying to replicate the example from a book (example 8.1), where the authors say they used GA/fminsearch in MATLAB.

I am not very familiar with MATLAB, but I tried (with no success) to solve it there. I am not sure if I should (or if I can) pass a symbolic equation into fminsearch.

Pedro Alencar
  • 1,049
  • 7
  • 20

1 Answers1

0

Solution found!

int_term = @(a) integral2(@(u,v) exp(-a(1)*u - a(2)*u.^2  - a(3)*v ...
    - a(4)*v.^2 - a(5)*u.*v),0,1,0,1);

a0 = [1,1,1,1,1]; 

obj_fun = @(a) int_term2(a);
a_sol = fminsearch(obj_fun2, a0)
Pedro Alencar
  • 1,049
  • 7
  • 20