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