# Smallest positive imaginary eigenvalue

**URL:** https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276
**Category:** General Discussion
**Created:** [May 28, 2024, 5:33am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276 "2024-05-28T05:33:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Amitkaush](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/amitkaush/32/1978_2.png) [@Amitkaush](https://community.freefem.org/u/Amitkaush)
#### Post date: [May 28, 2024, 5:33am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/1 "2024-05-28T05:33:41Z")

</div>

I am trying to solve an eigenvalue problem and I am concerned with finding the smallest positive imaginary eigenvalue.  
How to find it using EPSSolve?

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [May 28, 2024, 5:44am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/2 "2024-05-28T05:44:17Z")

</div>

See [https://slepc.upv.es/documentation/slepc.pdf#page=32:](https://slepc.upv.es/documentation/slepc.pdf#page=32:) `-eps_smallest_imaginary`. If you are only finding negative eigenvalues, I guess you’ll have to shift your problem a bit to recover the first positive eigenvalue.

---

<div class="post-metadata">

### Author: ![Amitkaush](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/amitkaush/32/1978_2.png) [@Amitkaush](https://community.freefem.org/u/Amitkaush)
#### Post date: [May 28, 2024, 7:44am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/3 "2024-05-28T07:44:10Z")

</div>

by shift do you mean using “shift” in sparams ?

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [May 28, 2024, 10:30am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/4 "2024-05-28T10:30:16Z")

</div>

No, it will be `-eps_target`. Please read SLEPc documentation.

---

<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 29, 2024, 7:27am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/5 "2024-05-29T07:27:21Z")

</div>

So, what’s the best algorithm today in Freefem++ for eigenvalue analysis ?

As I read here EPSSolve, and on the Freefem website Arpack is used. Indeed, it would be interesting to have the advices or a summary of the freefem experts.  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [May 29, 2024, 10:06am UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/6 "2024-05-29T10:06:18Z")

</div>

> As I read here EPSSolve, and on the Freefem website Arpack is used

What does that even mean?

The best algorithm will of course depend on what you are trying to solve. In FreeFEM, SLEPc is the most flexible approach (as it can solve linear, nonlinear, polynomial eigenproblems, with a variety of algorithms, Krylov–Schur, LOBPCG, power method…).

---

<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 29, 2024, 1:10pm UTC](https://community.freefem.org/t/smallest-positive-imaginary-eigenvalue/3276/7 "2024-05-29T13:10:52Z")

</div>

Sorry, I mean for linear problems like A X = lambda B X.
