Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
21.06.2010, 07:48 GMT-4
Hi,
you can enter any equation in the postprocessing. So if you have a vector field A=(Ax, Ay, Az) and a vector field B=(Bx, By, Bz) just enter the expression AxBx+AyBy+AzBz. You can also define an expression like dotproduct=AxBx+AyBy+AzBz and use it in postprocessing or anywhere else.
You are not restricted to the suggestions COMSOL gives you. You can use any variable, internal ones and the expressions you define yourself.
Regards
Edgar
Hi,
you can enter any equation in the postprocessing. So if you have a vector field A=(Ax, Ay, Az) and a vector field B=(Bx, By, Bz) just enter the expression AxBx+AyBy+AzBz. You can also define an expression like dotproduct=AxBx+AyBy+AzBz and use it in postprocessing or anywhere else.
You are not restricted to the suggestions COMSOL gives you. You can use any variable, internal ones and the expressions you define yourself.
Regards
Edgar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
21.06.2010, 08:02 GMT-4
Thank you for your response Edgar. I wonder how I missed out on that? :)
Thank you for your response Edgar. I wonder how I missed out on that? :)
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
21.06.2010, 12:51 GMT-4
Hi
there are still some subtilities for complex values, check the "realdot()" operator, usefull among other for EM/RF fields, but also in other cases
Have fun Comsoling
Ivar
Hi
there are still some subtilities for complex values, check the "realdot()" operator, usefull among other for EM/RF fields, but also in other cases
Have fun Comsoling
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
23.06.2010, 10:43 GMT-4
Thanks Ivar for suggestion. Seems useful, like always :)
Thanks Ivar for suggestion. Seems useful, like always :)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
31.05.2011, 14:48 GMT-4
check the "realdot()" operator
the relevant section from 4.0a,
The Realdot Operator
• The expression realdot(a,b) treats complex numbers a and b as if they were real-valued vectors of length 2 and returns their dot product. You can also think of the operator call as a shorthand form of real(a*conj(b)). This expression, however, is not an analytical function of its complex arguments and therefore has no unique partial derivatives with respect to a and b.
• The difference between realdot(a,b) and real(a*conj(b)) is that the partial derivatives of the former with respect to a and b are defined as conj(b) and conj(a), respectively, while for the latter expression, the partial derivatives are real(conj(a)) and real(a).
• The difference between the partial derivative definitions is important during sensitivity analysis of frequency-response problems (scalar or vector Helmholtz equations).
• Common objective function quantities like power and energy must be redefined in terms of realdot(a,b) rather than real(a*conj(b)) for the sensitivity solver to compute correct derivatives. This applies also to the absolute value, abs(a), via the definition |a|^2 = realdot(a,a).
[QUOTE]
check the "realdot()" operator
[/QUOTE]
the relevant section from 4.0a,
The Realdot Operator
• The expression realdot(a,b) treats complex numbers a and b as if they were real-valued vectors of length 2 and returns their dot product. You can also think of the operator call as a shorthand form of real(a*conj(b)). This expression, however, is not an analytical function of its complex arguments and therefore has no unique partial derivatives with respect to a and b.
• The difference between realdot(a,b) and real(a*conj(b)) is that the partial derivatives of the former with respect to a and b are defined as conj(b) and conj(a), respectively, while for the latter expression, the partial derivatives are real(conj(a)) and real(a).
• The difference between the partial derivative definitions is important during sensitivity analysis of frequency-response problems (scalar or vector Helmholtz equations).
• Common objective function quantities like power and energy must be redefined in terms of realdot(a,b) rather than real(a*conj(b)) for the sensitivity solver to compute correct derivatives. This applies also to the absolute value, abs(a), via the definition |a|^2 = realdot(a,a).
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
12.06.2012, 18:23 GMT-4
What if I have a parametric solution, and I want to calulate the dot product of the complex E, from two solutions?
Is the following expression right?
real= real ( with(1,Ex)*conj(with(2,Ex)) + with(1,Ey)*conj(with(2,Ey)) + with(1,Ez)*conj(with(2,Ez)) );
imaginary= imag ( with(1,Ex)*conj(with(2,Ex)) + with(1,Ey)*conj(with(2,Ey)) + with(1,Ez)*conj(with(2,Ez)) );
What if I have a parametric solution, and I want to calulate the dot product of the complex E, from two solutions?
Is the following expression right?
real= real ( with(1,Ex)*conj(with(2,Ex)) + with(1,Ey)*conj(with(2,Ey)) + with(1,Ez)*conj(with(2,Ez)) );
imaginary= imag ( with(1,Ex)*conj(with(2,Ex)) + with(1,Ey)*conj(with(2,Ey)) + with(1,Ez)*conj(with(2,Ez)) );
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
13.06.2012, 02:41 GMT-4
Hi
I believe so, or you could use the realdot() operator, but I do not believe your equation writing will be simpler
It is a pitty we cannot write out the vector product in a more compressed way
--
Good luck
Ivar
Hi
I believe so, or you could use the realdot() operator, but I do not believe your equation writing will be simpler
It is a pitty we cannot write out the vector product in a more compressed way
--
Good luck
Ivar