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.

Using analytical expression for implementing E field dependent conductivity

Venkatesulu Bandapalle

Please login with a confirmed email address before reporting spam

Hi, I would like model a dielectric using ec interface in 4.0a version. Model is a small cube with material 1 and 2. Material 2 is embedded in material1. For the conductivity of the material 1, I would like to use E field dependent function. After going through the manual i am assuming that model first calculates the E-field using the the material properties defined under material content. I have defined analytical function under the node named 'basic' for material 1 and used the following expression.
function name is sigma and in the expression field I had given
(10^-14)*(exp[(ec.normE/10000000)^15]+1). Find the attached file for more information.

I had given the partial derivatives also.

I do not seem to find the error. After it is run, It says that unknown variable exp in the above expression.exp is not a variable. it is just exponential. I am fairly new user.Kindly help me out where I am wrong. Thanks, Bvenkat


10 Replies Last Post 11.04.2017, 02:05 GMT-4
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 11.01.2011, 11:05 GMT-5
Hi
are you sure about those "square brackets" isnt' it

(10^-14)*(exp((ec.normE/10000000)^15)+1).

On the other side your function is rather steep, are you sure the binary floating point numeber scheme can represent it correctly ?

--
Good luck
Ivar
Hi are you sure about those "square brackets" isnt' it (10^-14)*(exp((ec.normE/10000000)^15)+1). On the other side your function is rather steep, are you sure the binary floating point numeber scheme can represent it correctly ? -- Good luck Ivar

Venkatesulu Bandapalle

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12.01.2011, 10:17 GMT-5
Hi Ivar,

Thanks for reply. Yea I have noticed square brackets is not an allowed syntax and hence removed. I have reduced the power of the variable in the function from 15 to 2 to reduce the steepness of the function. Changed the geometry dimension unit (and hence field magnitude reduces accordingly) to take care of the floating point scheme to some extent(if I had understood right). Any better way to take care of floating point scheme?.

After the above modifications still not able to execute. The following is the error message. Added a small value to ec.normE in the expression to resolve negative power of zero. Still not working.
Any idea??

Attempt to evaluate negative power of zero.
- Function: ^
Failed to evaluate temporary symbolic derivative variable.
- Variable: mod1.ec.normE@VDN$mod1.Vy
- Defined as: ((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey))))
Failed to evaluate temporary symbolic derivative variable.
- Variable: mod1.ec.sigmayy@VDN$mod1.Vy
- Defined as: ((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE))
Failed to evaluate temporary symbolic derivative variable.
- Variable: mod1.ec.Jiy@VDN$mod1.Vy
- Defined as: ((-mod1.ec.sigmayy)+((((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE)))*mod1.ec.Ey))
Failed to evaluate temporary symbolic derivative variable.
- Variable: mod1.ec.Jy@VDN$mod1.Vy
- Defined as: (((-mod1.ec.sigmayy)+((((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE)))*mod1.ec.Ey)))
Failed to evaluate expression.
- Expression: d(d((mod1.ec.Jx*test(mod1.Vx)+mod1.ec.Jy*test(mod1.Vy)+mod1.ec.Jz*test(mod1.Vz))*(dvol),{test@1}),mod1.Vy)

Regards,
Venkat



Hi
are you sure about those "square brackets" isnt' it

(10^-14)*(exp((ec.normE/10000000)^15)+1).

On the other side your function is rather steep, are you sure the binary floating point numeber scheme can represent it correctly ?

--
Good luck
Ivar


Hi Ivar, Thanks for reply. Yea I have noticed square brackets is not an allowed syntax and hence removed. I have reduced the power of the variable in the function from 15 to 2 to reduce the steepness of the function. Changed the geometry dimension unit (and hence field magnitude reduces accordingly) to take care of the floating point scheme to some extent(if I had understood right). Any better way to take care of floating point scheme?. After the above modifications still not able to execute. The following is the error message. Added a small value to ec.normE in the expression to resolve negative power of zero. Still not working. Any idea?? Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: mod1.ec.normE@VDN$mod1.Vy - Defined as: ((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod1.ec.sigmayy@VDN$mod1.Vy - Defined as: ((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE)) Failed to evaluate temporary symbolic derivative variable. - Variable: mod1.ec.Jiy@VDN$mod1.Vy - Defined as: ((-mod1.ec.sigmayy)+((((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE)))*mod1.ec.Ey)) Failed to evaluate temporary symbolic derivative variable. - Variable: mod1.ec.Jy@VDN$mod1.Vy - Defined as: (((-mod1.ec.sigmayy)+((((((0.5*((realdot(mod1.ec.Ez,mod1.ec.Ez)+(realdot(mod1.ec.Ey,mod1.ec.Ey)+realdot(mod1.ec.Ex,mod1.ec.Ex)))^-0.5))*((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))))*dmod1.mat1.def.sigma_dec.normE(mod1.ec.normE)))*mod1.ec.Ey))) Failed to evaluate expression. - Expression: d(d((mod1.ec.Jx*test(mod1.Vx)+mod1.ec.Jy*test(mod1.Vy)+mod1.ec.Jz*test(mod1.Vz))*(dvol),{test@1}),mod1.Vy) Regards, Venkat [QUOTE] Hi are you sure about those "square brackets" isnt' it (10^-14)*(exp((ec.normE/10000000)^15)+1). On the other side your function is rather steep, are you sure the binary floating point numeber scheme can represent it correctly ? -- Good luck Ivar [/QUOTE]


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.01.2011, 01:47 GMT-5
Hi

I believe its because of a scaling issue, and a numerical limitation, try to smoothen even more. Do not forget that ratios are limited to "eps" and rather sqrt(eps)

--
Good luck
Ivar
Hi I believe its because of a scaling issue, and a numerical limitation, try to smoothen even more. Do not forget that ratios are limited to "eps" and rather sqrt(eps) -- Good luck Ivar

Venkatesulu Bandapalle

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 17.01.2011, 07:42 GMT-5
Hi Ivar,

Thanks for the reply. I have tried various ways and even a simple smooth function for sigma taking care of scaling issue and eps. Still not able to solve. Please check the error message in the model (same as before).Find the model as an attachment(.mph). I have attached simple model for conveying the modelling issues. If we disable analytic fn and give sigma of air as some value say 10E-4 it successfully solves. But whatever may be the sigma fn in terms of E field it does not solve. All the material properties in the attached file are not realistic values but meaningful. Any idea how to resolve this?

second issue is about vector addition. For constant sigma, comsol gives the results. Then I had extracted data of ec.Ex,ec.Ey, ec.Ez, ec.normE and ec.Ex+ec.Ey. Here Ex,y and z are vectors.If we add then it should be not simple scalar addition.But for ec.Ex+ec.Ey comsol simply gives output addition of Ex and Ey components like scalars. Where is the confusion?

Hi Ivar, Thanks for the reply. I have tried various ways and even a simple smooth function for sigma taking care of scaling issue and eps. Still not able to solve. Please check the error message in the model (same as before).Find the model as an attachment(.mph). I have attached simple model for conveying the modelling issues. If we disable analytic fn and give sigma of air as some value say 10E-4 it successfully solves. But whatever may be the sigma fn in terms of E field it does not solve. All the material properties in the attached file are not realistic values but meaningful. Any idea how to resolve this? second issue is about vector addition. For constant sigma, comsol gives the results. Then I had extracted data of ec.Ex,ec.Ey, ec.Ez, ec.normE and ec.Ex+ec.Ey. Here Ex,y and z are vectors.If we add then it should be not simple scalar addition.But for ec.Ex+ec.Ey comsol simply gives output addition of Ex and Ey components like scalars. Where is the confusion?


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 17.01.2011, 08:09 GMT-5
Hi

I do not have access to COMSOL just now, not in my office, but I'll try to check tomorrow.

One thing though you talk about ec.Ex Ec.Ey ... for me in COMSOL notation this is the components of the gradient of E , hence dE(x,y,z)/dx , dE(x,y,z)/dy ? are there a naming interaction between COMSOl internal variables and your defined ones or am I simply missing something ?

And Comsol only give you access to scalars, or the separate scalar components of a vector, no ?

--
Good luck
Ivar
Hi I do not have access to COMSOL just now, not in my office, but I'll try to check tomorrow. One thing though you talk about ec.Ex Ec.Ey ... for me in COMSOL notation this is the components of the gradient of E , hence dE(x,y,z)/dx , dE(x,y,z)/dy ? are there a naming interaction between COMSOl internal variables and your defined ones or am I simply missing something ? And Comsol only give you access to scalars, or the separate scalar components of a vector, no ? -- Good luck Ivar

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 24.01.2011, 02:27 GMT-5
Hi

I found 2 way to avoid an error

1) set a better starting potential, if you have 0.5V on the upper electrode and 0=gnd on the base, you can also simply say the Initial conditions voltage across your air slab is 0.5[V]*(1-(z/1[m]) and it will solve.

Then why ?

the reason 2) is that the conductivity function you have defined is "=0" if there is no voltage field, and you use "0" as initial conditions. The best is to give a little offset to the "air" conductivity "eps" is enough, but "1[S/m]" is probably more realistic

By the way, you can leave COMSOL look after the derivative "automatically" in your case

--
Good luck
Ivar
Hi I found 2 way to avoid an error 1) set a better starting potential, if you have 0.5V on the upper electrode and 0=gnd on the base, you can also simply say the Initial conditions voltage across your air slab is 0.5[V]*(1-(z/1[m]) and it will solve. Then why ? the reason 2) is that the conductivity function you have defined is "=0" if there is no voltage field, and you use "0" as initial conditions. The best is to give a little offset to the "air" conductivity "eps" is enough, but "1[S/m]" is probably more realistic By the way, you can leave COMSOL look after the derivative "automatically" in your case -- Good luck Ivar

Venkatesulu Bandapalle

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 24.01.2011, 09:00 GMT-5
Hi Ivar,

Thanks for the reply. What you had suggested is working. It seems even 1*(z-1) as an initial condition for the potential is also working fine. Last week I have learnt from the support that we need to define initial voltage as some 1e-6*sqrt(x^2+y^2+z^2) to avoid the singularity.

Mvh
Venkat.
Hi Ivar, Thanks for the reply. What you had suggested is working. It seems even 1*(z-1) as an initial condition for the potential is also working fine. Last week I have learnt from the support that we need to define initial voltage as some 1e-6*sqrt(x^2+y^2+z^2) to avoid the singularity. Mvh Venkat.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.09.2011, 09:54 GMT-4

Hi

I found 2 way to avoid an error

1) set a better starting potential, if you have 0.5V on the upper electrode and 0=gnd on the base, you can also simply say the Initial conditions voltage across your air slab is 0.5[V]*(1-(z/1[m]) and it will solve.

Then why ?

the reason 2) is that the conductivity function you have defined is "=0" if there is no voltage field, and you use "0" as initial conditions. The best is to give a little offset to the "air" conductivity "eps" is enough, but "1[S/m]" is probably more realistic

By the way, you can leave COMSOL look after the derivative "automatically" in your case

--
Good luck
Ivar


Hi Ivar,

thanks for the suggestions, the 0.5V initial voltage also worked well for me. But I don't understand here the usage of that 'z'. What does it mean? Why not just '0.5[V]' but that '0.5[V]*(1-(z/1[m]))' ?

thanks again
Moyan
[QUOTE] Hi I found 2 way to avoid an error 1) set a better starting potential, if you have 0.5V on the upper electrode and 0=gnd on the base, you can also simply say the Initial conditions voltage across your air slab is 0.5[V]*(1-(z/1[m]) and it will solve. Then why ? the reason 2) is that the conductivity function you have defined is "=0" if there is no voltage field, and you use "0" as initial conditions. The best is to give a little offset to the "air" conductivity "eps" is enough, but "1[S/m]" is probably more realistic By the way, you can leave COMSOL look after the derivative "automatically" in your case -- Good luck Ivar [/QUOTE] Hi Ivar, thanks for the suggestions, the 0.5V initial voltage also worked well for me. But I don't understand here the usage of that 'z'. What does it mean? Why not just '0.5[V]' but that '0.5[V]*(1-(z/1[m]))' ? thanks again Moyan

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 23.09.2011, 10:26 GMT-4
Hi

"z" is the height parameter a voltage between two electrodes spaced by "1" would be something like V0*(1-z)
the voltage is V0 but the voltage at a height of a point in the domain would be V0*(d0-z)/d0 where d0[m] is the electrode separation distance I assumed to be "d0=1"(careful with the offsets where to put your geometry in absolute coordinates though)

--
Good luck
Ivar
Hi "z" is the height parameter a voltage between two electrodes spaced by "1" would be something like V0*(1-z) the voltage is V0 but the voltage at a height of a point in the domain would be V0*(d0-z)/d0 where d0[m] is the electrode separation distance I assumed to be "d0=1"(careful with the offsets where to put your geometry in absolute coordinates though) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 11.04.2017, 02:05 GMT-4
Hi Ivar ,
I am trying fluid structure interaction .. I want to know why the particle is getting deformed as it progresses down the channel .. Shall i attach my file? Can you help?
Hi Ivar , I am trying fluid structure interaction .. I want to know why the particle is getting deformed as it progresses down the channel .. Shall i attach my file? Can you help?

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.