Ask Question
14 January, 15:51

My professor showed us in class today how to use ode45 to solve a differential equation numerically. i would like to use it on my homework but i have a second order differential equation and the example i saw in class was only first order. can ode45 be used for second order diffeqs? what do i need to do differently? the equation i am trying to solve is:

+5
Answers (1)
  1. 14 January, 19:47
    0
    Yes, ode45 can be used for higher-order differential equations. You need to convert the higher order equation to a system of first-order equations, then use ode45 on that system.

    For example, if you have

    ... u'' + a·u' + b·u = f

    you can define u1 = u, u2 = u' and now you have the system

    ... (u2) ' + a·u2 + b·u1 = f

    ... (u1) ' = u2

    Rearranging, this is

    ... (u1) ' = u2

    ... (u2) ' = f - a·u2 - b·u1

    ode45 is used to solve each of these. Now, you have a vector (u1, u2) instead of a scalar variable (u). A web search regarding using ode45 on higher-order differential equations can provide additional illumination, including specific examples.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “My professor showed us in class today how to use ode45 to solve a differential equation numerically. i would like to use it on my homework ...” in 📘 Mathematics if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers