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.

Random Dropped Pulses when using PWM

Please login with a confirmed email address before reporting spam

I'm running a simulation where cylindrical resistive heaters are inside of an iron block. They are surrounded by a thin shell of very tiny conductivity (5e-7). One face on the cylindrical heater is defined as ground, and the other is defined as an electric potential function, ep(t). In the functions window, I have set ep(t) as the following:

2*flc2hs(mod(t,30)-5,0.5)-2*flc2hs(mod(t,30)-10,0.5)

This produces 5 second pulses of 2V which repeat every 30 seconds.
When I run my simulation, looking at the temperature of the iron block as a function of time, I can see when the pulses are on because of the spike in heat around the resistive heaters.

My problem is that COMSOL will randomly drop certain pulses on each simulation. Usually the first pulse occurs, but often the following pulses will not. If I repeat the simulation again, without changing anything at all, I will eventually get results in which I can see 3 successful pulses occur. I have yet to see the 4th pulse occur.

Is there any reason why COMSOL would choose to drop random pulses sometimes, but not all the time?
Is there something in my solver parameters that may fix this?

4 Replies Last Post 10.12.2010, 11:04 GMT-5
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 03.12.2010, 01:23 GMT-5
Hi

I suspect that you are using the solver in automatic mode, this is NOT ideal for periodic signals, as the next step is estimated from the last AND the last gradients wich might give COMSOL the feeling that we are in a steady state situation and it will propose a long step, that might again arrive at the pulse "on" state (no gradient change) and so on.

for this you have the stepping settings in the solver, either "automatic" (default but not the best for periodic signals), "strict" = the time steps you define and "intermediate" (the one I use for periodic singnals) because COSMOL tries to add an intermediate step inbetween each of the one I define.

for your type of signals with steep turn on and turn off, you should also have a stepping time sequence to sample niceley in the steep regions.

The default automatic Comsol settings are rather for a transient system that settles out in time

Check the log tab during the solver you will see te intermediate steps COMSOL takes and how they evolve. By the way by default COMSOL only saves the solutions you ask for, but you can also ask it to save ALL steps it's performing.

Last point, when solving a system that does finally NOT converge after some time, you might well have valid resultsfr the first time steps, but I have noticed that often the 2-3 last tend to deviate strongly from reasonnable results, so its not only the step that did not converge that is out of scope, be aware

--
Good luck
Ivar
Hi I suspect that you are using the solver in automatic mode, this is NOT ideal for periodic signals, as the next step is estimated from the last AND the last gradients wich might give COMSOL the feeling that we are in a steady state situation and it will propose a long step, that might again arrive at the pulse "on" state (no gradient change) and so on. for this you have the stepping settings in the solver, either "automatic" (default but not the best for periodic signals), "strict" = the time steps you define and "intermediate" (the one I use for periodic singnals) because COSMOL tries to add an intermediate step inbetween each of the one I define. for your type of signals with steep turn on and turn off, you should also have a stepping time sequence to sample niceley in the steep regions. The default automatic Comsol settings are rather for a transient system that settles out in time Check the log tab during the solver you will see te intermediate steps COMSOL takes and how they evolve. By the way by default COMSOL only saves the solutions you ask for, but you can also ask it to save ALL steps it's performing. Last point, when solving a system that does finally NOT converge after some time, you might well have valid resultsfr the first time steps, but I have noticed that often the 2-3 last tend to deviate strongly from reasonnable results, so its not only the step that did not converge that is out of scope, be aware -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 08.12.2010, 12:39 GMT-5
Ivar,

I have set "Time steps taken by solver" to intermediate.
When I run my simulation for 90 seconds (exactly 3 periods of my above function) I get about the same results as I did before. If I run the simulation for any longer it diverges.

I tried changing the "maximum time step" under time step tuning to 0.01, but then my simulation diverged very quickly (around 8 seconds) instead of after the 90 seconds.

Is there some other parameter that needs tweaking for the intermediate setting to work?

Thanks,
Nick
Ivar, I have set "Time steps taken by solver" to intermediate. When I run my simulation for 90 seconds (exactly 3 periods of my above function) I get about the same results as I did before. If I run the simulation for any longer it diverges. I tried changing the "maximum time step" under time step tuning to 0.01, but then my simulation diverged very quickly (around 8 seconds) instead of after the 90 seconds. Is there some other parameter that needs tweaking for the intermediate setting to work? Thanks, Nick

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 08.12.2010, 14:46 GMT-5
Hi
no normally not, that should do, so obviously you have some energy entering, but not enough leaving out to get an equilibrium.

I'm not sure what to suggest (apart to run over you model once again and check the material properties (are all defined) the physics and the BC's

--
Good luck
Ivar
Hi no normally not, that should do, so obviously you have some energy entering, but not enough leaving out to get an equilibrium. I'm not sure what to suggest (apart to run over you model once again and check the material properties (are all defined) the physics and the BC's -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10.12.2010, 11:04 GMT-5
I have one material that is not defined, but I have defined all of its parameters.

How should I be tweaking the time step tuning? I have my maximum time step set to auto, which is 0.1
My initial time step is also set to auto which is 0.001
I have one material that is not defined, but I have defined all of its parameters. How should I be tweaking the time step tuning? I have my maximum time step set to auto, which is 0.1 My initial time step is also set to auto which is 0.001

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.