Mathematica Solving "Woes of Mathematica" for Natski

  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion revolves around issues with plotting a function in Mathematica that includes a complex component, specifically Cos(1000t + 0.0i). The user experiences errors related to machine size and confusion over the presence of the imaginary part, which they believe should not affect the real output of the function. Suggestions for resolving the issue include ensuring correct syntax with square brackets in the Plot and Cos functions, using the RealOnly add-on, and employing the Chop function to eliminate small imaginary parts. Additionally, the user inquires about playing sound without generating a graphical output, indicating a need for further assistance in that area.
natski
Messages
262
Reaction score
2
Hi,

I am having a terrible time trying to plot a function in Mathematica that is evaluated to have parts like: Cos(1000t+0.0i)

When I try and plot it against t, it says that the function is not machine size at many values of t.

I can't understand why Mathematica is putting 0.0i in there and secondly why it thinks that 0.0i means it can't plot the function. Takign the Re[function] does nothing either.

There surely must be a way of changing MachinePrecision or FindRoots or something that can eliminate this 0.0i? I really can't understand why Mathematica has such a stupid output for a function that is clearly real.

There was a second problem, much less substantial; I want to play a sound without producing a graph of the signal, is this possible?

Big thank-you for anyone who can help,
Natski
 
Physics news on Phys.org
As I said in your previous thread on the same topic, you'd really need to show us the function you're trying to plot for us to really be able to help you. You were not willing to show us the function, for some reason, so I doubt you will show it here, either.

- Warren
 
I don't have any problem plotting that function with Mathematica. Are you using the required square brackets, [ and ], for both the Plot and Cos functions?

The correct syntax is Plot[Cos[t], {t, tmin, tmax}] where tmin and tmax specify the domain over which you will generate the plot.
 
I am not 100% sure about this but you might want to use the RealOnly Add-On. http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/Miscellaneous/RealOnly.html" is a link that shoul tell you how tu use it. I hope it helps.
 
Last edited by a moderator:
The Chop function might allso help. Take a look http://documents.wolfram.com/mathematica/book/section-3.1.4" .
 
Last edited by a moderator:
Make sure to put spaces between objects you are multiplying.
 
Back
Top