Solving an ODE in Python
Are you sure your professor doesn't want you to solve it analytically (on paper) and then computationally (i.e. least squares fitting) determine the parameter(s) of the resulting general model that best fits the data? I mean, it's definitely been a while for me, but I don't seem to remember most numerical methods taking sample data as an input.
I suppose that if you, say, had 10 samples from t = 0, t = 1, t = 2, ... t = 9 so that you had a data set D = {(0, y0), (1, y1), (2, y2), ..., (9, y9)}, you could just treat that as 10 different problems where you solve the ODE over [0, 1] with an initial condition of (0, y0) and then over [1, 2] with an initial condition of (1, y1), etc... and you place a restriction that if, in your next timestep, you'll touch the edge of an interval (i.e. you're at t = 0.95 with h = 0.05), you force the value to match with (1, y1) so that your solution is continuous.
That still doesn't help if you don't have a proper parameter value, however.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now