20.6.5.7. Unit Delay

The Unit Delay block delays the input signal a sample period specified in the block parameter. The unit delay represents the difference equation

\(y(k)=x(k-1)\)

Dialog box

../_images/image1483.png

Figure 20.84 Unit Delay dialog box

Table 20.44 Parameters

Parameter(s)

Description

Initial conditions

Enter the output signal for the first sampling period.

Sample time

Enter the time interval between samples.

20.6.5.7.1. Example

Loan amortization model

In this example, we builds a CoLink model for the amortization of an automobile loan. At the end of each month, the loan balance b(k) is the sum of the balance at the beginning of the month [b(k-1)] and the interest for the month [ib(k)], less the end-of-month payment p(k). Thus, the balance at the end of month k is

\(b(k)=rb(k-1)-p(k)\)

Where \(r=i+1\), and \(I\) is the monthly interest rate.

Assume that the initial loan balance is $15,000, the interest rate is 1% per month (12% annual interest), and the monthly payment is $200. Compute the loan balance after 100 payments.

The below figure shows a CoLink model of this system. The Unit Delay block computes b(k-1). The Unit Delay block Initial conditions is the initial loan balance (15,000). The Unit Delay block Sample time is set to 1. Set solver type to Fixed-Step, discrete (no continuous states), and let End time be 101. After running the simulation, the Scope block shows the ending balance.

../_images/image1492.png

Figure 20.85 colink model

../_images/image1362.png

Figure 20.86 A result from scope