How can I solve this Ode system?

1 次查看(过去 30 天)
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