# Difference between revisions of "Phaseplot"

Line 1: | Line 1: | ||

When calling the phaseplot command, be sure that you are correctly inputting the arguments. Below is a proper example of how to call phaseplot: | When calling the phaseplot command, be sure that you are correctly inputting the arguments. Below is a proper example of how to call phaseplot: | ||

− | phaseplot('f',X1Range,X2Range, scale) | + | phaseplot('f',X1Range,X2Range, scale, Xinit) |

− | phaseplot('oscillator', [-1 1 10], [-1 1 10], 0.1) | + | phaseplot('oscillator', [-1 1 10], [-1 1 10], 0.1,boxgrid([-1 1 10], [-1 1 10])) |

Note that oscillator is the function that defines the derivative (look at week two and download oscillator.m if you don't know how to define the derivative function) and it is called with apostrophes: | Note that oscillator is the function that defines the derivative (look at week two and download oscillator.m if you don't know how to define the derivative function) and it is called with apostrophes: | ||

Line 12: | Line 12: | ||

X1Range and X2Range are of the form [min, max, num]. They define the axes of the plot and num determines how many arrows will be drawn along each corresponding axis. Make sure that the axes ranges include the equilibrium points. Scale is the final argument and it scales the arrows created on the quiver plot; 0.1 seems to be a good choice, but if your arrows are to small or too big try a different scale factor. | X1Range and X2Range are of the form [min, max, num]. They define the axes of the plot and num determines how many arrows will be drawn along each corresponding axis. Make sure that the axes ranges include the equilibrium points. Scale is the final argument and it scales the arrows created on the quiver plot; 0.1 seems to be a good choice, but if your arrows are to small or too big try a different scale factor. | ||

+ | |||

+ | Finally, Xinit determines what points to start the trajectories that get drawn on the phase diagram. For this you can either just make a list of points around the edge of the axes or you can use Professor Murray's boxgrid.m which is located on the Week 2 page of the wiki. If you choose to use boxgrid, call it as follows: | ||

+ | |||

+ | boxgrid(X1Range, X2Range) | ||

+ | |||

+ | X1Range and X2Range don't have to be the same as those that were put into the phaseplot command, but they do take the same form: [min max num]. | ||

--[[User:Merfeld| Max Merfeld]] | --[[User:Merfeld| Max Merfeld]] |

## Revision as of 18:18, 12 October 2008

When calling the phaseplot command, be sure that you are correctly inputting the arguments. Below is a proper example of how to call phaseplot:

phaseplot('f',X1Range,X2Range, scale, Xinit)

phaseplot('oscillator', [-1 1 10], [-1 1 10], 0.1,boxgrid([-1 1 10], [-1 1 10]))

Note that oscillator is the function that defines the derivative (look at week two and download oscillator.m if you don't know how to define the derivative function) and it is called with apostrophes:

Correct way: 'oscillator'

Incorrect ways: oscillator or @oscillator

X1Range and X2Range are of the form [min, max, num]. They define the axes of the plot and num determines how many arrows will be drawn along each corresponding axis. Make sure that the axes ranges include the equilibrium points. Scale is the final argument and it scales the arrows created on the quiver plot; 0.1 seems to be a good choice, but if your arrows are to small or too big try a different scale factor.

Finally, Xinit determines what points to start the trajectories that get drawn on the phase diagram. For this you can either just make a list of points around the edge of the axes or you can use Professor Murray's boxgrid.m which is located on the Week 2 page of the wiki. If you choose to use boxgrid, call it as follows:

boxgrid(X1Range, X2Range)

X1Range and X2Range don't have to be the same as those that were put into the phaseplot command, but they do take the same form: [min max num].

-- Max Merfeld