ODE vs. fde12 (solve fractional differential equation)
41 次查看(过去 30 天)
显示 更早的评论
Hello,
Thanks for contributing fde12. I'm trying to solve a set of coupled equations containing fractional derivatives. To validate that I'm using it correctly, I tested on a simple problem using ODE and fde12 (with alpha=1.0). I would have expected the same result. Unfortunately, they don't. The ODE output makes sense but fde12 output blows up quickly. I'm not sure if I'm using it correctly. Any advice you can provide would be greatly appreciated. Thank you.
-Sheldon
Here's the reaction I'm solving:
A + B < ---- > AB (kon=forward, koff=backward)
| k_el (rate of elimination for B)
V
(nil)
The code I'm running is:
format compact
k_el = 1.7;
kon = 100;
koff = 2.5;
% function definition
myfun = @(t,y) [-kon*y(1)*y(2) + koff*y(3);
-kon*y(1)*y(2) + koff*y(3) - k_el*y(2);
kon*y(1)*y(2) - koff*y(3)];
% using ODE
tspan = [0, 50];
tic; sol = ode23t(myfun,tspan,[4;2.5;0]); toc;
figure(1); plot(sol.x,sol.y); legend; grid;
% using fde12
t0=0; tfinal=50;
h=2^(-6); alpha=1.0;
tic; [t, qsol]=fde12(alpha,myfun,t0,tfinal,[4;2.5;0],h); toc;
figure(2); plot(t,qsol(1,:)); legend; grid;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232410/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232411/image.jpeg)
0 个评论
回答(1 个)
Kavya Vuriti
2019-8-7
Assuming y(1),y(2) and y(3) are the first, second and third order derivatives of y, ode23t function has the ability to solve higher order differential equations. For solving these multiterm fractional differential equations, refer to the following function which may solve your problem:
2 个评论
Ramashis Banerjee
2020-7-31
Could anyone tell me how to solve terminal value problem(integrating backward in time) using the same code??Please help me to solve it numerically.
Reach me at ramashisbanerjee@gmail.com
Thank you in advance.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!