Skip to content
/ diffyQ Public

A showcase of MATLAB functions I wrote when learning Ordinary Differential Equations

Notifications You must be signed in to change notification settings

ejovo13/diffyQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A showcase of MATLAB functions I wrote when learning Ordinary Differential Equations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages