Test1 Fall 2011

# Solving for the columns we have g1 v u3 and g22u3v3

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g for the columns, we have g1 =(v-u)/3 and g2=2u/3+v/3. Using these, we can evaluate the product Problem 3: Write a MATLAB function that accepts as inputs the constants a,r,x0,N and returns the values x1,…,xN in a column vector where the x’s are defined by the difference equation Solution: Here is a simple function that does the job function y=Test_Problem_3(a,r,x0,N) % This function solves the difference equation % x_(k+1)=a*x_k+r^k, x_0=x0 % and returns the first N terms in the solution x_1, ..., x_N % Default arguments if nargin&lt;4, N=10; end; if nargin&lt;3, x0=1; end; if nargin&lt;2, r=1/2; end; if nargin&lt;1, a=1/10; end; x=a*x0+r^0; % x(1) y=[x]; if N&gt;=2 for k=1:N-1 1 x=a*x+r^k; y=[y;x]; % Creates a column of the values end; end Problem 4: Consider the difference equation conditions on a,r so that the solution xk approaches zero as k→∞. . Find ∑ Solution: As we saw in class the solution takes the form . It is clear that the term for every initial condition if and...
View Full Document

## This note was uploaded on 04/28/2013 for the course ENEE 222 taught by Professor Simon during the Spring '13 term at Maryland.

Ask a homework question - tutors are online