Coupled ODE-PDE system with method of lines.
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Hi,
Im trying to simulate a fixed bed column, the model results in a coupled PDE-ODE system:
dC/dt = f(d2C/dz2, dC/dz, dq/dt) (1)
dq/dt = g(C, q) (2)
C and q -> dependent variables
t and z -> independent variables
I tried to use Method of Lines (I saw that is the best way in other posts), but Im confused in how to couple de ODE (2) in the system of ODEs that comes from the discretization in space of the PDE (1).
I appreciate any help.
0 Commenti
Risposte (1)
  Torsten
      
      
 il 15 Gen 2015
        I'm not sure I understand your problem.
The coupling between PDE and ODE is automatically introduced by the dependence of f on dq/dt.
Best wishes
Torsten.
2 Commenti
  Torsten
      
      
 il 20 Gen 2015
				Before calling ODE15s, define a vector y of length 2*n where n is the number of grid points. Then define initial conditions for C and q in vectors of length n, respectively. After this, copy these ínitial conditions in the vector y by setting
y(1:n)=C(1:n); y(n+1:2*n)=q(1:n);
In the function where you calculate the time derivatives, proceed just the other way round:
C(1:n)=y(1:n); q(1:n)=y(n+1:2*n);
Then collect time derivatives for C and q in vectors dCdt and dqdt of length n and return a vector dydt of length 2*n of the form
dydt=[dCdt;dqdt];
Best wishes
Torsten.
Vedere anche
Categorie
				Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

