Azzera filtri
Azzera filtri

Integrating the eigenvalues of a matrix...

2 visualizzazioni (ultimi 30 giorni)
w
w il 15 Gen 2012
Hi people,
The simplified version of problem is the following.
I have a complicated matrix function f(x,y). The integrand of my problem is a function of the eigen system of f(x,y). Suppose
[s,t]=eig(f(x,y));
The integrand is, for example, g(x,y)=2*s(1,2)*t(1,1), so the integration goes as
dblquad(g,-1,1,-1,1)
which cannot be carried out.
The problem is that, the quad routine converts x and y into an array of values, which are the sampling points of the routine. The command [s,t]=eig(f(x,y)) cannot be carried out, as x and y are now arrays, and the matrix function f(x,y) are no longer well defined.
So how should I proceed? Thank you a lot.
  1 Commento
w
w il 15 Gen 2012
I tried to express the integrand using the command
integrnd1=@(xp,yp)arrayfun(@(x,y)2*s*t,xp,yp);
When xp and yp are arrays of the same size, integrnd1(xp,yp) manages to yield the correct results.
However, when I tried to integrate it, the following message appears:
??? Error using ==> arrayfun
All of the input arguments must be of the same size and shape.
Previous inputs had size 13 in dimension 2. Input #3 has size 1.
Not sure what it means...

Accedi per commentare.

Risposta accettata

w
w il 16 Gen 2012
It turns out that all I had to do was, instead of using dblquad, to integrate x and y separately. The command integrnd1=@(xp,yp)arrayfun(@(x,y)2*s*t,xp,yp); should be separated into two parts, too: one for x, the other for y.

Più risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by