Solving differential equation ODE45

4 次查看(过去 30 天)
BipityBop
BipityBop 2020-4-28
评论: BipityBop 2020-4-28
Hi,
I have two matrices, with just numeric values of velocities in x and y direction as its entries, stored separately. To find all positions I'll have to integrate the velocity values w.r.t time (dx = u*dt). How do I solve this using ode45 only? Because I have a matrix and not a function to give into the argument for ode45
Thanks!
  2 个评论
James Tursa
James Tursa 2020-4-28
Can you give more details about your problem? E.g., what are the exact sizes of your variables and what exactly is in them? Sounds like you want some sampled data integrated, and maybe the trapz( ) function is more appropriate for you.
BipityBop
BipityBop 2020-4-28
Basically I'm trying to simulate poisuelle flows with obstacles in the flow channel and plotting it using streamline function. I have stored the x-direction and y-direction velocity at every point in the flow channel. Now, I'm considering a particle in the flow and trying to study the positions it would take during its course of journey in the flow channel. To get x and y positions (co-ordinates) of this particle I will have to integrate the x-direction and y-direction velocity with respect to time, which put mathematically is x' = u and y' = v (x is the x coordinate of the position of the particle, y is the y coordinate of the position of the particle; u and v are x direction and y direction velocities respectively). This is a simple ODE to solve, but I would like to solve it using ODE45 function. Not sure of how to pass a matrix as an argument and u and v are time independent parameters.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by