简体   繁体   中英

Solving differential equations with discrete values in MATLAB using ode45

I have a differential equation-

L'(x) = F1(x,L(x))

Using ode45, I have obtained the solution for L(x). I have an array of values for L(x) denoted by L_val. Using this solution, I intend to solve another differential equation.

w'(x)=L(x)/x

How can I solve for w(x)? Especially since L(x) is not a function of x, but an array of discrete values.

Use the cumulative trapezoidal integration function: https://fr.mathworks.com/help/matlab/ref/cumtrapz.html

Alternatively, you may use other rules with a better accuracy (Simpson's rule, search in Matlab central for the function file). Another pragrmatic way is too compute a high-order interpolant of your function and to integrate it directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM