Hi,
I want to use ode45 to solve a system of ODE as shown below (see the imgae). I am not sure about coding these two equations as I derived them using finite difference method according to the direction. I coded them as:
dydt(1,1) = f(y(1)) + f(y(2));
dydt(2,1) = - (f(y(1)) + f(y(2))); % with -1
The second one was multiplied by -1 to show a countercurrent flow. I am wondeing if this approach is correct. Or I should ignore the negative sign in coding these equations.
dydt(1,1) = f(y(1)) + f(y(2));
dydt(2,1) = (f(y(1)) + f(y(2))); % without -1
Thank you.
q1.png

2 件のコメント

John D'Errico
John D'Errico 2019 年 5 月 5 日
Why would you ignore the sign?
sina
sina 2019 年 5 月 5 日
This is exactly my question! Do I add -1 to show the countercurrent mode? As there is no -1 in original equations.

サインインしてコメントする。

 採用された回答

David Goodmanson
David Goodmanson 2019 年 5 月 6 日

1 投票

Hello sina,
If you turn the diagram around by 180 degrees and then let Ca <--> Cb, you get exactly the same diagram that you started with. That means the equations have to have the same symmetry under Ca <--> Cb. If both equations have a positive sign you do get the same equations. But if one equation has a negative sign, that negative sign switches to the other equation. So positive works, negative doesn't.
Another way of saying the same thing is, starting out with that symmetric diagram, how would you decide which of dCa/dt or dCb/dt gets the negative sign?

1 件のコメント

sina
sina 2019 年 5 月 6 日
Hi David,
Thank you for the comment.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2019 年 5 月 5 日

コメント済み:

2019 年 5 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by