how can I write a code to solve an integral (from 0 to t) which only has the initial function (at t=0)?

3 views (last 30 days)
I want to do an integral and only have the initial function for it. Assuming a y function, it is in this way: y=integration (over the range of 0 to t) of (derivation of y with respect to distance) dt and suppose initial condition is a constant number. I am going to write it as a summation of the areas by time steps(n steps) to get the final equation as a result of integral. Do you have any suggestion that how can I make it works in MATLAB? Thanks for you time and help

Accepted Answer

John D'Errico
John D'Errico on 5 Oct 2015
Edited: John D'Errico on 5 Oct 2015
This is normally called an ordinary differential equation. Your idea for solving it is effectively Euler's method, usually a poor choice if others are available.
help ode45
  1 Comment
nili
nili on 6 Oct 2015
Edited: nili on 6 Oct 2015
actually it is a partial differential equation. it means I have the derivation of the function with respect to time in one side and the other side with respect to distance. That makes it difficult and confusing for me.Assuming a y function, it is in this way: y=integration (over the range of 0 to t) of (derivation of y with respect to distance) dt and suppose initial condition is a constant number. (The only thing that I think may work is that because the derivation with respect to distance is in a specific distance, we can consider it as ode and solve it. In this case the distance will not be a variable).Thanks for you time and help

Sign in to comment.

More Answers (0)

Categories

Find more on Performance and Memory in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!