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.

Narrow Gaussian distribution in x and y as Initial Condition for 2D PDE in Coefficient form

Please login with a confirmed email address before reporting spam

Hi all,
I am trying to solve a 2D Fokker Planck equation using Coefficient form PDE for u(x,y,t).
The initial condtion for the probability distribution u(x,y,t=0)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2).
which is a Narrow Gaussian distribution in x and y.
when I created this function using analytic function called Gaussxy(x,y)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2)
and plotted the surface plot for u(x,y) from x={-0.01, 0.01} and y={-0.01, 0.01}, the surface plot is totally wrong.
I have also tried using Gaussian pulse from analytic finction like
Gaussxy(x,y)= gp1(x)*gp1(y) which is a multiplication of two Gaussian pulses with standard deviation of 0.001.
The surface plot of this also give wrong results. I am not sure where I am making the mistake.
However, when I plotted the Indiavidual functions such as
ux(x)= exp(-(x^2)/(2*0.001^2))/sqrt(2*pi*0.001^2) gives a good Gaussian plot in x.
This is true for y also
uy(y)= exp(-(y^2)/(2*0.001^2))/sqrt(2*pi*0.001^2) gives a good Gaussian plot in y.
However, when I multiply them and plot them for x={-0.01, 0.01} and y={-0.01, 0.01}, the surface plot is totally wrong.

is there any other way that I can specify a narrow gaussian in x and y or a dirac delta function in x and y as my initial condition?
I have attached the .mph file with this..


5 Replies Last Post 29 mars 2011, 22:02 UTC−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 29 mars 2011, 02:03 UTC−4
Hi

are you sure it's wrong ? or "just" a normalisation issue, surface per GP1 = 1 ?

for me the product of both seems to work OK, I made an analytical function of the product,

but the "height" is rather high, would need to calculate if its not a normalised area,

I agree this could be written out, the full formula could be there for all internal functions, its not even in the HELP

SUGGESTIONS FOR COMSOL DEVELOPERS HERE ! :)

--
Good luck
Ivar
Hi are you sure it's wrong ? or "just" a normalisation issue, surface per GP1 = 1 ? for me the product of both seems to work OK, I made an analytical function of the product, but the "height" is rather high, would need to calculate if its not a normalised area, I agree this could be written out, the full formula could be there for all internal functions, its not even in the HELP SUGGESTIONS FOR COMSOL DEVELOPERS HERE ! :) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 mars 2011, 11:02 UTC−4
Hi Ivar,
Thank you very much for the reply. I am still having problems with that. The formulas that I have written

u(x,y,t=0)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2)

is already normalized. I have attached the Jpeg files of the distributions that I got with this message.
When I plotted
ux(x)= exp(-(x^2)/(2*0.001^2))/sqrt(2*pi*0.001^2)
gives a good Gaussian plot in x (COMSOL_Gauss_X.JPG).
But when I plotted
uy(y)= exp(-(y^2)/(2*0.001^2))/sqrt(2*pi*0.001^2), it gives wrong result. (COMSOL_Gauss_Y.JPG).

also when I plotted
u(x,y,t=0)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2) gives wrong result.

Could you please have a look at the images that I have attached with this message.
Could you please attach the function file that you have plotted with this mail.
I have attached my COMSOL model file with my previous message, could you please look into that.

thank you very much for your time,
regards,
Srinivas
Grad Student
Dept of Chem Engg
Lehigh University.
USA.

--
Srinivas
Hi Ivar, Thank you very much for the reply. I am still having problems with that. The formulas that I have written u(x,y,t=0)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2) is already normalized. I have attached the Jpeg files of the distributions that I got with this message. When I plotted ux(x)= exp(-(x^2)/(2*0.001^2))/sqrt(2*pi*0.001^2) gives a good Gaussian plot in x (COMSOL_Gauss_X.JPG). But when I plotted uy(y)= exp(-(y^2)/(2*0.001^2))/sqrt(2*pi*0.001^2), it gives wrong result. (COMSOL_Gauss_Y.JPG). also when I plotted u(x,y,t=0)= exp(-(x^2+y^2)/(2*0.001^2))/(2*pi*0.001^2) gives wrong result. Could you please have a look at the images that I have attached with this message. Could you please attach the function file that you have plotted with this mail. I have attached my COMSOL model file with my previous message, could you please look into that. thank you very much for your time, regards, Srinivas Grad Student Dept of Chem Engg Lehigh University. USA. -- Srinivas


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 mars 2011, 15:03 UTC−4
Hi Ivar,
I got a reply from COMSOL support team, they could plot the function correctly as shown in the Figure attached with this message. But I could not get the same result... I think there is something wrong with my graphics or rendering...


--
Srinivas
Hi Ivar, I got a reply from COMSOL support team, they could plot the function correctly as shown in the Figure attached with this message. But I could not get the same result... I think there is something wrong with my graphics or rendering... -- Srinivas


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 29 mars 2011, 16:32 UTC−4
Hi

good question, I too can plot all functions correctly, they correspond to what I get in Maple too, so either you have an issue with your version (have you updated correctly to latest ? or it might be with 4.0, you should reset your model, or better rebuild it fully in 4.1 (and forget 4.0 ;)
Not sure

--
Good luck
Ivar
Hi good question, I too can plot all functions correctly, they correspond to what I get in Maple too, so either you have an issue with your version (have you updated correctly to latest ? or it might be with 4.0, you should reset your model, or better rebuild it fully in 4.1 (and forget 4.0 ;) Not sure -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 mars 2011, 22:02 UTC−4
Hi Ivar,
Thanks for the help. It is a problem of 3D Rendering. I had to change the option to software as below.
as told by COMSOL support team
"Options > Preferences > Graphics" and under "3D rendering:"
select "Software" and click "Apply"

Now it shows correct distribution as shown in the attached figure.

thank you very much for your help.
--
Srinivas
Hi Ivar, Thanks for the help. It is a problem of 3D Rendering. I had to change the option to software as below. as told by COMSOL support team "Options > Preferences > Graphics" and under "3D rendering:" select "Software" and click "Apply" Now it shows correct distribution as shown in the attached figure. thank you very much for your help. -- Srinivas

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.