Solving differential equation ODE45

1 visualizzazione (ultimi 30 giorni)
BipityBop
BipityBop il 28 Apr 2020
Commentato: BipityBop il 28 Apr 2020
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 Commenti
James Tursa
James Tursa il 28 Apr 2020
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 il 28 Apr 2020
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.

Accedi per commentare.

Risposte (0)

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by