Obtaining and plotting eigenvalues and eigenvectors

280 views
Skip to first unread message

Bardhyl Beka

unread,
Jun 20, 2021, 12:40:30 PM6/20/21
to Dedalus Users

Hello everyone,

I’m an undergraduate student of physics and would like to write my thesis, using Dedalus code, but I’m barely beginning, so forgive me if my questions are badly formulated, or don’t make sense.

Right now, I’m trying to reproduce the result from the paper, I’m attaching (some of the pages), the system of equations (48)-(53).

So, far, I have only the initial steps (script attached): Created a domain, added the equations and some boundary values. I’m trying to plot the eigenvalues (real and imaginary part, as in paper, and possibly the eigenvectors) against the vertical wavenumbers, but I’m not sure how to proceed. How to get the vertical wavenumbers and how to do the plot? Could you help me with the code, or a sketch? I think that because of the substitution dz(A) -> i kz A, the system now is an algebraic system. I’m thinking that maybe I need to define a function that has kz as variable and define the problem inside?  

I didn’t know how to get the kz values, so I set it as a parameter, kz=1.

In addition, when I try to create an Eigenproblem object using EP=Eigenproblem(das) (last line), I get the error “name 'r' is not defined”.

Among others, I would like to produce a figure like fig 1 on the paper.

Any help or suggestions are greatly appreciated.

 

Thank you.

trial(for Das).py
das_cropped.pdf

Bardhyl Beka

unread,
Jun 20, 2021, 2:08:24 PM6/20/21
to Dedalus Users
I figured that the error I was getting on the   EP=Eigenproblem(das) command I was getting was because of my orders of r and z on the domain. Now that I changed the order, I'm not getting that error, but instead, in the next line,  EP.solve(sparse=False), I'm getting the error "ValueError: Pencil [0, 0] has 14 equations for 10 variables." . Trying to figure this out. I'm attaching the updated script. Sorry if this is unnecessary information. Again, any help is greatly appreciated....
trial(for Das).py

Keaton Burns

unread,
Jun 21, 2021, 10:16:47 AM6/21/21
to dedalu...@googlegroups.com
Hi Bardhyl,

You have two options/approaches for setting the Fourier wavenumber with solving eigenvalue problems in Dedalus.  The first is to use a multidimensional domain that includes Fourier bases, as you’ve done here, and then solve the EVP for a specific “pencil” which corresponds to a specific Fourier wavevector.  In this case, you don’t want to define any substitutions for “dz” since that will correspond to the regular differentiation operator for the “z” Fourier basis.

The second option is to make a one-dimensional domain (only retaining the Chebyshev dimension), using parameters to define the Fourier wavenumbers for the dimensions you’ve removed, and then using substitutions to replace those Fourier differentiation operators with e.g. “1j*kz”.  This option is a bit more flexible since it lets you set arbitrary values for the Fourier wavenumber.  I think this approach is also required when using the eigentools package for automatic spurious-mode rejection.

I’d recommend giving it another try this way first, and I’d definitely recommend making use of the substitution rules to clean up the equations, and then we can go from there if there are still issues.

Best,
-Keaton
--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/9b463a9b-a0ef-4f6d-9963-b0cc67ceb5f1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages