Message Boards Message Boards

1
|
3496 Views
|
6 Replies
|
9 Total Likes
View groups...
Share
Share this post:

[?] Evaluate complex function Cos[Sqrt[s]]

Posted 5 years ago

Dear Sir/Madam,

I have evaluated a complex function Cos[Sqrt[s]] (s is complex variable) in Mathematica version 10. The results are presented in the attached file. However, Mathematica can not evaluate the function along the negative direction of the x-axis. Such a problem was not in Matlab. How can I resolve such problem in Mathematica?

Best regards

Attachment

Attachments:
POSTED BY: M Abadi
6 Replies
Posted 5 years ago

Dear Professor Murray Eisenberg,

The Mathematica version 12 solves the problem very well. I have a nice plot of the function now.

Best regards

POSTED BY: M Abadi

With Mathematica 12.0, you could also use ComplexPlot3D:

ComplexPlot3D[Cos[Sqrt[Sqrt[z]]], {z, -0.1 - 0.01 I, 0.1 + 0.01 I}, 
 Exclusions -> None]
POSTED BY: Murray Eisenberg

Try including the option:

Exclusions -> None
POSTED BY: Murray Eisenberg

Please include code directly (use the code button at top-left end of the toolbar here, or indent 4 spaces) rather than images of code. Users here may then copy and paste the code into a notebook. But with just images, we would have to read (sometimes fuzzy) pictures and then re-type everything.

POSTED BY: Murray Eisenberg
Posted 5 years ago

Dear Mr. Mariusz Iwaniuk, Engineer,

The NumericQ function solves the problem and yields the exact value of the complex function Cos[Sqrt[s]] along the negative direction of the x-axis, as shown in the attached file.

Thanks for the useful comment.

Best regards

M.T. Abadi

Attachment

Attachments:
POSTED BY: M Abadi

I do not know what's going on here, but workaround is:

 F[s_?NumericQ] := Cos[Sqrt[s]];
 G[x_?NumericQ, y_?NumericQ] := F[Sqrt[x + I y]]
 Plot3D[Abs[G[x, y]], {x, -1/10, 1/10}, {y, -1/100, 1/100}]

Or another way using ListPlot3D:

ClearAll["Global`*"]; Remove["Global`*"];

F[s_] := Cos[Sqrt[s]];
G[x_, y_] := F[Sqrt[x + I y]]

ListPlot3D[Partition[Flatten[Table[{i, j, Abs[G[i, j]]}, {i, -1/10, 1/10, 1/500}, {j, -1/100, 1/100, 1/500}]], 3]]

Regards M.I.

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

Group Abstract Group Abstract