Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.5K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Ask a question about function calculation in Mathematica, thanks :)

Posted 10 years ago
Attachments:
POSTED BY: Di Chang
4 Replies

Hi All, I guess we found the problem: I should not redefine beta11. Thanks for your help. This post can be closed. Best regards, Di

POSTED BY: Di Chang

Another interesting thing is in the whole calculation, everything should be real, I do not understand how the imaginary values came out.

POSTED BY: Di Chang

After the print of Fig9

Fig9

one sees using ?U1 and FullDefinition[U1] that U1 is still well defined (seemingly). So lets test the U1 on the diagonal

In[76]:= U1[a, a]
Out[76]= 1.81085*10^-13 - 2.16846*10^-13 I

In[77]:= U1[4 a, 4 a]
Out[77]= 3.1515*10^-14 - 1.61214*10^-14 I

these small imaginary parts prevent the graphics from appearing (Graphics3D wants real values) and bring you to the idea to type

Fig10 = Plot3D[Re[U1[x, y]] + U2[x, y], {x, a, 4 a}, {y, a, 4 a}, PlotRange -> Automatic]

to see U1 - its real part actually - in the sum again:

enter image description here

It lies in your responsibility to check whether U1 had imaginary parts already right after its definition and if so, why the first picture Fig7 did print.

HTH

POSTED BY: Udo Krause

Hi Udo Krause,

Thank you very much for your reply. Yes, you are right. I checked the imaginary parts of U1 right after its definition and calculation and they are all zero. However, after U2 has been calculated, U1 starts getting imaginary part, which I do not understand why. Maybe it has something to do with they sharing the same global functions definition at the beginning? Or do you think the way I define U1 will help the computer and program keep remembering its values? I am not good at computation and I guess the problem happens because the values of U1 have not been stored there and released. Do you have any suggestions that I can modify my codes to avoid this? Again, many thanks for your help.

Best regards, Di

POSTED BY: Di Chang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard