Solving "Woes of Mathematica" for Natski

  • Context: Mathematica 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around issues encountered while plotting a function in Mathematica, specifically one that includes complex components such as Cos(1000t + 0.0i). Participants explore reasons for Mathematica's inability to plot the function and seek solutions to eliminate the complex part. Additionally, a secondary question regarding playing sound without generating a graph is raised.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • Natski expresses frustration over Mathematica's output, questioning why it includes 0.0i and why this prevents plotting the function.
  • Warren requests the specific function being plotted to provide more targeted assistance, indicating a lack of information hampers help.
  • One participant claims they can plot the function without issues, suggesting the importance of using the correct syntax, specifically mentioning the use of square brackets.
  • Another participant proposes using the RealOnly Add-On as a potential solution, providing a link for further information.
  • A different suggestion involves using the Chop function to address the issue with the complex part of the function.
  • One participant advises ensuring proper spacing between multiplied objects in the function to avoid syntax errors.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the cause of the issue or the best solution, with multiple suggestions and some disagreement on the necessity of showing the function being plotted.

Contextual Notes

There is uncertainty regarding the specific syntax and functions required for successful plotting in Mathematica, as well as the implications of complex numbers in the context of real-valued functions.

Who May Find This Useful

Users of Mathematica facing similar plotting issues, particularly those dealing with complex numbers in their functions, may find the discussion relevant.

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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 11 ·
Replies
11
Views
17K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K