Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.09 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.09 KB

Diffy Q Proof of concept

This repository contains functions that are used to visualize the directional field of ordinary differential equations.

To use the directional_field function, we first declare a differential function with two inputs:

dydx = @(x, y) x + y;

We then graph the directional field with the following call:

directional_field(dydx);

Directional field1

Even if the ODE has only one input, to make MATLAB happy we should still define our function handle with two inputs:

dydx = @(x, y) x;
directional_field(dydx);

Directional field2

Directional field3

For a function involving squares, we should include the "element-wise" operator '.':

dydx = @(x, y) sin(x) + y.^2;
directional_field(dydx);

Directional field4 Directional field5

The integral_curves function can be used to add different paths through the directional field, but in its current state the call to MATLAB's built-in function "streamlines" is incredibly slow.