Equation Graphing Difficulties

Click For Summary

Discussion Overview

The discussion revolves around difficulties in graphing a complex decaying trigonometric function. Participants explore the function's structure, potential errors in its formulation, and methods for graphing it using software like WolframAlpha and Mathematica. The conversation includes technical details about the function's components and suggestions for simplification.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant expresses difficulty in graphing a specific decaying trigonometric function and suspects issues with graphing software timing out.
  • Another participant reformulates the original function for clarity, pointing out potential errors in parentheses and suggesting a corrected version for WolframAlpha.
  • A participant confirms the reformulated equation and inquires about using Mathematica for plotting, seeking guidance on inputting the expression correctly.
  • Another participant proposes a simplification of the expression using trigonometric identities, suggesting that this might help with graphing in Mathematica.
  • One participant shares a Mathematica code snippet for plotting the function, noting the complexity of the expression and the importance of verifying results due to potential misleading outputs.
  • Concerns are raised about the accuracy of plots when dealing with large or small numbers, emphasizing the need for careful verification of results.

Areas of Agreement / Disagreement

Participants generally agree on the structure of the function and the challenges associated with graphing it. However, there are multiple approaches suggested for graphing, and no consensus is reached on the best method or the effectiveness of the proposed solutions.

Contextual Notes

Limitations include potential errors in the original function's formulation, the complexity of the expression leading to difficulties in graphing, and the dependence on specific software capabilities. The discussion highlights the need for careful handling of mathematical expressions in different graphing environments.

kyledixon
Messages
3
Reaction score
0
Hi everybody,

I am having some difficulties graphing this decaying trig function:

((e^(((.175(1-(y/10))+((y/10)-.001))t)/(2000)))(10cos((sqrt(((.175(1-(y/10))+((y/10)-.001))^(2))-400000000))t)+10sin((sqrt(((.175(1-(y/10))+((y/10)-.001))^(2))-400000000))t))

I have checked over the parentheses three times now, and I don't see any errors there. I am assuming I am just timing out the graphing programs, because WolframAlpha is having difficulty, and I don't know how else I can graph this. So does anybody know how I can graph this? Or do you see any errors I have made?
 
Physics news on Phys.org
Is this your function?

##\displaystyle \exp\left(at/2000\right) \cdot \left( 10 \cos \left( t \cdot \sqrt{a^2 - 400000000} \right) + 10 \sin \left( t \cdot \sqrt{a^2 - 400000000} \right) \right)##

where

##a = 0.175 (1-y/10)+(y/10-0.001)##

Your original expression had many superfluous parentheses in it. For example, 1-(y/10) and ^(2). Also, I noticed that Wolfram didn't know how to recognize ()t, once I inputted several * into the expression a result was shown (indicating errors in parentheses). There was one error near the end, that I fixed when rewriting the expression but I don't know what parens it was. Here is what I can use for Wolfram:

exp(t*(0.175*(1-y/10)+(y/10-0.001))/2000)*(10*cos(t*sqrt((0.175*(1-y/10)+(y/10-0.001))^2-400000000))+10*sin(t*sqrt((0.175*(1-y/10)+(y/10-0.001))^2-400000000)))

No graph shows up however.
 
Yes! You nailed the equation exactly. Sorry about the extra parentheses, I became used to adding things like ^(2) after I kept getting inaccurate answers because Wolfram misunderstood what I meant. I can't thank you enough for fixing the equation. Do you think Mathematica 9 would plot it? If so, would you know how to input it appropriately?
 
You can actually simplify the expression down further. Using the fact that ##\sin(x) + \cos(x) = \sqrt{2} \sin(x + \pi/4)##, the expression can be rewritten as

##\displaystyle 10\sqrt{2} \cdot \exp\left(at/2000\right) \cdot \sin \left( t \cdot \sqrt{a^2 - 400000000} + \pi/4 \right)##

where a is as defined previously. The sin term is too complex for Wolfram to graph, but you can try it with Mathematica and see if the extra time allowed can plot it. (Wolfram basic only allows so much computation time)

10*sqrt(2)*e^(a*t/2000)*sin(t*sqrt(a^2-400000000+pi/4))
 
I gotcha. Thanks so much for your help, now I just need to learn how to use Mathematica and hopefully I will be good to go!
 
kyledixon said:
Do you think Mathematica 9 would plot it? If so, would you know how to input it appropriately?

Code:
In[1]:= a = 0.175*(1 - y/10) + (y/10 - 0.001);
    expr = 10*Sqrt[2]*Exp[a*t/2000]*Sin[t*Sqrt[a^2 - 4*10^8] + Pi/4];
    Plot3D[{Re[expr], Im[expr]}, {t, -10^-4, 10^-4}, {y, -10, 10}]

Out[3]= ...PlotSnipped...

expr is HUGE for values of t much bigger than +/- 10^-4. Try
Code:
Table[expr, {t, -20, 20, 5}, {y, -1, 1}]
to see what I mean.
expr is Complex for many or most values of t.
The plot is almost unchanged by the range of y until y is beyond +/-10^5.
Overlaying two plots, one the Real part and the other the Imaginary part,
and suitably restricting the Plot range let's you see a plot.
Mathematica is fanatic about correct capitalization and () versus [] versus {} while WolframAlpha doesn't care.
Mathematica allows you to define functions and assign values to variables while WolframAlpha doesn't.
Be very very careful to verify that any plot which includes numbers like 400000000 is correct because Plot is not perfect and with wildly large or wildly small numbers it can often show you something that is misleading or simply wrong, increase the range of t in that plot by 10x or 100x and look at the result to see examples of this.
Getting a graph to be exactly the way you want it to be can take ten times as long as it takes to get the math to be really correct.

You can get WolframAlpha to plot the Real or Imaginary part, but the line of code is so long that it barely fits within the limits.

http://www.wolframalpha.com/input/?i=Plot3D%5B%7BRe%5B10*Sqrt%5B2%5D*Exp%5Bt*%280.175*%281-y%2F10%29%2B%28y%2F10-0.001%29%29%2F2000%5D*Sin%5Bt*Sqrt%5B%280.175*%281-y%2F10%29%2B%28y%2F10-0.001%29%29%5E2-4*10%5E8%5D%2BPi%2F4%5D%5D%7D%2C%7Bt%2C-10%5E-4%2C10%5E-4%7D%2C%7By%2C-10%2C10%7D%5D

Change the Re to I am at the beginning of that line to see the Imaginary plot.
Hopefully I haven't broken any of this with copy and paste.
Test all this very carefully before you depend on any of it.
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
6
Views
2K