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.

Smoothing a pulse made with Analytic function

Please login with a confirmed email address before reporting spam

Hello,

I have made a sine pulse with an analytic function.
My step function goes from 0 to 1at the location of 2e-4. My analytic function is "100*(sin(2*pi*10^6*t)-step1(t[1/s])*sin(2*pi*10^6*t))" and the lower and upper limits are 0 to 0.001.

The problem is when I zoom in the graph does not look like sine wave. Please see the attached image.
If I plot the same function with the frequency of 10KHz instead of 1MHz, it looks fine.
It seems that there is a problem with the graph resolution. Does anyone have any idea how to solve this?

Thanks,
Hamed


4 Replies Last Post 26 janv. 2017, 14:55 UTC−5
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 23 janv. 2017, 02:57 UTC−5
Preview plots of functions by default contain 10000 points in 1D. If you want to plot for a higher resolution, click on "Create Plot" in the Settings window's toolbar and increase the resolution in the data set that is created.

If your model contains rapidly varying functions you also have to make sure that the solver settings resolve the dynamics of the functions.
Preview plots of functions by default contain 10000 points in 1D. If you want to plot for a higher resolution, click on "Create Plot" in the Settings window's toolbar and increase the resolution in the data set that is created. If your model contains rapidly varying functions you also have to make sure that the solver settings resolve the dynamics of the functions.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 24 janv. 2017, 18:30 UTC−5
Thank you Gunnar for your answer.

I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution?

Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough?


Thanks,
Thank you Gunnar for your answer. I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution? Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough? Thanks,

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 25 janv. 2017, 02:34 UTC−5

Thank you Gunnar for your answer.

I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution?

Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough?


The resolution is defined in the Grid data set used by the plot. Select the Line Graph in the 1D plot group that was created. Click on the Go to Source button in the Data section. This takes you to the data set. Expand the Resolution section and change the resolution.

8 time steps isn't enough to resolve a sine wave, try with more time steps until you're satisfied. That said, if you know that it's a sine wave with some frequency, why do you need to plot it?
[QUOTE] Thank you Gunnar for your answer. I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution? Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough? [/QUOTE] The resolution is defined in the Grid data set used by the plot. Select the Line Graph in the 1D plot group that was created. Click on the Go to Source button in the Data section. This takes you to the data set. Expand the Resolution section and change the resolution. 8 time steps isn't enough to resolve a sine wave, try with more time steps until you're satisfied. That said, if you know that it's a sine wave with some frequency, why do you need to plot it?

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 26 janv. 2017, 14:55 UTC−5


Thank you Gunnar for your answer.

I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution?

Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough?


The resolution is defined in the Grid data set used by the plot. Select the Line Graph in the 1D plot group that was created. Click on the Go to Source button in the Data section. This takes you to the data set. Expand the Resolution section and change the resolution.

8 time steps isn't enough to resolve a sine wave, try with more time steps until you're satisfied. That said, if you know that it's a sine wave with some frequency, why do you need to plot it?


Thank you again! I was just curious to know how to plot a graph with higher resolution.

Another question: Is there any way to solve this model in the frequency domain with a pulse like above? The pulse in the frequency domain will have a frequency of 1KHz (one cycle per milli-second). Each cycle composed of 200 microseconds of sine waves at 1MHz and 800 micro-seconds of zero pulse.

Thanks,
[QUOTE] [QUOTE] Thank you Gunnar for your answer. I clicked on the "Create plot", but I do not see anything related to resolution. How can I increase the resolution? Also, How many time steps are enough to fully resolve a sine wave? Currently, I am using 8 time steps per each sine wave, is that enough? [/QUOTE] The resolution is defined in the Grid data set used by the plot. Select the Line Graph in the 1D plot group that was created. Click on the Go to Source button in the Data section. This takes you to the data set. Expand the Resolution section and change the resolution. 8 time steps isn't enough to resolve a sine wave, try with more time steps until you're satisfied. That said, if you know that it's a sine wave with some frequency, why do you need to plot it? [/QUOTE] Thank you again! I was just curious to know how to plot a graph with higher resolution. Another question: Is there any way to solve this model in the frequency domain with a pulse like above? The pulse in the frequency domain will have a frequency of 1KHz (one cycle per milli-second). Each cycle composed of 200 microseconds of sine waves at 1MHz and 800 micro-seconds of zero pulse. Thanks,

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.