How can I solve this Ode system?

1 visualizzazione (ultimi 30 giorni)
Navid
Navid il 6 Set 2014
Commentato: Navid il 10 Set 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?
thanks in advance

Risposta accettata

Yu Jiang
Yu Jiang il 7 Set 2014
Modificato: Yu Jiang il 7 Set 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?
  1 Commento
Navid
Navid il 10 Set 2014
It seems there was something wrong with my "D" matrix. Thanks.

Accedi per commentare.

Più risposte (1)

Yu Jiang
Yu Jiang il 6 Set 2014
Navid
You can find quite a few details and examples in the documentation.
-Yu Jiang
  1 Commento
Navid
Navid il 6 Set 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.
Please help me.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by