# How can I solve this Ode system?

1 view (last 30 days)
Navid on 6 Sep 2014
Commented: Navid on 10 Sep 2014
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?

Yu Jiang on 7 Sep 2014
Edited: Yu Jiang on 7 Sep 2014
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?
Navid on 10 Sep 2014
It seems there was something wrong with my "D" matrix. Thanks.

Yu Jiang on 6 Sep 2014
Navid
You can find quite a few details and examples in the documentation.
-Yu Jiang
Navid on 6 Sep 2014
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.