How can I solve this Ode system?

1 回表示 (過去 30 日間)
Navid
Navid 2014 年 9 月 6 日
コメント済み: Navid 2014 年 9 月 10 日
Hello guys. So I have this parabolic PDE which I convert it to an ODE system via Finite element method on a small domain say :
Y=[0 0.06250]x[0 0.06250]
the system is:
D m' = K m + F
m(0)=0
which K is the stiffness matrix (81x81) and F is the load matrix (81x1)and D is a (81x1) matrix. the result should be a (81x1) matrix for m. Can you please tell me how to solve this system in Matlab at a time node for example 1?
thanks in advance

採用された回答

Yu Jiang
Yu Jiang 2014 年 9 月 7 日
編集済み: Yu Jiang 2014 年 9 月 7 日
I can run your code with
[T,Y] = anzyme1(eye(81),eye(81), ones(81,1), 10)
What are the parameters you use such that you see the error message?
  1 件のコメント
Navid
Navid 2014 年 9 月 10 日
It seems there was something wrong with my "D" matrix. Thanks.

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

その他の回答 (1 件)

Yu Jiang
Yu Jiang 2014 年 9 月 6 日
Navid
You can find quite a few details and examples in the documentation.
-Yu Jiang
  1 件のコメント
Navid
Navid 2014 年 9 月 6 日
Thanks Yu,
I know about that but something is wrong about my code which I can't figure it out.Here is my code:
function [T,Y]=anzyme1(D,K,F,Delta)
%this is a function to solve the ode system: D m' = K m + F
this function takes D which is a constant (81x81) matrix I calculated
from the FEM stage. K is stiffness matrix again constant and (81x81)
and my loda vector being F which is a constant (81x1) matrix
Delta : the final time which I need to have the solution in.
f1=@(t,m) (K*m)+F;
%here I defined a function which describes the RHS
options=odeset('Mass',D);
%the Mass matrix is D which is a matrix with constant entries
m0=zeros([81 1]);
%my initial value is zero everywhere.
[T,Y]=ode23s(f1,[0,Delta],m0,options);
%I used ode23s to solve my ode system
and when I run it it says:
Warning: Failure at t=1.872630e-006. Unable to meet integration tolerances without
reducing the step size below the smallest value allowed (6.652917e-021) at time t.
Please help me.

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

カテゴリ

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