traj_plot: Plots a trajectory

View source: R/traj_plot.R

traj_plotR Documentation

Plots a trajectory

Description

This function handles trajectories can stem from either of two sources:

  1. A parametric description of a curve, such as sin(t) ~ cos(t), along with a domain in t.

  2. The solution to an ordinary differential equation as produce by integrateODE()

Usage

traj_plot(..., npts = 500, nt = 5)

Arguments

...

Handles the first several objects which are, in this order - tilde: a two sided tilde expression - soln: optionally, a solution object such as from integrateODE(), or instead - domain: a domain object, e.g. domain(t=0:10)

npts

number of plotted points (default: 500)

nt

number of tick marks to use in a trajectory plot

Details

The tilde expression is the critical part

Examples

traj_plot(2*x + 3 ~ sin(x), domain(x=0:10))
PPdyn <- makeODE(dR ~  0.3*R - 0.03*R*F, dF ~ -0.3*F + 0.0003*R*F)
Soln <- integrateODE(PPdyn, domain(t=0:20), R=1200, F=8)
traj_plot(R(t) ~ F(t), Soln, nt=10)
traj_plot(R(t)*F(t) ~ t, Soln, nt=0)


mosaicCalc documentation built on Sept. 15, 2022, 9:06 a.m.