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.

Test function for Electric field

Alberto Garcia-Cristobal

Please login with a confirmed email address before reporting spam

Hey all

I am working in the 2D piezoelectric module and I want to take weak forms of
Electric field in different direction, test(pzd.EX) and test(pzd.EY) but its showing error.

When I try by making the electric field unit less, like test(pzd.EX/1[m/V]) and test(pzd.EY/1[m/V]) ,its working
but I am not sure if its correct way.May be test function only takes numerical values only



Any idea will be of great help. Its has almost stopped my work.


Thank you

3 Replies Last Post 2013年1月3日 GMT-5 09:07
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 2012年12月24日 GMT-5 02:21
Hi

what do you mean by "works"?
First of all most operators expect unitless variables (but not all check the doc and or help). I'm not sure how it is for the" test()" operator I would have to "test" that my self ;)

If you get an orange color there is a chance the units are not accepted, an orange color means WARNING but no error (error is red, erors do not solve, warnings solve as is but the result might be scaled wrongly) that the units are inconsistent. Normally to make V in volts unitless one would write "V[1/V]" but your way is also possible, appart that you are adding a scaling factor of 1000 from your unit choice.

--
Good luck
Ivar
Hi what do you mean by "works"? First of all most operators expect unitless variables (but not all check the doc and or help). I'm not sure how it is for the" test()" operator I would have to "test" that my self ;) If you get an orange color there is a chance the units are not accepted, an orange color means WARNING but no error (error is red, erors do not solve, warnings solve as is but the result might be scaled wrongly) that the units are inconsistent. Normally to make V in volts unitless one would write "V[1/V]" but your way is also possible, appart that you are adding a scaling factor of 1000 from your unit choice. -- Good luck Ivar

Alberto Garcia-Cristobal

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年12月24日 GMT-5 07:12
Dear Ivar

Thank you for your reply. I will try to make it more clear.



What I want to do is the following.

test(pzd.EX)
and I was expecting the unit to be in [V/m] but it shows me orange color.Then I tried the following

test(pzd.EX*1[m]/V) to make the pzd.EX unit less

finally I multiplied it by '1[V/m]' to have the unit of electric field back as,

test(pzd.EX*1[m/V]) *1[V/m]

I multiplied it by '1[V/m] ' b/c I want to have the unit of electric field so that I can multiply it latter by coupling matrix element to have the final unit in Pascal and insert it as weak form contribution.

So to solve the problem I used such a way but I am not sure if my way is correct or not. I also saw the Doc and help but they both dont talk about units.



Thank you
A.
Dear Ivar Thank you for your reply. I will try to make it more clear. What I want to do is the following. test(pzd.EX) and I was expecting the unit to be in [V/m] but it shows me orange color.Then I tried the following test(pzd.EX*1[m]/V) to make the pzd.EX unit less finally I multiplied it by '1[V/m]' to have the unit of electric field back as, test(pzd.EX*1[m/V]) *1[V/m] I multiplied it by '1[V/m] ' b/c I want to have the unit of electric field so that I can multiply it latter by coupling matrix element to have the final unit in Pascal and insert it as weak form contribution. So to solve the problem I used such a way but I am not sure if my way is correct or not. I also saw the Doc and help but they both dont talk about units. Thank you A.

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 2013年1月3日 GMT-5 09:07
Hi

If you open a simple "solid" model and add a local variable atest = test(u) you will notice it gets units of "m" just as "u" and btest = test(u[1/m]) gives no units (blank and not "1")

while ctest=test(ut) gives unit of [m/s]

so the test() operator accepts units (at least in 4.3a ! for me) but does not alter the variable unit

--
Good luck
Ivar
Hi If you open a simple "solid" model and add a local variable atest = test(u) you will notice it gets units of "m" just as "u" and btest = test(u[1/m]) gives no units (blank and not "1") while ctest=test(ut) gives unit of [m/s] so the test() operator accepts units (at least in 4.3a ! for me) but does not alter the variable unit -- Good luck 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.