# How implement ON for an identity matrix?

**URL:** https://community.freefem.org/t/how-implement-on-for-an-identity-matrix/3208
**Category:** General Discussion
**Created:** [May 2, 2024, 10:41pm UTC](https://community.freefem.org/t/how-implement-on-for-an-identity-matrix/3208 "2024-05-02T22:41:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bcaval](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bcaval](https://community.freefem.org/u/bcaval)
#### Post date: [May 2, 2024, 10:41pm UTC](https://community.freefem.org/t/how-implement-on-for-an-identity-matrix/3208/1 "2024-05-02T22:41:53Z")

</div>

Dear freefem community,

I try to extract complex eigenvalue for a problem like M X" + C X’ + K X = 0.  
It yields to a block matrix like : AG \* [X, X’] = lambda\* BG\* [X,X’]  
so that…  
matrix mKK,AG,BG;  
mKK = (-1)\*KK;  
AG = [[mKK, 0], [0, Id] ];  
BG = [[ CC, MM], [Id, 0] ];

I read documentation and we have to include the ON varf in the varf linked to the stiffness matrix = AG. I have already put the ON on the varf corresponding to KK, but how can I implement the equivalent of ON for the matrix Identity (matrix Id, of same dim than KK) ?

Moreover, do you have any advice regarding the TGV parameter or the parameters that should be used in the eigenvalue command ?

Thanks in advance! 🙂

---

<div class="post-metadata">

### Author: ![bcaval](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bcaval](https://community.freefem.org/u/bcaval)
#### Post date: [May 5, 2024, 12:28pm UTC](https://community.freefem.org/t/how-implement-on-for-an-identity-matrix/3208/2 "2024-05-05T12:28:45Z")

</div>

I use the Lanczos method in order to avoid these block matrix (found on a thesis) and yields to a symmetric problem.

But it would be interesting to know what’s the simplest syntax for a ON() on an identity matrix.

Thanks.
