Group Abstract Group Abstract

Message Boards Message Boards

0
|
7K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to optimize a function over parameter under integral

Posted 10 years ago

Hi everyone. Any help is appreciated. Here is my problem. I need to maximize the largest eigenvalue of square matrix (looking for spectral radius). Matrix elements depend on the integral of the product of two associated Legendre functions in numerator and optimization parameter in denominator as follows:

enter image description here

In my code (below) I use NMaximize option to find global maximum over lambda. In all the examples I could find in Mathematica Help this maximization procedure is used only with explicitly defined functions, but not like in my case with the optimization parameter in the integrand. Optimization procedure complains about evaluating integral to non-numerical value without giving any result. Strangely enough, I can easily plot the eigenvalue over optimization parameter by substituting NMaximize with Plot . Symbolic integration is not practical already for 3 by 3 matrix. Any ideas how to overcome this difficulty? Thanks. I use Mathematica 10.0.2.0.

M = 0;
Lmax = 2;

NMaximize[
 Max[Abs[Eigenvalues[
    Table[If[
      Mod[i + j, 2] == 0, (1/\[Lambda])^2*
       NIntegrate[(
        LegendreP[i, M, x]*LegendreP[j, M, x])/((1/\[Lambda])^2 + 
         x^2), {x, 0, 1}], (1/\[Lambda])*
       NIntegrate[(
        x*LegendreP[i, M, x]*LegendreP[j, M, x])/((1/\[Lambda])^2 + 
         x^2), {x, 0, 1}]], {i, M, Lmax}, {j, M, Lmax}]]]], \[Lambda]]
POSTED BY: Oleksandr Zelyak
2 Replies

Thanks a lot Sean. This is what I've been looking for.

POSTED BY: Oleksandr Zelyak

Please see this tutorial:

http://support.wolfram.com/kb/12502

It covers how to define a function and control the order of evaluation.

You should define a function for NMaximize to maximize the way it shows in the linked tutorial.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard