Help me solving these coupled ode's in matlab

In summary, to find the concentration of cg versus time in a biotrickling filter, numerical methods can be used to solve a system of equations that describe the mass balances in the gas and liquid phases, as well as in wetted and non-wetted biofilm segments. The initial value of cg can be used as the starting point for the calculations and sensitivity analysis can be performed to better understand the model and its parameters.
  • #1
raj_nitr
2
0
here i got initial value of cg and i need to find cg vrs. t


The model equations were derived form the assumptions and the model structure. The main mass balances in each phase are described by the following equations, where j refers to the vertical segment along the height of the biotrickling filter, numbered form bottom of the reactor, and I refers to the segment depth in the biofilm numbered form the interface.

Gas Phase:

Vg dCg[j] = Fg(Cg[j-1]-Cg[j])-kg1Aw(Cg[j]-Cgi1[j])-kg2Anw(Cg[j]-Cgi2[j] ---------------(1)
dt



Liquid Phase:
VL dCL[j] = FL(CL[j+1]-CL[j])-kg1Aw(Cg[j]-Cgi1[j])-kg2Aw(CL[j]-CLi2[j] ---------------(2)
dt
The mass balance for most wetted biofilm segments is expressed by Equation 3, except for the last layers which bear boundary constraints. The equation for the first biofilm layer near the interface takes the form of Equation r, while that of last layer before the substratum is represented by Equation 5. In a similar manner, pollutant mass balances for the non-wetted biofilm segments described by Equations 6-8.

Wetted Biofilm Phase:
dCwb[j] =D/(FT)2 (Cwb[i-1,j]-2Cwb[i,j]+Cwb[i+1,j]-Rwb[i,j] ---------------(3)
dt


dCwb[1,j] =D/(FT)2 (CL[j]-2Cwb[1,j]+Cwb[2,j]-Rwb[1,j] ---------------(4)
dt


dCwb[N,j] =D/(FT)2 (Cwb[N-1,j]-Cwb[N,j]-Rwb[N,j] ---------------(5)
dt



Non-wetted biofilm segments:

dCnwb[i,j] =D/(FT)2 (Cnwb[i-1,j]-2Cnwb[i,j]+Cnwb[i+1,j]-Rnwb[i,j] ---------------(6)
dt




dCnwb[1,j] =D/(FT)2 (Cg[j]/H-2Cnwb[1,j]+Cnwb[2,j]-Rnwb[1,j] ---------------(7)
dt

dCnwb[N,j] =D/(FT)2 (Cnwb[N-1,j]-Cnwb[N,j]-Rnwb[N,j] --------------(8)
dt


Reaction rates:
For Wetted biofilm:


Rwb[i,j] = Rmax Cwb[i,j]
Ks+Cwb[i,j]



For Non-Wetted Biofilm

Rnwb[i,j] = Rmax Cnwb[i,j]
Ks+Cnwb[i,j]
 
Physics news on Phys.org
  • #2




To find the concentration of cg versus time, you can use numerical methods to solve the system of equations (1)-(8). This approach involves discretizing the equations and solving them at different time steps until a steady state is reached. The initial value of cg can be used as the starting point for the calculations. As time progresses, the concentration of cg will change according to the model equations and the specified reaction rates. Once a steady state is reached, the concentration of cg versus time can be plotted to show the behavior of the system. This can provide valuable insights into the dynamics of the biotrickling filter and help in optimizing its performance. Additionally, sensitivity analysis can be performed by varying the initial value of cg and observing its impact on the system behavior. This can help in understanding the robustness of the model and identifying critical parameters. Overall, using numerical methods to solve the system of equations can provide a comprehensive understanding of the concentration of cg versus time in the biotrickling filter.
 
  • #3



To solve these coupled ODEs in MATLAB, you can use the built-in function 'ode45'. This function uses a variable-step Runge-Kutta method to numerically solve the system of equations. You will need to define the equations as a function and provide the initial conditions for the concentrations of Cg, CL, Cwb, and Cnwb at each segment. The function should take in the current time and concentrations as inputs and output the derivatives of the concentrations. The syntax for using 'ode45' is as follows:

[T, C] = ode45(@(t,c)ode_func(t,c), [t0 tf], [Cg0 CL0 Cwb0 Cnwb0]);

where 't0' and 'tf' are the initial and final times, respectively, and 'Cg0', 'CL0', 'Cwb0', and 'Cnwb0' are the initial concentrations at each segment. 'ode_func' is the name of the function you created to define the equations. The output 'T' is a vector of the time points at which the concentrations were calculated, and 'C' is a matrix of the concentrations at each time point. You can then plot the concentrations versus time using the output from 'ode45'.

I hope this helps you get started with solving the coupled ODEs in MATLAB. Good luck!
 

1. How do I define the equations in MATLAB?

To define the equations, you will need to use the syms function to declare your variables and then use the odeFunction function to define the equations. You can also use the anonymous function syntax to define the equations directly in the ode45 function.

2. How do I specify initial conditions?

You can specify initial conditions by creating a vector containing the initial values for each variable and passing it as an argument to the ode45 function. Alternatively, you can use the initial value syntax in the odeFunction function to specify initial conditions.

3. What is the difference between ode45 and ode23?

ode45 and ode23 are both MATLAB functions for solving ordinary differential equations. The main difference between them is the algorithm they use to solve the equations. ode45 is more accurate and can handle stiff equations, while ode23 is less accurate but faster for non-stiff equations.

4. How do I plot the solutions to the coupled ODEs?

To plot the solutions, you can use the tspan output from the ode45 function as the x-axis and the solution vector as the y-axis. You can also use the deval function to evaluate the solution at specific time points and plot the results.

5. Can I solve coupled ODEs with different initial conditions?

Yes, you can solve coupled ODEs with different initial conditions by calling the ode45 function multiple times with different initial conditions. You can also use a for loop to iterate through different initial conditions and store the solutions in a matrix for further analysis.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Quantum Physics
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Differential Equations
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top