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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by