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...
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?
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...
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...
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...
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...
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?
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.
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...
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.
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...
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.
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
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.