Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Integral to ode

  1. Nov 5, 2004 #1
    How do you reformulate an integral as an ode-problem?
  2. jcsd
  3. Nov 5, 2004 #2
    Differentiate both sides of the equation? Or do you mean something else? :/
  4. Nov 5, 2004 #3
    But is that possible if you have an integral between two values. I know its possible if you have an indefinite?! integral...now i have

    M(y)=int(a,b) m(x,y) dx
  5. Nov 6, 2004 #4
    m(x, y) is a function of x and y if you integrate this with respect to x you will get a function of y, so that will then be M(y):

    [tex]\int_a^b m(x, y) dx = [f(x, y)]_a^b = f(b, y) - f(a, y) = M(y)[/tex]
  6. Nov 6, 2004 #5
    But I want to reformulate this integral to an ode-problem
  7. Nov 6, 2004 #6
    well I think the only way you can do that is like Nylex said, like this:

    [tex]\frac{d(\int_a^b m(x, y) dx)}{dy} = \frac{dM(y)}{dy}[/tex]
  8. Nov 8, 2004 #7
    But with this I still need to solve the integral, dont I?
    And I want to rewrite it as an ode so i dont have to solve the integral.
  9. Nov 8, 2004 #8

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    From your posts it isn't clear if y is a function of x or not, since it usually isn't that the integral has limits a and b.

    An integral that can be turned into a differential (ODE) would be something like:

    [tex]\int_0^xf(t)dt = y[/tex]

    which has associated differential equation dy/dx = f(x)

    so why do you even think that the type of equation you wrote has an ODE equivalent?

    Even if y were a function of x, then the integral you wrote would still only yield a number, and that isn't the function y.
  10. Nov 8, 2004 #9
    y isnt a function of x. a and b are reell numbers.
    The question in the book is(numerical analysis)

    M(y)=int(a,b) m(x,y) dx
    a. Use quadl in matlab to determine M
    b. An alternative way to determine M is to rewrite the integral as an ODE-problem. Do that and use ode45 in matlab to solve the ode-problem. Compare with the solution in a.

    b is really strange...
  11. Nov 8, 2004 #10
    what ode45(f, [a, b], y0) does is simply integrating f from a to b, using inital value y0...

    so you can use that to get your answer (you will need to use the @ again ;-), like this ode45(@f, [a, b], 0)
  12. Nov 9, 2004 #11
    Do you mean that the initial value is f(a). Then
    ode45(@f, [a, b], y0)
    should yield the same value as
    but it dont.
    I want them to yield the same value...what am i doing wrong...
  13. Nov 9, 2004 #12
    I think the inital value should be f(0)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook