Solve DAEs in MATLAB | Omar Bin Yusuf

  • MATLAB
  • Thread starter oby7842
  • Start date
  • Tags
    Matlab
In summary, the conversation is about a problem with solving two differential-algebraic equations (DAEs) in MATLAB. The equations involve an independent variable, X, and two dependent variables, U1 and U2, as well as other constants. The person is seeking suggestions and hints on how to solve the problem, particularly with the Mass matrix, which is dependent on the dependent variables. It is suggested to refer to MATLAB help and consider using the ode15 or ode23 functions, and possibly ode45, to solve the DAEs.
  • #1
oby7842
11
0
I have problem in solving following DAE's:

1. 0 = X*U1*C4+X*U2*C4 - 1

2. Re*C1*(U1+U2)*U1' +Re*C2*(U1^2+U2)*U2'= X*(U1*C2+U1*U2+U2*C3)+(1/X)*(U1+U2)

here X is the independent variable and U1 and U2 depend on X and others are constants.I need to solvethis DAE's in matlab. To solve in MATLAB i have following Mass matrix and function:

M=[0 0 ; Re*C1*(U(1)+U(2)) Re*C2*(U(1)^2+U(2))]; U'=[U(1)' ; U(2)'] ;

f = [ X*U1*C4+X*U2*C4 - 1 ; X*(U1*C2+U1*U2+U2*C3)+(1/X)*(U1+U2) ];

can you give me any suggestion how can I solve this problem in matlab? I will appreciate any kind of suggestion in this regard. I would be grateful also if I get any kind of hints to solve the Mass matrix. thanks for reading my problem.

Omar Bin Yusuf
 
Physics news on Phys.org
  • #2
go thru MATLAB help..its explicitly given there
i think ode15 or ode23 will suit ur purpose..
 
  • #3
yeah in MATLAB help its says that ode15s can solve this type DAE's. But my Mass matrix M is dependent of U(dependent variable)...I have example to solve this type of problem when Mass matrix is constant. But how can I evaluate value of M?
 
  • #4
i prefer using ode45 for dat...
 
  • #5
Can you please elaborate the idea a bit?? It will be a great help for me. thanks
 

FAQ: Solve DAEs in MATLAB | Omar Bin Yusuf

1. What are DAEs and why is it important to solve them?

DAEs (Differential-Algebraic Equations) are a type of mathematical model that combines both differential equations and algebraic equations. They are commonly used to model complex systems with both continuous and discrete variables. It is important to solve DAEs because they are widely used in many fields such as engineering, physics, and economics to understand and predict the behavior of dynamic systems.

2. How can MATLAB be used to solve DAEs?

MATLAB has built-in functions and tools specifically designed for solving DAEs. The "ode15s" function is commonly used to solve stiff DAEs, while the "ode23t" function can be used for non-stiff DAEs. Additionally, MATLAB also has the "ode15i" and "ode15s" functions for solving index-1 and index-2 DAEs, respectively.

3. What is the process for solving DAEs in MATLAB?

The first step is to define the DAEs using MATLAB's symbolic math toolbox. This involves creating symbolic variables for the dependent and independent variables and writing the DAEs in terms of these variables. Next, the "ode15s" or "ode23t" function is used to numerically solve the DAEs. The solutions can then be plotted or analyzed using MATLAB's visualization and analysis tools.

4. Can MATLAB solve DAEs with initial conditions?

Yes, MATLAB has the capability to solve DAEs with initial conditions. The initial conditions can be specified in the form of a vector and passed to the "ode15s" or "ode23t" function as an additional argument. MATLAB also provides options for specifying the tolerance and other parameters for solving DAEs with initial conditions.

5. Are there any limitations to using MATLAB for solving DAEs?

While MATLAB is a powerful tool for solving DAEs, it does have some limitations. In particular, it may not be suitable for solving DAEs with discontinuities or singularities. Additionally, the accuracy of the solutions may be affected by the choice of solver and tolerance settings. It is important to carefully choose the appropriate solver and adjust the settings for the specific DAE problem at hand.

Similar threads

Replies
14
Views
31K
Replies
2
Views
1K
Replies
2
Views
4K
Replies
1
Views
1K
Replies
14
Views
3K
Back
Top