0

I am trying to solve the following system of equations in MATLAB:

S = solve([real(integral(@(r)sqrt(qn2(x+iy,r)),0.6,1)/pi) == 1, imag(integral(@(r)sqrt(qn2(x+iy,r)),0.6,1)/pi)== 0], [x, y])

Where qn2 is a function handle. MATLAB has trouble because it is not happy evaluating the integral due to the fact that $x$ and $y$ have to be symbolic.

I am using MATLAB as it is a lot faster at numerically evaluating the integral that Mathematica, Maple etc.

Any advice on how to best solve these would be great!

  • Whats the problem with the being symbolic? If you want to solve numerically, then you shoudl use something else than solve, like: http://uk.mathworks.com/help/optim/ug/fsolve.html – Ander Biguri Dec 08 '14 at 11:16
  • Use `int` rather `integral`, it does symbolic integration, although I'm not sure whether it will work with `solve`. If it doesn't then I think you will have to use a numerical method such as `fsolve` like Ander suggested. – David Dec 08 '14 at 11:53
  • Thanks a lot - I realised (independently) that fsolve would do exactly the job I wanted to do. Thanks a lot for the help! – OmniJames Dec 08 '14 at 15:31

0 Answers0