Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. WSUPhys

    Velocity from a data set-Fortran

    thanks for the help!
  2. WSUPhys

    Velocity from a data set-Fortran

    something like this?:program WSUPhys_csv implicit none integer :: stat,cmd_rc,num_lines, ivar1, ivar2, ivar3 integer :: MaxVert,MaxSide,MaxForward real :: rvar, Sum_ivar1, Sum_ivar2, Sum_ivar3 real :: Avg_ivar1, Avg_ivar2, Avg_ivar3,Vel, SumVel, MaxVel real ...
  3. WSUPhys

    Velocity from a data set-Fortran

    rvar is a variable representing a specific time; ivar1,ivar2,and ivar3 are variables representing the acceleration of the body that the accelerometer was attached to. I know from physics, that in general, v=a*t where t is my change in time. So, I want to take the value of my acceleration and...
  4. WSUPhys

    Velocity from a data set-Fortran

    okay, I have rewritten this program but I am still having trouble with getting the velocity. I know that the v=a*t (general form), which for my program should mean Velocity=ivar3*(rvar-(the rvar of the previous row)), how do I get the rvar of the previous row into my equation?
  5. WSUPhys

    Velocity from a data set-Fortran

    I have cross posted this to a few other forums, in order to increase my chances of getting an answer. I have just about finished this program, I only need to calculate my velocity. I think that this velocity should be calculated by taking the value from the 4th column of my data set...
  6. WSUPhys

    Compiler Error help

    that could be it, thank you!
  7. WSUPhys

    Compiler Error help

    does this look right? I removed the close file before the continue. program WSUPhys_csv implicit none integer :: stat, num_lines, ivar1, ivar2, ivar3 real :: rvar character*80 :: line write(*,*) "Reading file..." ! open input file...
  8. WSUPhys

    Compiler Error help

    I have written my program, it compiles properly but then when I go to run the .exe file it does the following: ./finalprojectavg.exe Reading file... File cannot be opened ! Floating point exception Can somebody explain to me what this is? I have never had a program pop-up a floating point...
  9. WSUPhys

    Trapezoidal method

    Hello, I am working on a program to find the value of the current in a coil. This value satisfies the following equation: y'=sin(2t)-[(ey-1)/(ey+1)] which is of the form y'=f(t,y) I know that in order to solve this I need to use the trapezoidal method to solve a differential equation, the...
  10. WSUPhys

    finding the average of a column in an array

    I want the absolute value of the variables because the numbers in my csv file are both positive and negative (Link so on the sum would I just put Sum_ivar1 = Sum_ivar1 + ABS(ivar1)? Will this work or is there something different I need to do?
  11. WSUPhys

    Help with .csv

    thank you!
  12. WSUPhys

    finding the average of a column in an array

    thank you, I just do not have enough practice dealing with certain elements of Fortran and so was trying to do stuff based on the brute force method I learned years ago.
  13. WSUPhys

    finding the average of a column in an array

    I have a program which reads a .csv file into an array and stores the values of the different variables into columns. I am trying to find the average value of the 2nd, 3rd and 4th columns (ivar1,ivar2,ivar3). I have the following code {this is just the loop to calculate the sum of the values and...
  14. WSUPhys

    Help with .csv

    thank you for the advice on generalizing it.
  15. WSUPhys

    Help with .csv

    Wow, you are awesome. This is a very elegant solution that will help with the fact that I have multiple data sets to process. I am still fairly new to Fortran coding so I would've never thought of something close to this. Thanks and have a nice day.
  16. WSUPhys

    Help with .csv

    Hello, I am currently working on a project where I need to read the data from a .csv file into an array and extract the values for multiple operations. I am wondering how do I open this and format it in Fortran? I do not have any experience with .csv files and when I try to copy it into a text...
  17. WSUPhys

    fortran continuation

    thank you, I think the problem with the continuation is from trying to run the program as an f77, I will switch it to f95. Thank you for the suggestion on the dates.
  18. WSUPhys

    fortran continuation

    yes, it has a date (yyyymmdd) then mileage then the amount of fuel input on that day. I have attached it. https://www.dropbox.com/s/8xj5jsrkr68tlua/car.dat
  19. WSUPhys

    fortran continuation

    I have attached my source code. I am currently working on a program that will take data from a text array file and calculate the total average mpg,the standard deviation, the yearly mpg and the average mpg by season(Summer and Winter). When I try to calculate the mpg per season, my code does not...
  20. WSUPhys

    Reading and working on data file

    Fortran I have a .dat file that I am trying to extract the information from in order to calculate the average miles per gallon and the sigma of the distribution. The file has lines with the structure 19990122 88888 30.5 The first word is a date in yyyymmdd format, second word is odometer...

Part and Inventory Search

Back
Top