# How do you plot an ordinary differential equation in Matlab?

Table of Contents

- 1 How do you plot an ordinary differential equation in Matlab?
- 2 What is a parametric plot?
- 3 How do you plot an equation in Matlab?
- 4 How do you find the constant of a differential equation?
- 5 How do I compare two solutions in dsolve?
- 6 Is it possible to solve second order non-constant coefficient differential equations?

## How do you plot an ordinary differential equation in Matlab?

How Graph differential equations with Matlab

- \%\%PROBLEM 1.
- syms y(x)
- ode = y*diff(y,x)+36*x == 0;
- ySol(x) = dsolve(ode)
- ezplot(y(x))

## What is a parametric plot?

A parametric plot is one in which a function or expression is plotted against another function or expression that uses the same independent variable.

**How do you solve a coupled differential equation in Matlab?**

Direct link to this answer

- syms w b g m x(t) y(t) z(t)
- assume([w, b, g, m],’real’)
- Dx = diff(x,t);
- Dy = diff(y,t);
- Dz = diff(z,t);
- eq(1) = m*diff(x,t,2) == -b*Dx;
- eq(2) = m*diff(y,t,2) == -w*Dz – b*Dy;
- eq(3) = m*diff(z,t,2) == w*Dy – b*Dz – m*g;

### How do you plot an equation in Matlab?

MATLAB – Plotting

- Define x, by specifying the range of values for the variable x, for which the function is to be plotted.
- Define the function, y = f(x)
- Call the plot command, as plot(x, y)

### How do you find the constant of a differential equation?

Another way to find the constants would be to specify the value of the solution and its derivative at a particular point. Or, These are the two conditions that we’ll be using here. As with the first order differential equations these will be called initial conditions.

**How do you find the differential equation for twobvp?**

The example function twoode has a differential equation written as a system of two first-order ODEs. The differential equation is function dydx = twoode (x,y) \%TWOODE Evaluate the differential equations for TWOBVP.

## How do I compare two solutions in dsolve?

An excellent way to solve this is by using ReplaceAll (a.k.a. /.) with the Rule s already included in the solution produced by DSolve. Ensure that your parameters (e.g. U and V) are assigned values with Set ( = ); do not use Equal ( ==) here, which is an operator used to define equations and do logical comparisons of two expressions.

## Is it possible to solve second order non-constant coefficient differential equations?

However, most of the time we will be using (2) (2) as it can be fairly difficult to solve second order non-constant coefficient differential equations. Initially we will make our life easier by looking at differential equations with g(t) = 0 g ( t) = 0.