# lin.diff.eqn: Solution of Autonomous Linear Differential Equations In rmutil: Utilities for Nonlinear Regression and Repeated Measurements Models

 lin.diff.eqn R Documentation

## Solution of Autonomous Linear Differential Equations

### Description

`lin.diff.eqn` numerically solves a system of autonomous linear differential equations with given initial conditions by matrix exponentiation.

### Usage

```lin.diff.eqn(A, initial, t=1)
```

### Arguments

 `A` A square matrix giving the coefficients of the equations. `initial` The vector of initial values of the system. `t` A scalar or vector of values of the independent variable for which solutions are sought.

### Value

A matrix of solutions with one row for each value of `t`.

J.K. Lindsey

### Examples

```a <- matrix(c(1,0,1,0,0,0,0,0,-1),ncol=3,byrow=TRUE)
x <- c(5,7,6)
lin.diff.eqn(a,x,1)
# function giving the exact solution
exact <- function(t) c(8*exp(t)-3*exp(-t),7,6*exp(-t))
exact(1)
```

rmutil documentation built on March 18, 2022, 6:55 p.m.