Having issues with ODE solvers
Hey guys, I'm modelling a gasifier for my final year project.
I simply cannot get the ODE solver to work properly. I have tried all the different ODE solvers within MATLAB and the error is the same.
So to explain in a bit of detail, I have to plot the partial pressures or mass flowrates through the gasification reactor. When the ODE is called it runs without issue and proceeds to output a graph of the required data. The issue is that the data is wrong (e.g. I seem to be producing oxygen when it should be consumed). Using debug mode I have had a look at the input and output for this single variable and during each time step the results are fine (reaction rate is very slow) but then between timesteps, the ODE solver does not use the output from the last timestep as input for the new one, its just making one up.
Can somebody tell me whats going wrong with this?
all the best
edit: code for the function file http://pastebin.com/WADRVGhU Edit 2: image showing the issue I'm having, the decrease in O2 should be really small at the start (hand calcs show it to be 10^-9) therefore the value should not change significantly at the start. http://imgur.com/fLzQA
Edit 3: The dynamical system I'm trying to simulate is at this point just the devolitilisation of coal particles using equations from Vamvuka et al (1995) (http://www.sciencedirect.com/science/article/pii/0016236195000516) I appreciate some of you may be unable to open this document as you may not have a subscription but I don't want to be doing anything illegal by reproducing stuff from this paper without authorisation. The script file calling the function file is available here http://pastebin.com/XAdjFnHH
Posted Dec 2, 2012, 6:08 PM UTC · edited