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.

Time-Variant Boundary Conditions on Comsol 4?

Please login with a confirmed email address before reporting spam

Hello,
I was just wondering how one creates transient boundary conditions in COMSOL 4? I am doing a simulation where I am just trying to vary the voltage on a metal plate, and I used the "electric currents" physics under the AC/DC module. For the plate's initial values, I did 1*(t<.5) - 10*(t>=.5), and solved for time range(0,.1,1); however, the solution looks like it is only looking at V = 1 for the entire duration of the simulation (after t>.5 the plate still has V = 1 and not -10) So I was just wondering if there was another place where I was supposed to edit values when I want to do a voltage pulse like that. Thanks in advance!

7 Replies Last Post 2011年6月16日 GMT-4 19:44
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 14:29
It looks like you are confusing initial conditions and boundary conditions. An initial value cannot be a function of t.
It looks like you are confusing initial conditions and boundary conditions. An initial value cannot be a function of t.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 15:00
Ahh, okay. So when I right click on the physics tab under my model (in my case "Electrical Currents (ec)"), I'd want to use the conditions with the purple thingy-mabob plastered on the white domain, instead of just the domain?

If so, they tell me I have a singularity at roughly 125 us with the function when I did:
1e-6* (t<125e-6) + 1*(t>125e-6 && t<375e-6)

on the appropriate BOUNDARIES this time and not the initial conditions. So I assume I'll need a ramp-up to 1V? I was wondering how this could be achieved, because when I try to multiply the latter term by a function of t, it tells me that the "deduced units" is in time. I vaguely recall that in the comsol 3 versions, one was able to multiply boundary conditions by t without worrying about the units (i.e. COMSOL would see 1*t as units of volts, even though it appears to be in time)?

Also, I'm fairly new to COMSOL 4, and was wondering if there are very detailed tutorials on the transient stuff (I haven't been able to find any--well, at least not for COMSOL 4, even in the COMSOL manual)?
Ahh, okay. So when I right click on the physics tab under my model (in my case "Electrical Currents (ec)"), I'd want to use the conditions with the purple thingy-mabob plastered on the white domain, instead of just the domain? If so, they tell me I have a singularity at roughly 125 us with the function when I did: 1e-6* (t125e-6 && t

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 15:42
Yes, we don't recommend using boolean expressions for quantities that vary in time. The solvers don't like that - Try computing the time derivative of such an expression!
Instead you can use smoothed step functions. Creating such functions is highly automated in the v4.x releases. Just go to Definitions>Functions and you'll see how it works.

Regarding your other point, the behavior of functions is different depending on the version you're using. In version 4.1 and earlier, functions always took unitless arguments and returned unitless outputs.
Starting at v4.2 you can specify units for your function arguments and outputs if you wish.

You shouldn't enter an expression with dimensions of time in a text field where the software is expecting a voltage. That's an error on your part that the software will detect and let you know about.
Yes, we don't recommend using boolean expressions for quantities that vary in time. The solvers don't like that - Try computing the time derivative of such an expression! Instead you can use smoothed step functions. Creating such functions is highly automated in the v4.x releases. Just go to Definitions>Functions and you'll see how it works. Regarding your other point, the behavior of functions is different depending on the version you're using. In version 4.1 and earlier, functions always took unitless arguments and returned unitless outputs. Starting at v4.2 you can specify units for your function arguments and outputs if you wish. You shouldn't enter an expression with dimensions of time in a text field where the software is expecting a voltage. That's an error on your part that the software will detect and let you know about.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 17:09
So I put in a rectangle pulse (lower limit = 0, upper limit = 1, size of transition = .1), but how do I have this rectangular pulse be a boundary condition? A lot of the things I've googled just tell me about these functions, but don't go into exactly how I'd apply the functions into a boundary condition? For example, I want the pulse to be 0 for the first 125 us, then 1 for the next 250 us, then 0 again for an electric potential at some boundary. I have the rectangular function under definitions (rect2), and I have Electric Potential 1 for the boundary condition, but how do I put them together?

I tried putting "rect2" under V_0 in the electric potential, under "Electrical Currents (ec)" in the AC/DC module, but it tells me that "rect2" is an unknown variable. I then tried "rect2()", but then it told me I'm supposed to have an argument for the function, except I'm not quite sure what the input refers to.
So I put in a rectangle pulse (lower limit = 0, upper limit = 1, size of transition = .1), but how do I have this rectangular pulse be a boundary condition? A lot of the things I've googled just tell me about these functions, but don't go into exactly how I'd apply the functions into a boundary condition? For example, I want the pulse to be 0 for the first 125 us, then 1 for the next 250 us, then 0 again for an electric potential at some boundary. I have the rectangular function under definitions (rect2), and I have Electric Potential 1 for the boundary condition, but how do I put them together? I tried putting "rect2" under V_0 in the electric potential, under "Electrical Currents (ec)" in the AC/DC module, but it tells me that "rect2" is an unknown variable. I then tried "rect2()", but then it told me I'm supposed to have an argument for the function, except I'm not quite sure what the input refers to.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 17:12
Have you tried rect2(t)?
Have you tried rect2(t)?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 18:30
It says: "unexpected unit of input."

I don't really understand what rect1(t) does specifically? In the function rect1, I chose an upper and lower limit, but the x-axis (I'm assuming time), is automatically chosen to be -2 to 1. So if I were to put rect1(t), where in my simulation, t goes from 0 to say 600 us, how will the actual voltage waveform look?

Are the x-axis values automatically scaled to the timeframe we specified for our simulation, and if that is the case, how come the x-axis for rect1 changes when I change the transition zone? Or is t literally substituted onto rect1(t), such that if I specified a simulation time from range(0,6e-6,600e-6), then putting rect1(t) into the boundary voltage input will give me only that portion of rect1(t) (i.e. the x-axis in rect1(t) is literal and not scaled)?
It says: "unexpected unit of input." I don't really understand what rect1(t) does specifically? In the function rect1, I chose an upper and lower limit, but the x-axis (I'm assuming time), is automatically chosen to be -2 to 1. So if I were to put rect1(t), where in my simulation, t goes from 0 to say 600 us, how will the actual voltage waveform look? Are the x-axis values automatically scaled to the timeframe we specified for our simulation, and if that is the case, how come the x-axis for rect1 changes when I change the transition zone? Or is t literally substituted onto rect1(t), such that if I specified a simulation time from range(0,6e-6,600e-6), then putting rect1(t) into the boundary voltage input will give me only that portion of rect1(t) (i.e. the x-axis in rect1(t) is literal and not scaled)?

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月16日 GMT-4 19:44
It is indeed literally substituted.
Since you're starting out with the software, I strongly encourage you to read through the software's manuals (first and foremost the User's Guide for the core package), work through some of the tutorials in the model library and to consider attending a COMSOL training course to speed up your learning curve.
It is indeed literally substituted. Since you're starting out with the software, I strongly encourage you to read through the software's manuals (first and foremost the User's Guide for the core package), work through some of the tutorials in the model library and to consider attending a COMSOL training course to speed up your learning curve.

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.