98.5k views
1 vote
Use quiver to create a clear slope field for the differential equation.

dy/dt= sin(y) + sin(t)

User NeonGlow
by
5.0k points

1 Answer

5 votes

Answer:

The Matlab code along with the plot of slope field for the given differential equation is provided below.

Explanation:

Matlab quiver function:

The Matlab's quiver function may be used to plot the slope field lines for any differential equation.

The syntax of the function is given by

quiver(x, y, u, v)

Where matrices x, y, u, and v must all be the same size and contain corresponding position and velocity components.

Matlab Code:

[t,y] = meshgrid(0:0.2:2, 0:0.2:2);

v = sin(y) + sin(t);

u = ones(size(v));

quiver(t,y,u,v)

xlabel('t')

ylabel('y(t)')

xlim([0 2])

ylim([0 2])

Output:

The plot of the given differential equation is attached.

Use quiver to create a clear slope field for the differential equation. dy/dt= sin-example-1
User Rhamel
by
4.7k points