Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Higher order derivatives in the RF interface
Posted 12 apr 2011, 04:31 GMT-4 RF & Microwave Engineering, Parameters, Variables, & Functions Version 4.1, Version 4.2a 15 Replies
Please login with a confirmed email address before reporting spam
I am solving a scattering problem using the scattered field formulation in the RF module.
I would like to compute a second spacial derivative of the electric field:
d(d(relEx,x),x)
Unfortunately, this second derivative always gives zero, which is not the expected result. The first derivative works fine.
According to the doc, the order of the shape functions needs to be one higher than the highest order derivative that can be computed from it. So in my case I set the "Element order" in the advanced tap for the RF module in Comsol 4.1 to "Cubic" (it was set to "Quadratic" by default). Unfortunately, it still doesn't work.
In the documentation it says "Some physics interfaces use special element types or a reduced element order for some of the field variables". Does anyone know if the scattered electric field is one of these variables for which the element order has been reduced? And if so, is there any way to still get the second derivative for it?
Thanks!
Please login with a confirmed email address before reporting spam
Have you tried to plot Exxx = d(d(Ex)/dx)/dx ?, if yu solve for E =(Ex,Ey,Ez) then these should be the quickest way to access them. Since the dependent variable is E, one could believe that the second derivative is there, but perhaps not (linked to curl shape element solving ?)
But I agree Exxx and dExx,x) both gives "0" for my first test. I believe this has been discussed before, try a search on the Forum. But I cannot remeber what were the outcome
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Thanks for your reply.
In your reply, when you wrote d(d(Ex)/dx)/dx did you mean that I should type d(d(Ex,x),x)? The syntax d(d(Ex)/dx)/dx triggers an error on my installation of comsol 4.1.
I have read more about how the shape functions work, but still haven't found the answer. I did learn that the electric field is stored in vector type shape functions rather than Lagrange shape functions. Also, vector shape functions appear to not allow for derivative recovery using the ppr (polynomial-preserving recovery) operator, which may be used when working with Lagrange shape functions that have a lower order than the derivative one seeks to compute. However, I did set the 'element order' for the electric field to cubic, which should allow for a second derivative to be evaluated.
By the way, the expression I would ultimately like to evaluate is del^2*E, which is a vector v with components
v1=Ex,xx+Ex,yy+Ex,zz,
v2=Ey,xx+Ey,yy+Ey,zz,
v3=Ez,xx+Ez,yy+Ez,zz.
Please let me know if you have any other ideas!
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
If that is true, then may be you can simply export all the field values to Matlab and compute the derivative there. If it is possible in context of the problem you are trying to solve.
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
This is because the vector element family ("shcurl") in COMSOL only defines first order spatial derivatives for postprocessing. A workaround is to define a second field (u1,u2,u3) using Lagrange elements and assign (Ex,Ey,Ez) to it. You can of course also assign first order spatial derivatives of E to (u1,u2,u3) - in that case you can also use vector elements for (u1,u2,u3).
In general, higher order derivatives tend to be quite noisy.
Best regards,
Magnus Olsson
COMSOL
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
my notation effort was to make it less ambiguous, may not have managed. With COMSOL the diff() operator is d(,) see the doc
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
You can get your higher order derivatives if you introduce a new PDE: (1D) u=d(d(T,x),x)
-> add PDE coefficient form
a=1
f=d(d(T,x),x)
leftover coefficients =0
then you can get your 3rd and 4th order x-derivatives by 'ux' respectively 'uxx'
have a look at the attached file (V3.5a) with a 1D example.
But still, I don't understand, why it isn't possible to get a 3rd order derivative, if quintic order lagrange elements are used.
regards
edit: some were faster :)
Attachments:
Please login with a confirmed email address before reporting spam
In v4.1.0.85 it gives this:
OK up to third derivative, 4th has a scaling issue ?
each derivative is divided by 2*pi*freq for normalization.
Why is TT=PDE of Txx renormalized to 1? ===> it's not, I was too quick, I forgot about my renormalization ;)
But why is TTxx at *5 the expected amplitude ===> not understood
--
Having (less?) fun COMSOLing
Ivar
Attachments:
Please login with a confirmed email address before reporting spam
indeed, the 4th derivation is too high (approx. 5 times). If I switch to quartic elements for 'T', there is no 'scaling' issue anymore. -> Txxxx/((2*pi*f)^4)=T
So it's a numeric issue?!?
That's what you mentioned?
Having (even more!) fun COMSOLing ;)
Attachments:
Please login with a confirmed email address before reporting spam
I agree using quadratics you can get 4th derivative, but do you then really need "TT", the second PDE solution
This does not fully convince me (yet) for the second PDE I'm using for TT
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
what do you mean? I never used 'TT'. My new dependent variable for my PDE is 'u'. It's a converting problem from 3.5 to 4.1?
Even though you use quartics, you can't get the 4th derivative out of the original variable 'T', because 'd(Txx,x)' and 'd(d(Txx,x),x)' are always zero. Therefore I have to introduce a new PDE ('u').
best regards
Please login with a confirmed email address before reporting spam
Sorry, when translating to 4.1 I mixed up u and u2, so I renamed them T and TT. Then as I was playing with the shape functions of u2 or my TT I did not manage to improve things, what I forgot was that the source is u (or my T) and I did only leave it as a quadratic.
Now it could be that in V4 the higher derivatives with d(uxx,x) are calculated correctly, I will have to check so one do not need to add the PDE, it would be rather logical (for me) that a higher order shape function allows to take higher derivatives without any additional PDE artifact
--
Anyhow, having fun Comsoling
Ivar
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.
Suggested Content
- KNOWLEDGE BASE How do I solve a PDE with space derivatives of order higher than two?
- KNOWLEDGE BASE Resolving Time-Dependent Waves
- BLOG Image Denoising and Other Multidimensional Variational Problems
- BLOG Introduction to Modeling Soap Films and Other Variational Problems
- FORUM Higher Order Spacial Derivatives