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.

Applying a repeating square wave

Please login with a confirmed email address before reporting spam

Hi all-
Been reading through the discussions and figured out how to build a square pulse and then repeat it with an analytic function.
Now I am trying to apply my analytic function to a heat source so that the heat source turns on and off like the analytic func.

rect1>>
lower limit: 0.0001
upper limit: 1.1
transition zone: 0.05

an1>>
expression: rect1(mod(t[1/s],10))
arguments: t
plot parameters: argument-t, lower limit-0, upper limit 39

^^^all this above works. I plot the function and it give me 4 pulses of the correct duration

PROBLEM:
Heat source: Qheater*an1(t[1/s])
^^^^ this only produces one pulse when i compute the solution

I'm sure I'm missing something simple
Any help please?

Kyle

2 Replies Last Post 19 ago 2011, 15:34 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 18 ago 2011, 15:55 GMT-4
Hi

first question: are you sure you simulate for at least some 4*10 = 40 seconds ? so that 0<= t<= 40 ?

second thought: what are the stepping you are using ?, and what are the solver stepping parameters?
do not use "automatic" for repetitive signals, but rather use strict or better intermediate,and then give enough time steps so that the solver notices that there are variations in a parameter. Else, what probaby has happened, the solver has only calculated a few points always landing on Q=Qmax, hence deciding tat one can find the intermediate values by linear interpolations, and in this way fully skips over your 2nd and next heat source pulses

--
Good luck
Ivar
Hi first question: are you sure you simulate for at least some 4*10 = 40 seconds ? so that 0

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 ago 2011, 15:34 GMT-4
I sent an email to the technical support and received the following:

"This happens when there is a rapid change in small period time while the
problem itself is rather easy to be converged (ie solver doesn't need many
small steps to get a converged solution). What it happened was that, from
solver's point of view, there are no changes of solutions (or error) in
certain time steps, so it jumped to a few time steps ahead and see there is
not much changes - so it proceeded. But if the solver detected a change,
it would take a few steps back and compute.

Please see the attached image, if you change one of solver setting (red
boxed), you will get the desire result. "

Problem Solved
Thanks COMSOL
I sent an email to the technical support and received the following: "This happens when there is a rapid change in small period time while the problem itself is rather easy to be converged (ie solver doesn't need many small steps to get a converged solution). What it happened was that, from solver's point of view, there are no changes of solutions (or error) in certain time steps, so it jumped to a few time steps ahead and see there is not much changes - so it proceeded. But if the solver detected a change, it would take a few steps back and compute. Please see the attached image, if you change one of solver setting (red boxed), you will get the desire result. " Problem Solved Thanks COMSOL

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.