Borrar filtros
Borrar filtros

How do I use quiver with an implicit differential equation?

8 visualizaciones (últimos 30 días)
Ramadan M
Ramadan M el 15 de Sept. de 2020
Respondida: esat gulhan el 16 de Sept. de 2020
I have pasted the full question below for context, but essentially, I'm having issues ironing out how quiver works for part a. I tried to mimic the example in the textbook, but it returns multiple errors, and I've checked the documentation for quiver, which hasn't helped.
syms y(t)
[T, Y] = meshgrid(-10:0.2:10, -1:0.2:2); %unsure what the bounds should be???
S = (2*y - t)/(2*t - y); %equation
quiver(T, Y, ones(size(S)), S), axis equal tight
xlabel ’t’, ylabel ’y’
title ’Direction Field for dy/dt = (2*y - t)/(2*t - y)’

Respuestas (1)

esat gulhan
esat gulhan el 16 de Sept. de 2020
Maybe like this
syms S C c t y
[T, Y] =meshgrid(-10:0.5:10,-10:0.5:10);
S= ((2.*Y-T)./(2.*T-Y))
dT = ones(size(S)); %equation
dyu = S./sqrt(dT.^2+S.^2);
dxu = dT./sqrt(dT.^2+S.^2);
quiver(T,Y,dxu,dyu)
xlabel ’t’, ylabel ’y’
title('Direction Field for dy/dt = (2*y - t)/(2*t - y)')
set(gca, 'XLim', [0 10], 'YLim', [0 10]);
It is not an easy ODE, There is singularity in some fields. Can not be reached with dsolve, can be reach numerically ODE solvers

Categorías

Más información sobre General Physics en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by