1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with FORTRAN error message

  1. Feb 1, 2013 #1
    1. The problem statement, all variables and given/known data

    I get the follwing error message in the FORTRAN program I am trying to code.

    P(i)=(1/(sigma*sqrt(2*Pi)))*e^(-(x-xbar)^2/(2*sigma^2))
    ----------------------------1
    Error: Invalid character in name at (1)

    I assume this means there is something it doesn't like about 2*Pi but I can't work out what it is.

    Any help would be appreciated.
     
  2. jcsd
  3. Feb 1, 2013 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    1 Pi should be defined elsewhere in your program, as should the constant e.
    2. the character ^ is not used for exponentiation. The double * is the proper operator, thus x*x = x**2.
     
  4. Feb 1, 2013 #3
    Well that was abvious :rolleyes:

    forgot that '**' is used to creates powers.

    Thanks for that :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help with FORTRAN error message
  1. Help with fortran (Replies: 1)

  2. Fortran Help! (Replies: 4)

  3. Fortran help (Replies: 16)

Loading...