runga kutta and importing data
- To: mathgroup@smc.vnet.net
- Subject: [mg12236] runga kutta and importing data
- From: psalzman@dirac.ucdavis.edu (Locutus of the Borg)
- Date: Tue, 5 May 1998 03:29:32 -0400
hi there i wrote an ANSI C program to implement the 4th order runga kutta algorithm for solving ODE's. the program does its stuff and writes to a file: Listplot[{{x1, y1},{x2,y2}, ... ,{xn,yn}}, PlotLabel->"n=gridsize"] where all the x's and y's are data. the problem i'm having is when i open the data file from within Mathematica. it reads the file, but at some point it screws up and tacks on a portion of the data file again. it's no big deal because i can simply cut out the repeated data, but it's annoying and i shouldn't have to do this. when i use an editor to look at the data file, it's fine. when i open it from within Mathematica it repeats the last 25% of the file after the end of the file. so it looks like: blah blah blah ->"n=gridsize"]{x20,y20},{x21,y21}, .. and so forth. what can be causing this? is there some special formatting that Mathematica needs for imported data? lastly, how can i graph the exact solution over my ListPlot of the numerical solution? pete