The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: iteration of Lagarange optimization makes my code very slow
Replies: 5   Last Post: Apr 20, 2011 9:01 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Wenxu Li

Posts: 11
Registered: 5/13/10
Re: iteration of Lagarange optimization makes my code very slow
Posted: Apr 20, 2011 8:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Torsten <> wrote in message <>...
> On 20 Apr., 11:01, "Wenxu Li" <> wrote:
> > Hello,
> >
> > I want to solve an optimization problem stated as follows:
> >                 A(t)=a'*B(t)*a; the constraint is A(0)=1;
> > where A(t) is a scalar at each time point t, a is a vector, B(t) is a square matrix, each element of B(t) is a function of t.
> >
> > I consider to use the Lagrange method to find the optimal A(t) over a period of time, e.g. from 0 to 300.  I built the model as
> >          A(t)max=max{A(t)-lambda*(A(0)-1)}=max{a'*B(t)*a-lambda*(A(0)-1))},
> > which can be changed to a generalized eigenvalue problem as
> >                    B(t)*a=lambda*A(0)*a,
> > which can be further changed to a form
> >                   A(0)^(-1/2)* B(t)*A(0)^(-1/2)*b=lambda*b;
> >                      b=A(0)^(1/2)*a;
> > However, in oder to get A(t) over  a duration, i.e. 0 to 300,  I calculated the largest eigenvalue and corresponding eigenvector at each time step, which is very time consuming.  
> >
> > I am a new comer in this area, I could not find a more efficient way to solve the problem. Can someone suggest me a more efficient way to get A(t)?
> >
> > Many Thanks
> > lee

> I'm sorry, but I can't understand your optimization problem.
> Maybe you mean
> max: x'*B(t)*x
> s.t. ||x|| = 1
> and you want to determine F with F(t)=x'*B(t)*x for the optimum x
> vectors
> over time ?
> Best wishes
> Torsten.

Hi, Torsten
Thanks very for your reply. I am sorry that I did not explain this problem clearly.
My aim is to find a maximum value of A(t)=a'*B(t)*a, in order to create a constraint to this optimization problem, I introduced A(0)=1.
therefore, this problem will be finding a vector (a) which can give the maximum value of A(t) at each t .
s.t. A(0)=1.
here a is a vector which can be chosen arbitrarily and not limited to ||a||=1. Each element of B(t) has a form of constant*exp(constant*t+constant). B(t) is not a sparse matrix.

First, I tried to use eig() function to get an analytical form of the eigenvalues, and then I realized that it is difficult to get the analytical form and I cannot get the corresponding eigenvectors I want. Then I tried to use subs(B, t) to get B(t) for each time t and calculate the eigenvalues and eigenvectors, through this way I did find the maximum A(t) for each t, but the code is too slow.

I tried eig() and eigs() functions, but the problems are unless I use loop for each t, I cannot get the analytical form of the largest eigenvalue and thus eigenvector.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.