ODE vs. fde12 (solve fractional differential equation)

46 ビュー (過去 30 日間)
Sheldon Park
Sheldon Park 2019 年 8 月 2 日
コメント済み: Ramashis Banerjee 2020 年 7 月 31 日
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;

回答 (1 件)

Kavya Vuriti
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 件のコメント
Sheldon Park
Sheldon Park 2019 年 8 月 7 日
Thanks for your input. Just to clarify, y(1), y(2), and y(3) are NOT the 1st, 2nd, 3rd derivatives. Rather, they are three separate variables corresponding to A, B, and AB. I am working with a set of three coupled differential equations, where the first derivative of each, e.g. dA/dt, is expressed as a function of all three original variables, A, B and AB.
Ramashis Banerjee
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 ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by