ODE for no-analytical function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to solve:
dx/dt=u;
dy/dt=v;
du/dt=F(x,y)-a*u;
dv/dt=G(x,y)-a*v;
But F and G are not analytical functions. They are periodic functions but I only have a matrix with the value of F(x,y) and G(x,y) in one period.
ODE45 only uses analytical functions.
Any suggestions?
0 comentarios
Respuestas (3)
Walter Roberson
el 26 de Mayo de 2011
When you say that you have matrices with those values, do you mean that you have a 2D discrete sampling? If so are the samples accurate to within calculation round-off error, or are they samples with noise (perhaps due to measurement uncertainty)?
Unfortunately, if they are discrete, then the variety of approximation that would be used to extend them to continuous could make a considerable difference on the degree of difficulty of solving the differential equations (or on the accuracy of the solution.) Piecewise approximations such as linear or spline could, I suspect, lead to integration difficulties. But you might be able to get something that way.
If the samples have noise, that noise is going to be magnified through the double integration.
What is known about the properties of F and G?
1 comentario
Walter Roberson
el 26 de Mayo de 2011
Note: it appears the more explicit writing of the system would be
[diff(x(t), t) = u(t), diff(y(t), t) = v(t), diff(u(t), t) = F(x(t), y(t))-a*u(t), diff(v(t), t) = G(x(t), y(t))-a*v(t)]
Camilo
el 26 de Mayo de 2011
2 comentarios
Walter Roberson
el 26 de Mayo de 2011
I'm doing a trial analytical solution with some pretty simple periodic F and G, and it is taking some time :( This does not bode well for complex F and G and analytic solutions.
To cross-check: if a call were made for any particular (x,y), you could return fairly accurate F and G values? Or would you be doing a standard interpolation into the matrix, such as via interp2() ?
I will need to do more research on this, but I'm not certain I would recognize the solution when I read it. Perhaps someone else will already know a method.
Walter Roberson
el 26 de Mayo de 2011
Yikes! My trial analytical solution with simple F and G ran for about 22 minutes and then suddenly blew up and chewed through 2 GB of memory in a short number of seconds. I'm not doing _that_ again soon!
Emmanuel Racine
el 1 de Jul. de 2011
I can see how to solve this problem. First create functions fcn_F(x,y) and fcn_G(x,y) that return the values of F and G for an arbitrary point (x,y) inside the first period of your functions. You will need for this to interpolate the values between the points provided by your matrix.
A periodic function is such that f(x)=f(x+T). Apply this principle to your two-dimensional functions (you may have two periods here) in order to bring the evaluation point (x,y) inside the first period. Use the modulo operator for this. Perform this translation prior to evaluating F and G. In this way you will have two continuous functions that you can use with an ODE solver.
0 comentarios
Ver también
Categorías
Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!