Calculation of derivatives of a eigenmode #955
Answered
by
kinnala
HelgeGehring
asked this question in
Q&A
-
How would I apply an operator like I've tried to calculate it like def calculate_hfield(basis, xs, beta):
xs = xs.astype(complex)
@BilinearForm(dtype=np.complex64)
def aform(e_t, e_z, v_t, v_z, w):
return (-1j * beta * e_t[1] + e_z.grad[1]) * v_t[0] \
+ (1j * beta * e_t[0] - e_z.grad[0]) * v_t[1] \
+ e_t.curl * v_z
a_operator = aform.assemble(basis)
@BilinearForm(dtype=np.complex64)
def bform(e_t, e_z, v_t, v_z, w):
return dot(e_t, v_t) + e_z * v_z
b_operator = bform.assemble(basis)
return scipy.sparse.linalg.spsolve(b_operator, a_operator @ xs) When I use this, the result looks like The x-component of the result looks fine, the y-component seems wrong and should look more like |
Beta Was this translation helpful? Give feedback.
Answered by
kinnala
Nov 8, 2022
Replies: 1 comment 14 replies
-
What are you plotting there? The magnitude of the complex number? |
Beta Was this translation helpful? Give feedback.
14 replies
Answer selected by
HelgeGehring
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are you plotting there? The magnitude of the complex number?