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.

Pulse Volt vs Time

Please login with a confirmed email address before reporting spam

Does anyone has any idea where and how can I insert a time factor into the simulation?
Let says I want the voltage to rise from 0 to 2V (within 40ns) --> stays at 2V for another 100ns --> falls from 2V to 0V (within 40ns). total time: 180ns.

15 Replies Last Post 2013年4月26日 GMT-4 07:17
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 2013年4月25日 GMT-4 03:00
Hi

check the Model Definitions Functions rect() pulse (its smooth if you turn on smoothing)

--
Good luck
Ivar
Hi check the Model Definitions Functions rect() pulse (its smooth if you turn on smoothing) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月25日 GMT-4 04:36
Hi Ivar

Thank you for the prompt reply. Currently, I tried to input the following command

if(t<=40e-9, (2/40e-9*t), if(t<=80e-9,2, if(t<=120e-9, (-2/40e-9*t),0)))

into under electric potential. However, Kept encountering the following error:

Repeated error test failures. May have reached a singularity.
Time : 8e-008
Last time step is not converged.

In what way, I can rectify this error? What might have went wrong? At first, I suspected is due to the "My Study Setting under Study was not set properly. And change to >> Times: range(0,1e-8,1.2e-7)" . But the problem still persist. Pleae advise.

Thank you.

Susan
Hi Ivar Thank you for the prompt reply. Currently, I tried to input the following command if(t

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 2013年4月25日 GMT-4 05:32
Hi

even if you get a nice pulse like that you have discrete sharp (Dirac type) steps, the solver expect continuous functions to get the derivative to better control the solver steps, and with these steep slopes it fails. therefore the "rect()" function is proposed with "smoothing" Heavyside type functions. Just as for the step() function

use rather these

--
Good luck
Ivar
Hi even if you get a nice pulse like that you have discrete sharp (Dirac type) steps, the solver expect continuous functions to get the derivative to better control the solver steps, and with these steep slopes it fails. therefore the "rect()" function is proposed with "smoothing" Heavyside type functions. Just as for the step() function use rather these -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月25日 GMT-4 06:10
Hi Ivar

Thank you for the prompt reply once again!! I really appreciate your helps.Please bear with me awhile more, I have tried the method that you've proposed by keying the Time waveform using the rect function. May I know how can I assign the rect function into the electrical potential?

The current function name: rect1()

Thank you.

Susan
Hi Ivar Thank you for the prompt reply once again!! I really appreciate your helps.Please bear with me awhile more, I have tried the method that you've proposed by keying the Time waveform using the rect function. May I know how can I assign the rect function into the electrical potential? The current function name: rect1() Thank you. Susan

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 2013年4月25日 GMT-4 07:12
Hi

use V0*rect(t[1/s]) it will give you a value, for each "t" (expressed in seconds) that your solver steps chooses. V0 is for a voltage of scalar amplitude "V0" adapt to whatever you need

to check your function plot it out (plot icon)

Another thing, if you use the default solver and time stepping, "dig" your way down to the
Study1 - Solver Configuration - Time-dependent Solver 1 and open the "Time Stepping tab"

change the Steps taken by the solver from "Free" to intermediate or strict, then be sure in the
Study 1 - Time dependent under Times that you define a range with a few steps on the rising and falling edge of your pulse

Else there is a fair chance that your solver will integrate over the steep rise and at least fall time regions
--
Good luck
Ivar
Hi use V0*rect(t[1/s]) it will give you a value, for each "t" (expressed in seconds) that your solver steps chooses. V0 is for a voltage of scalar amplitude "V0" adapt to whatever you need to check your function plot it out (plot icon) Another thing, if you use the default solver and time stepping, "dig" your way down to the Study1 - Solver Configuration - Time-dependent Solver 1 and open the "Time Stepping tab" change the Steps taken by the solver from "Free" to intermediate or strict, then be sure in the Study 1 - Time dependent under Times that you define a range with a few steps on the rising and falling edge of your pulse Else there is a fair chance that your solver will integrate over the steep rise and at least fall time regions -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月25日 GMT-4 11:28
Hi Ivar

Thank you so much!!!! By the way, how can I assign the rise and falling edge into Study 1 - Time dependent under Times?

For example, rise from 0s to 100ns, and stagnant from 100ns to 200ns and falls from 200ns to 300ns. How should I put it?

Please advise.

Thanks.

Susan
Hi Ivar Thank you so much!!!! By the way, how can I assign the rise and falling edge into Study 1 - Time dependent under Times? For example, rise from 0s to 100ns, and stagnant from 100ns to 200ns and falls from 200ns to 300ns. How should I put it? Please advise. Thanks. Susan

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月26日 GMT-4 01:16
Hi Ivar,

Basically, I am trying to create a single voltage square pulse with time. For example, rise from time 0s to 2ns [from 0 to 2V] and pulse width of 100ns, follow by falling edge 5ns [2V to 0V]

I tried using rect function to key in the rise/fall time via size of transition zone to be 2.5e-9. and the width to be 100e-9 by entering defining it in the lower and upper limit.
Just like the following:
Under the Parameters tab ==> Lower limit: 0, Upper limit: 100e-9
Smoothing (Size of transition zone: 2.5e-9)

But an error msg pop up :

Repeated error test failures. May have reached a singularity.
Time : 1.0249995275321e-007
Last time step is not converged.

However, it was fine when I entered the rise/fall time (smoothing) to 10e-9.

How can I resolve this prob if I wants a steep rise and fall transition?

Alternatively, I have tried to use the step function
Step 1: Parameters >> Location: 0; From: 0; To: 1; Size transition zone: 5e-9
Step 2: Parameters >> Location: 100e-9; From 1; To: 0; Size transition zone 2.5e-9

And I tried to combined them into Analytic function: in the expression box: 2*(step1(t)+step3(t))

The following error message pop up when I was trying to see a preview of the plot
Syntax error
Expression: ()[1/ns]
Sub expression: ()[1/ns]
Position: 1

Please advise.

Thanks.

Susan
Hi Ivar, Basically, I am trying to create a single voltage square pulse with time. For example, rise from time 0s to 2ns [from 0 to 2V] and pulse width of 100ns, follow by falling edge 5ns [2V to 0V] I tried using rect function to key in the rise/fall time via size of transition zone to be 2.5e-9. and the width to be 100e-9 by entering defining it in the lower and upper limit. Just like the following: Under the Parameters tab ==> Lower limit: 0, Upper limit: 100e-9 Smoothing (Size of transition zone: 2.5e-9) But an error msg pop up : Repeated error test failures. May have reached a singularity. Time : 1.0249995275321e-007 Last time step is not converged. However, it was fine when I entered the rise/fall time (smoothing) to 10e-9. How can I resolve this prob if I wants a steep rise and fall transition? Alternatively, I have tried to use the step function Step 1: Parameters >> Location: 0; From: 0; To: 1; Size transition zone: 5e-9 Step 2: Parameters >> Location: 100e-9; From 1; To: 0; Size transition zone 2.5e-9 And I tried to combined them into Analytic function: in the expression box: 2*(step1(t)+step3(t)) The following error message pop up when I was trying to see a preview of the plot Syntax error Expression: ()[1/ns] Sub expression: ()[1/ns] Position: 1 Please advise. Thanks. Susan

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 2013年4月26日 GMT-4 02:06
Hi

if you define the pulse as this (see file) it should be OK, but as you can define units in the analytical solution you do not need the units conversion when you call the analytical function, just use "t" as by default it's in seconds

But you pulse seems to be read from my understanding, so it's probably the solve thta has issues with the short and steep time series, you should use a time stepping of the type:

"intermediate" or "strict" (and not free, possibly try a gen alpha) and then use a range of the type

{range(0,0.1,2) range(5,5,95) range(100,0.1,102) range(105,5,150)}*1[ns]

to be sure you have enough points during your rise and fall times. It all depends on your model and equations, if you system is very dynamic you might need more points during the flat period, or you could use a power stepping to increase the time steps

--
Good luck
Ivar
Hi if you define the pulse as this (see file) it should be OK, but as you can define units in the analytical solution you do not need the units conversion when you call the analytical function, just use "t" as by default it's in seconds But you pulse seems to be read from my understanding, so it's probably the solve thta has issues with the short and steep time series, you should use a time stepping of the type: "intermediate" or "strict" (and not free, possibly try a gen alpha) and then use a range of the type {range(0,0.1,2) range(5,5,95) range(100,0.1,102) range(105,5,150)}*1[ns] to be sure you have enough points during your rise and fall times. It all depends on your model and equations, if you system is very dynamic you might need more points during the flat period, or you could use a power stepping to increase the time steps -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月26日 GMT-4 02:32
Hi Ivar,

Hmm..But I still have problem having to see the preview of the combined steps functions in analytic function. From the plot review I only manage to see a straight line.

What did you input in the plot parameters to allow you to see a nice analytic graph? How do you define the upper and lower limits for t (time)?
Thank you.

Susan
Hi Ivar, Hmm..But I still have problem having to see the preview of the combined steps functions in analytic function. From the plot review I only manage to see a straight line. What did you input in the plot parameters to allow you to see a nice analytic graph? How do you define the upper and lower limits for t (time)? Thank you. Susan

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月26日 GMT-4 02:53
Hi Ivar,

Yes, I've got it!! Thank you so much for your help!! Really appreciated!!

Susan
Hi Ivar, Yes, I've got it!! Thank you so much for your help!! Really appreciated!! Susan

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 2013年4月26日 GMT-4 03:04
Hi

Good to hear

--
Have fun COMSOLing
Ivar
Hi Good to hear -- Have fun COMSOLing Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月26日 GMT-4 05:26
Hi Ivar,

After I executed the prog, I realised that the potential (v) across my model varies with my Voltage (set:1.8V) [file]

This is what I wrote in Vo under the electric potential.
1.8*an1(t)

However, if I just apply 1.8V into Vo it shows linear voltage increase across my geometry from 0 to1.8V (Expected)

How can ensure my model is receiving a maximum of 1.8V and not beyond or varies? Do I make change in the analytic function? how?


Thanks.

Susan
Hi Ivar, After I executed the prog, I realised that the potential (v) across my model varies with my Voltage (set:1.8V) [file] This is what I wrote in Vo under the electric potential. 1.8*an1(t) However, if I just apply 1.8V into Vo it shows linear voltage increase across my geometry from 0 to1.8V (Expected) How can ensure my model is receiving a maximum of 1.8V and not beyond or varies? Do I make change in the analytic function? how? Thanks. Susan


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 2013年4月26日 GMT-4 05:36
Hi

that's probably my error, I normalised to 2"V" but as the two step functions go from 0-1 and they add up you will see that the analytical amplitude, in my example is 4 and not 2 as expected.

Check carefully the amplitudes and remove the factor 2 (or divide by 2 depending on how you want to normalise), it should work better

--
Good luck
Ivar
Hi that's probably my error, I normalised to 2"V" but as the two step functions go from 0-1 and they add up you will see that the analytical amplitude, in my example is 4 and not 2 as expected. Check carefully the amplitudes and remove the factor 2 (or divide by 2 depending on how you want to normalise), it should work better -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年4月26日 GMT-4 06:57
Hi Ivar,

I tried to divided the expression by 2 [file: an1]. but it still cannot be scale to 0 to 1 in the y axis. Please advise.

Hi Ivar, I tried to divided the expression by 2 [file: an1]. but it still cannot be scale to 0 to 1 in the y axis. Please advise.


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 2013年4月26日 GMT-4 07:17
Hi

but your an1() it scales to one, but the output is now "Volts" as there are units defined to the analytical function.

If you set the amplitude in your equations then keep the v0=1.8[V] outside and remove the "V" for the units in the definition of an1(). Hence it gives a scalar function of "t" between 0-1

Note that COMSOL flag unit error by orange colour (these are warnings, no show-stopper to solve, but the results might be unexpected), while if you have any errors, such as missing (){} ... then the formula is flagged RED and you MUST resolve it to be able to solve

I cann't really say more, try to dig into the "model definitions probe values" or "plot while solving" to track better what is going on, then you might easier find out what is wrong

--
Good luck
Ivar
Hi but your an1() it scales to one, but the output is now "Volts" as there are units defined to the analytical function. If you set the amplitude in your equations then keep the v0=1.8[V] outside and remove the "V" for the units in the definition of an1(). Hence it gives a scalar function of "t" between 0-1 Note that COMSOL flag unit error by orange colour (these are warnings, no show-stopper to solve, but the results might be unexpected), while if you have any errors, such as missing (){} ... then the formula is flagged RED and you MUST resolve it to be able to solve I cann't really say more, try to dig into the "model definitions probe values" or "plot while solving" to track better what is going on, then you might easier find out what is wrong -- Good luck Ivar

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.