Results 1 to 6 of 6

Math Help - Newbie to Mathematica - I don't know how input it!

  1. #1
    Newbie
    Joined
    Nov 2008
    Posts
    3

    Newbie to Mathematica - I don't know how input it!

    I tried to input this expression on mathematica for some calcs and plotting but i got the error and because i'm newbie to mathematica i don't know how to fix it because the error info is insufficient. So i need some help from you guys

    [IMG]ftp://ftp.ua.pt/incoming/estga_aee/mota.JPG[/IMG]


    Regards
    Ricardo Mota
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    Post the code you're having problems so we can look at it but first you need to convert it to "raw input form" so that it can be cut and paste in text mode. For example, I wanted to solve:

    r^2y''+ry'+r^2y=0

    Then I'd use the DSolve command and enter into Mathematica:

    \text{DSolve}\left[r^2 y''[r]+r y'[r]+r^2 y[r]==0,y,r\right]

    then execute the command. Now select the cell (click the bracket on the right margin), then choose Cell/Convert To/Raw Input form in the menu. Ok, now it's in a text form that can be cut and paste. Cut it and now paste it into the thread here like I did below. But I also enclosed the text in code commands to make it look nicer but you don't have to do that:

    Code:
    In[1]:=
    DSolve[r^2*Derivative[2][y][r] + 
        r*Derivative[1][y][r] + r^2*y[r] == 0, 
      y, r]
    
    Out[1]=
    {{y -> Function[{r}, BesselJ[0, r]*C[1] + 
          BesselY[0, r]*C[2]]}}
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Nov 2008
    Posts
    3
    fm = 450
    f0 = 3000
    T0 = 1/f0
    T = 0.15*T0
    A = 6
    n = 13
    (T*A)/T0 Cos[2 \[Pi]*fm*t] + \!\(
    \*UnderoverscriptBox[\(\[Sum]\), \(n = \(-\[Infinity]\)\), \(\
    \[Infinity]\)]\(\([\)\(
    FractionBox[\(T*A\), \(2 T0\)] Sinc[
    \*FractionBox[\(n*T\), \(T0\)]]
    \*SuperscriptBox[\(E\), \(\[ImaginaryJ]*2 \[Pi] \((\((n*f0 + fm)\)
    t)\)\)] +
    FractionBox[\(T*A\), \(2 T0\)] Sinc[
    \*FractionBox[\(n*T\), \(T0\)]]
    \*SuperscriptBox[\(E\), \(\[ImaginaryJ]*2 \[Pi] \((\((n*f0 - fm)\)
    t)\)\)]\)\(]\)\)\)




    Sorry my mistake :S here is the code
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Aug 2008
    Posts
    903
    That's still messy. It still has some left-over formatting codes in it that makes the output hard to follow. Should not get that FractionBox in there. That's a clear sign that your conversion to raw input was not done correctly. Also, first rule of Mathematica: use lower case variable names. Upper case may conflict with internal commands. But just for now leave them in. Also, you do realize that when you speciffy an infinite sum like that with variables such as "t" that have not been assigned a number, Mathematica will attempt to store that infinite sum exactly and even if the syntax were correct, it would just hang using up as much memory it could use. But you can't use brackets in the sum. I changed them to parenthesis. This is how I re-wrote it and I just sumed it for a few since you specify a variable t. Also, I changed that double-struck j to a double-struck i. That is imaginary i in mathematica which when converted to raw-input, gets changed to upper case I.

    Code:
    fm = 450
    f0 = 3000
    T0 = 1/f0
    T = 0.15*T0
    A = 6
    n = 13
    ((T*A)/T0)*Cos[2*Pi*fm*t] + 
      Sum[T*(A/(2*T0))*Sinc[(n*T)/T0]*
         E^(I*2*Pi*((n*f0 + fm)*t)) + 
        T*(A/(2*T0))*Sinc[(n*T)/T0]*
         E^(I*2*Pi*((n*f0 - fm)*t)), {n, -3, 3}]
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Nov 2008
    Posts
    3
    Many thanks man for the quick and very useful help !


    Another question, now how can i plot the graph for the coefficients T*(A/(2*T0))*Sinc[(n*T)/T0] of each 'n'? i tried using the plot function but i got something like a sinc function and what i pretend was something like this:

    [IMG]ftp://ftp.ua.pt/incoming/estga_aee/untitled.JPG[/IMG]


    One more time many thankeful for the great help
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member
    Joined
    Aug 2008
    Posts
    903
    Here's a table of the coefficients I created with n going from -25 to 25 and a plot of the results ( of course you'll have to initialize T, A, T0 before you execute this code) and remember to use lower case names from now on.

    Code:
    clist = Table[{n, T*(A/(2*T0))*Sinc[(n*T)/T0]},
     {n, -25, 25}]
    ListPlot[clist]
    Attached Thumbnails Attached Thumbnails Newbie to Mathematica - I don't know how input it!-bplot.jpg  
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. LaTex Newbie
    Posted in the LaTeX Help Forum
    Replies: 5
    Last Post: December 14th 2010, 12:20 PM
  2. Mathematica Newbie Help Please
    Posted in the Math Software Forum
    Replies: 7
    Last Post: October 1st 2008, 11:11 AM
  3. Need newbie help on Relations
    Posted in the Discrete Math Forum
    Replies: 6
    Last Post: December 8th 2007, 11:08 PM
  4. Newbie help please
    Posted in the Statistics Forum
    Replies: 11
    Last Post: July 31st 2007, 01:30 PM
  5. Hello, newbie needs help.
    Posted in the Algebra Forum
    Replies: 7
    Last Post: August 22nd 2006, 07:05 PM

Search Tags


/mathhelpforum @mathhelpforum