Discussion Locked This discussion was locked by a forum moderator.
square pulse train
Posted 1 feb 2010, 08:15 GMT-5 Heat Transfer & Phase Change, Materials 36 Replies
Please login with a confirmed email address before reporting spam
I am trying to make a square pulse train in Comsol without Matlab.
The train should have a period of 0.01s, but the pulse itself is just 8e-9s.
One pulse is no problem with the smooth functions (flc2hs), but how can I repeat my pulse function?
Is there any function in Comsol to do so? I found nothing.
Or has anybody another solution to this problem without using Matlab?
My pulse function is:
flc2hs(t-1e-9,1e-9)-flc2hs(t-9e-9,1e-9)
Thanks a lot and kind regards,
C.Mannal
Please login with a confirmed email address before reporting spam
Can't you combine the heaviside step functions with a modulo on the time to get it to reapeat ?
look (in Guide.pdf) at the
mod(a,b)
with something like
mod(t,T0)
There are not only the heaviside functions, you can also make piecewise sinus steps which are also deriveable a few times
Good luck
Please login with a confirmed email address before reporting spam
thanks for the information. I tried it with mod(t,T0) aswell, but by multiplying my function with mod the steps are no longer 0 to 1 in height (less than 1). And by implementing my function in mod it is same problem (greater than 1). The function is then:
(flc2hs(t-1e-9,1e-9)-flc2hs(t-9e-9,1e-9)*mod(t,0.01)
or
mod((flc2hs(t-1e-9,1e-9)-flc2hs(t-9e-9,1e-9)),0.01)
How should I implement my function together with the mod-function? (to get some kind of pulsewidth modulation; a pulse train with pulsewidth 8e-9s and period 0.01s)
Thanks again,
C.Mannal
Please login with a confirmed email address before reporting spam
now I have a pulse train with pulses of 8 nanoseconds and the peroid of 0.01s. the functions is:
mod(t-8e-9,0.01)*100
But the problem is that the modulo operator fills in the time between the pulses with a linearly growing line from 0 to 1 and not completley with zero. How does the operator work exactly? Is it possible to set the time inbetween to zero to get a real square pulse train?
Thanks a lot for your help,
C.Mannal
Please login with a confirmed email address before reporting spam
Sorry i made it too short, my suggestion was to replace the "t" in your single pulse Heaviside function combination (step-up step down) by a mod(t,0.01) to get it to reapeat
Ivar
Please login with a confirmed email address before reporting spam
Thanks a lot, that works !!!
Please login with a confirmed email address before reporting spam
Hello
I am trying to use similar kind of pulse wave with on time as 0.5 ms and off time as 0.495 ( frequency is 20Hz) total period is : 0.05
I am trying to use a variable as input and it takes only mod function If i try multiplying flc2hs function it gives me error.\
how do i use it ? can you please guide
the accepted variable is :
(avg_pd)*(mod(t-p,0.05)*f)
but if i do
(avg_pd)*(mod(t-p,0.05)*f)*(flc2hs(t-0.0005,0)-flc2hs(t-0.0005,0.0005)
it says orange error
Hitesh
Please login with a confirmed email address before reporting spam
e 2.5[J] Energy per pulse
p 0.5[ms] Pulse width
f 40[Hz] Repitition rate
d 0.6[mm] Beam diameter
e_den e/((pi/4)*d^2) Energy Density
avg_p e*f Average power
avg_pd (e_den)*f Average power density
avg_pd_new (e_den*f) Conditional variable
avg_pd_new is only single pulse wave. I want with frequency 20 Hz
but i cannot use when
avg_pd_new = (avg_pd)*(mod((flc1hs(t-1e-9,1e-9)-flc1hs(t-9e-9,1e-9)),0.01)*f)
Can you please help me to resolve my problem.
Hitesh
Please login with a confirmed email address before reporting spam
are you in 3.5 or 4 ?, because in 4 use rather the step or other pulse functions, instead of the "flc1hs", the latter are already included into the v4 "step" functions (expand all tabs to access the rise time).
Then to avoid "orange" units warning, you should learn that COMSOL assumes unitless values for all functions so you should write:
step1(t[1/s])
or
mod((flc1hs(t[1/s]-1e-9,1e-9)-flc1hs(t[1/s]-9e-9,1e-9)),0.01)*f[1/Hz])
use the plot function of the analytical function to check your formulas and shapes (even if you do not call them it's handy
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Hi Ivar
I am using comsol 4.1.
My purpose is to generate a pulse train of frequency of 20 Hz (Period = 0.05s)
My pulse width is (p) 0.0005s (0.5 millisec)
Hence my off- time is (to)= 0.05-0.0005s=0.0495 s
The function I am using is :
flc2hs(mod(t[1/s],0.05)-p[1/s],to[1/s])-flc2hs(mod(t[1/s],0.05)-to[1/s],p[1/s])
mod is to generate the frequency.
But My o/p is completely opposite to the desired (my on time is 0.0005s but in the graph its showing 0.0495sec) and hence I can assume that my inpult pulse is not correct.
Can you please help on this please.
P.S : I have tried the rectangle pulse wave rect1(modt[1/s],0.05) for generating similar wave but no luck.
Hitesh
Attachments:
Please login with a confirmed email address before reporting spam
have you tried to use the "rect" function in v4 ?
if you define rect1(t[1/ms]) with "lower limit" = 0.05, "upper limit" = 0.55, and rise time = 0.1 (all in ms) and then call this function by a :
rect1(mod(t[1/ms],20)] you should get your pulse train.
Do not forget to use time stepping intermediate or strict and define your solver time stepping so these short pulses are not overlooked by the automatic solver settings
I'm not sure why, but I cannot make an analytoical function an1, calling rect1(), because you have (at least in v4.1) also the "make periodic" for an analytical function
Finally, it's rather simple, no ? ;)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Back again with the similar problem. Apologies for the same since I am a new user of COMSOL.
I've attached 2 snapshots, showing the input of rect1 and an1.
an1: rect1(mod(t[1/ms],20))
Could you please guide me where am I going wrong?
Hitesh
Attachments:
Please login with a confirmed email address before reporting spam
you must better study the "rect() (and step() its similar, just a "half" rectangle):
You should NOT use fully rectangular pulses, because the steps does not allow to define any gradients or derivatives at the step, and the solver needs the first derivative to find its way in an efficient way. Therefore you should leave the "step" rise time just make it reasonably short enough (that was the issue of the Heaviside functions too), I left it at 0.1, as I was inputing my values of time in ms, this means 100 usec, which is reasonably short (you may change)
Note: when I write t[1/ms], this means that the resulting value pushed to the function is 1000*t with T in seconds, therefore the modulo 20 as this is now modulo 20 msec
then you should note that the rect() function start with this smooth step such that we are midway at t=0. Therefore I added half the step rise time to the "lower value=0.05", to have the step starting really at "0" for t=0. the duration is then your 0.5 msec + half the rise time from the start = 0.55 (Upper limit)
So I see I confused you with my units in [ms], so you can also write:
rect1() with Lower limit = 0.05*1E-3, Upper limit =0.55*1E-3, size of transition =0.1*1E-3, and then call it with a
rect1(mod(t[1/s],20E-3))
or if you want to reduce the step rise time you corredct also the other values such as:
rect1() with Lower limit = 0.05*1E-3, Upper limit =0.55*1E-3, size of transition =0.1*1E-3, and then call it with a
rect1(mod(t[1/s],20E-3))
Final comment: the reason why the step function is not aligned at "0" for t=0, but start the ramp before, is also that when the solver initiates the calculations of the signal and it's derivative they are not both at "0". Such "flat initial" conditions can mislead the solver
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Thanks for your previous help IVAR. As you know, I am trying to build a heat transfer model for pulsed laser ablation by using Comsol 4.1. My study is Time dependent. My laser I/p (energy density ) is in Gaussian.I have model ready for heat transfer with temperature vs time curve.
Now moving further to my model, I'm trying to implement some more constraints/variables. My surface temperature is more than vaporization temperature and it created the recoil pressure/vapor pressure on the surface.
Now my problem is to implement this recoil pressure constraint in the model. This recoil pressure is Temperature dependent (more vapor phase - more vapor pressure) and hence I am unable to incorporate in the model. i.e with time the temperature varies and hence varies the recoil pressure.
Until now I have used Heat transfer weak contribution and Point wise Constraint
Can you please help me.
Hitesh
--
Hitesh
Please login with a confirmed email address before reporting spam
One should always try to use boundary = edge in 2D, surface in 3D, constraints, as Point constraints are mostly singularities. Your model becomes rather non-linear if you have pressure build up like that, but I do not see why you cannot define a Boundary pressure load depending on the Temperature, and having the Temperature depenig on time
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I define a Boundary pressure load, using stuctural mechanics physics, the equation for pressure is depending on the instantaneous surface Temperature. However, I didn't know how to define the Temperature dependig on time. Can you please elaborate more on this. Your guidance is highly appeciated.
Hitesh
Please login with a confirmed email address before reporting spam
well I would say, define an anlyticl function T(t) the temperature profile versus time, test it out (plot it) then define your geoemtry and physics and apply the temperature function to the material. and run a transient time solver.
This is assuming you know the temperature and its distribution.
If you have only some input heat flux (energy over time), you need to define where and how thes heat flux is incident on your boundaries, use HT in conjonction to solid to mix both physics and have COMSOL define the temperature distribution from the heat equations
Do not forget that (almost) all fields in COMSOL accepts equations, but if you loop to heavily you might make circular references, and certainly make your model non-linear, hence more difficult to get to solve correctly
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
You are very awesome! , Aprreciated ! Will get back to you as soon as I do the things which you mentioned in your reply.
Have a wonderful day.
Hitesh
Please login with a confirmed email address before reporting spam
Attachments:
Please login with a confirmed email address before reporting spam
I'm currently struck with the problem to define a function for laser pulse train , which is not getting solved, may be it just a small silly mistake, but it holding back from my actual results.
for my pulse train, Pulse width = 5e-4 sec, frequency = 10Hz, period = 0.1 sec
I'm defining rectangle function in comsol-v4.2,
rect1() with Lower limit = 5e-4, Upper limit =5.5e-4, size of transition =0.1e-4, pic attached
and then call it with a
rect1(mod(t[1/s],0.1)*0.1)
I can able to plot the function in analytic function and I attached the picture for the same.
In my heat transfer model, Heat flux = avg_pd * rect1(mod(t[1/s],0.1)*0.1)
Time-dependent solver = study setting = time = range(0,1e-4,1)
After solving this study, I can see that my output is not correct and only gives me single pulse.(pic attached).
Regards,
Please help me to resolve this problem.
Your reply is highly appreciated.
Hitesh Vora
Attachments:
Please login with a confirmed email address before reporting spam
----
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Thanks for the prompt reply!!!!
I tried to use the suggestion given on January 12, 2011 (reply) and also tried to implement different suggestion on the Comsol Forum , but I havenot achieved desired result.
I am attaching my model for reference.
My problem is : Even if I get the pulse train of frequecy 20Hz and pulse width 0.5 ms, which I can plot on analytic function, but my output remains ON only for the first pulse and rest is OFF.
Please suggest me some solution. Apologies for asking the same problem over and over.
Regards,
Hitesh
Attachments:
Please login with a confirmed email address before reporting spam
Fianlly Got it!
I found where am I wrong, I didn't select "strick" time stepping in time dependent solver.
Above all the function working good after selecting "Strick" time stepping.
Thanks a lot Ivar !
Hitesh
Attachments:
Please login with a confirmed email address before reporting spam
I need my pulse train to be operative for first 1sec, i.e. heat on for 1sec in 10 pulsed per 0.1 period, and after that cooling in air. I'm trying to implement this condition by appling following equation.
Heat flux = avg_pd_new2*((t<=1))
where,
e 2.5[J] Energy per pulse
p 0.5[ms] Pulse width
f 10[Hz] Repitition rate
dia 0.6[mm] Beam diameter
e_den e/((pi/4)*(dia^2)) Energy Density
avg_pd (e_den/p)*gp1(x[1/um]) Average Power Density with guassian beam
avg_pd_new2 (avg_pd)*an1(t[1/s]) conditional avg power density
My problem: after applying above condition, the heat is still ON after 1sec, and temp is constant 366[k], which is not right and temp should be reduced further more.
I unable to find any solution for this problem, can you pls help me on this!
Model and image are attached.
Hitesh
Please login with a confirmed email address before reporting spam
I was wondering did you figure out how to cool the lattice in between pulses? I am having the same problem whereby the temperature remains constant in between pulses. I am currently trying to model the two temperature model on multiple femtosecond pulses.
Thank you kindly for your time,
Clare
Please login with a confirmed email address before reporting spam
Hitesh had set ALL the rest of boundaries (different to that of input flux) to "Thermal Insulation". Surely he mistook the node "Thermal Insulation 2" and he intended to cool the piece with, for instance, a typical "Convective Heat Flux" with some positive value for h. Obviously his piece had no opportunity to cool, simply the heat couldn't get out!
And as periodic pulse he uses the analytic function "an1" with expression "rect1(mod(t[1/s],0.1))", but he ALSO sets this function as periodic: one of both is enough, or else he sets as periodic or he uses "mod()". So he could have used simply as expression for an1: "rect1(t)"and as period 0.1
Regards,
Jesus.
Please login with a confirmed email address before reporting spam
I am using a PDE model not a heat transfer model as I need to use the two-temperature model for femtosecond pulses so the heat transfer model does not apply.
For multiple pulses I use the equation:
flc2hs(mod(t,10e-6)-1e-15,1e-15)-flc2hs(mod(t,10e-6)-500e-15,1e-15)
where there is a 500 fs pulse occurring every 10e-6 seconds.
I multiply this by the source term.
My time range is:
range(0,1e-15,10e-12),range(10e-12,1e-6,10e-6),range(10e-6,1e-15,0.0000100000005),range(0.0000100000005,1e-6,20e-6)
I have attached on a picture of how the lattice is produced. As you can see the lattice temperature is not cooling down to room temperature. Would you have any ideas why this is occurring?
Thank you kindly for your time,
Clare
Attachments:
Please login with a confirmed email address before reporting spam
Do you include some Neumann bound. condition with non-zero flux (of course, for cooling flux must go out) or some Dirichlet bound. condition with some not-very-high temperature? If you have some of them, temperature should not get stuck, but drop slowly. You can upload your file for us to take a look and see what happens.
Regards,
Jesus.
Please login with a confirmed email address before reporting spam
I used analytic function to define a train of pulses
I wrote the expression as : flc2hs(mod(t,0.5)-1E-3,1E-3)-flc2hs(mod(t,0.5)-20E-3,1E-3)
where the pulse width=20 ms, and the frequency of pulses(pps) = 2 HZ
I want to put this train of pulses as a input voltage on a electrode, so i put it input in electric currents> electric potential as v0= an1(t[1/s])
but the problem when i plot the output electric potential on the electrode vs time, I found the output one pulse only not a train of pulses.
could you please tell me what is wrong in it
thanks
Please login with a confirmed email address before reporting spam
Hi
are you in 3.5 or 4 ?, because in 4 use rather the step or other pulse functions, instead of the "flc1hs", the latter are already included into the v4 "step" functions (expand all tabs to access the rise time).
Then to avoid "orange" units warning, you should learn that COMSOL assumes unitless values for all functions so you should write:
step1(t[1/s])
or
mod((flc1hs(t[1/s]-1e-9,1e-9)-flc1hs(t[1/s]-9e-9,1e-9)),0.01)*f[1/Hz])
use the plot function of the analytical function to check your formulas and shapes (even if you do not call them it's handy
--
Good luck
Ivar
Hi
I am using comsol 5.0 simulating pulse train laser drilling , when the laser is on or off, in the time solver, can i adopt different timestep, then the computation time would save a lot. but i find the result is wrong ,what is the problem ? I dont know what can i do
Please login with a confirmed email address before reporting spam
I have read the talks between you and Hitesh D. Vora, from which i find you are very familar with COMSOL. I have the same question to ask fou you, when i use laser pulse train to irradiate the soild metal, and i use the transient time solver. if i change the time step be different with the laser state such as on or off.when the laser is off, i adopt the long time step .but i find the result is wrong ,i donnot know how to define the setting in the time solver, can you give me any solutions.thank you very much.
best regard,
zhang
Please login with a confirmed email address before reporting spam
I have read your paper" One-dimensional multipulse laser machining of structural alumina: evolution of surface topography" .In your study ,you decribed the effects of multipulse laser on the evolution of surface roughness of alumin. I find your study is very excellent. bu I have some confusion that is the time dependet solver setting, the range you set range(0,0.001,0.01 ) ,range (0.01,0.01,20) ,how do setting in comsol ,can you give me any suggestions? thank you very much.
best regards,
Tingzhong
Please login with a confirmed email address before reporting spam
This is a very interesting discussion. From the point of view of computational efficiency and accuracy for transient heat transfer problems when pulsing a thermal load on and off, I would recommend:
www.comsol.com/blogs/modeling-a-periodic-heat-load/
Best Regards,
Walter
Please login with a confirmed email address before reporting spam
Can i solve coupled PDEs of Two Temperature Model equation for ultrashort pulse laser heating ?
How can i coupled these two equations in PDE ?
Ce*(d/dt)*Te= d/dz(k*(d/dz)*Te)- G(Te-Tl)+S(z,t)
Cl*(d/dt)*Ti=G(Te-Ti)
Please login with a confirmed email address before reporting spam
This is a very interesting question but a bit unrelated to the topics within this thread. We do recommend that you start a new discussion thread for this question.
Please login with a confirmed email address before reporting spam
Thanks for your reply.
I have already posted in other thread.
I am waiting for reply.
please check this link below.
www.comsol.co.in/community/forums/general/thread/26983/
thanks
kiran
Please login with a confirmed email address before reporting spam
You are always welcome to start a new thread if there is a new question that is only tangentially related to the original discussion.
To keep this discussion thread manageable, I will summarize that the original question was about modeling of a square pulse load over time for a heat transfer model. Although there are many different approaches in which this could be solved, the most appropriate way of modeling this situation is described in this article:
www.comsol.com/blogs/modeling-a-periodic-heat-load/
In the interests of keeping these conversations more focused, we will close this particular discussion thread. If there are related questions, please open a new discussion and add a link to this thread.
Best Regards,
Walter
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.