Equation Graphing Difficulties

AI Thread Summary
The discussion centers on difficulties in graphing a complex decaying trigonometric function using WolframAlpha, which struggles with the expression's complexity and parentheses. Users identify issues with the original equation, noting unnecessary parentheses and errors that hinder graph generation. A simplified version of the equation is proposed, which may be more suitable for Mathematica, suggesting that Mathematica 9 could potentially handle the graphing better than WolframAlpha. The conversation highlights the importance of correct syntax and capitalization in Mathematica, as well as the challenges of visualizing complex functions accurately. Overall, users express a need for guidance on effectively using Mathematica to plot the function.
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?
 
Mathematics 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:
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top