Solving ODEs with Modeling & Matlab

In summary, a user is trying to solve a system of ODE's involving a chemical reactor using Matlab. They have tried utilizing ode45 but it did not work. They are looking for tips or assistance in solving the problem. Another user suggests defining the state parameters and using ode45 or solving the system by hand. The user reports that both options were successful.
  • #1
Deuterio
2
0
I'm modeling a chemical reactor and I have to solve a system of ODE's like that:

dX/dV = a*X
dT/dV = b*(dX/dV) - c*(T-T0)

I've been a Matlab user for so long but I've never seen a solution of this kind of system. I've tried to solve using ode45 but it didn't work. I've searched in books and/or homepages about Matlab and I haven't found any tip.
If some one here could help me I'd be so grateful.

Thanks
 
Physics news on Phys.org
  • #2
I may be a little rusty, but I think if you define your state as:
s = [X, dX/dV, T, dT/dV], then you can use ode45 (or any other MATLAB ode solver). (I'm assuming you've used the solvers before and you're just having trouble with this problem.) So your derivative function will look something like this:

...
function sdot = deriv(V,S)
% Current values of state parameters
X = S(0);
dXdV = S(1);
T = S(3);
dTdV = S(4);

% Updated values of derivatives of state parameters
dXdV=a*X;
d2XdV2 = a*dXdV;
dTdV = b*(dXdV) - c*(T-T0);
d2TdV2 = b*d2XdV2 - c*dTdV;

sdot = [dXdV, d2XdV2, dTdV, d2TdV2];
 
  • #3
You could put the system in a more standard form. i.e. replace the occurance of dx/dv in the second equation with a*X, not to mention that I think you can probably solve it out by hand because the system is "triangular"
 
  • #4
Thanks

Both options have worked properly.
Thanks for your help!
 

1. What is ODE and why is it important in solving real-world problems?

ODE stands for Ordinary Differential Equation. It is a mathematical equation that relates the rate of change of a dependent variable to its independent variable. ODEs are important in solving real-world problems because many natural phenomena and physical processes can be described by ODEs. They allow us to model and predict the behavior of complex systems and make informed decisions.

2. How does modeling help in solving ODEs?

Modeling is the process of creating a simplified representation of a real-world system using mathematical equations. In the context of ODEs, modeling helps us to formulate the problem in a mathematical form, making it easier to solve. It also allows us to test different scenarios and understand the behavior of the system before implementing it in the real world.

3. What is Matlab and how is it used in solving ODEs?

Matlab is a high-level programming language and interactive environment designed for numerical computing. It is widely used in solving ODEs due to its built-in functions and tools for solving mathematical equations. It also has a user-friendly interface and powerful visualization capabilities, making it easier to analyze and interpret the results of ODE models.

4. What are the steps involved in solving ODEs with modeling and Matlab?

The steps involved in solving ODEs with modeling and Matlab are:
1. Formulating the problem: This involves defining the dependent and independent variables, initial conditions, and any parameters involved in the ODE.
2. Creating the model: Using mathematical equations, create a model that represents the behavior of the system.
3. Implementing the model in Matlab: Use the appropriate functions and syntax to implement the model in Matlab.
4. Solving the ODE: Use the built-in ODE solvers in Matlab to numerically solve the ODE.
5. Analyzing the results: Use Matlab's visualization tools to analyze and interpret the results of the ODE model.
6. Refining the model: If necessary, make adjustments to the model and repeat the process until the desired results are achieved.

5. Can ODEs with complex systems be solved using modeling and Matlab?

Yes, ODEs with complex systems can be solved using modeling and Matlab. Modeling allows us to break down complex systems into smaller, more manageable parts, making it easier to formulate the ODE. Matlab's powerful tools and functions can then be used to solve the ODE and analyze the results. However, it may require more advanced modeling techniques and knowledge of Matlab to solve highly complex ODEs.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Mechanics
Replies
18
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top