Matlab - How to solve simultaneous non-linear differential equations?

In summary, the conversation discusses using MATLAB to solve simultaneous non-linear differential equations without using commands. The expert suggests using the Ode45 command and mentions that MATLAB is script-based and requires specific lines of code to solve equations. They also mention that this topic is not suitable for the EE forum.
  • #1
nachiappan
1
0
Matlab -- How to solve simultaneous non-linear differential equations?

How to solve simultaneous non-linear differential equations in MATLAB m-file without using the commands?. can you give me the program?.
 
Physics news on Phys.org
  • #2


"without using the commands"?

Matlab is -from a practical point of view- scripts based. You only need a few lines of code in order to solve a PDE, but you do need to write those lines; there is no "generic" program.
Matlab is quite different from e.g. Mathematica

Look up the command Ode45, that should be a good starting point.

Edit: And this thread should not be in the EE forum.
 

Related to Matlab - How to solve simultaneous non-linear differential equations?

1. How do I define the equations in Matlab?

In order to solve simultaneous non-linear differential equations in Matlab, you first need to define the equations using the "syms" function. This allows you to create symbolic variables and use them in your equations.

2. Can I use the "ode45" function to solve these equations?

Yes, the "ode45" function can be used to solve non-linear differential equations in Matlab. However, you may need to modify the equations or use additional functions such as "ode23" or "ode15s" for better accuracy.

3. How do I specify initial conditions for the equations?

You can specify initial conditions using the "ode45" function by adding a vector of initial values as a fourth argument. For example, if your equations have two variables, your initial conditions vector would have two values.

4. What is the difference between "ode45" and "ode23"?

The main difference between these two functions is their algorithm. "ode45" uses a fourth and fifth order Runge-Kutta method, while "ode23" uses a second and third order Runge-Kutta method. In general, "ode45" is more accurate, but "ode23" may be faster for some equations.

5. How can I plot the solutions of my equations in Matlab?

You can use the "plot" function to plot the solutions of your equations in Matlab. First, you need to store the output of the "ode45" function in a new variable and then use "plot" to plot the variables against time or any other variable you choose.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top