lab6solutions

Lab6solutions - ECE220 LAB6 Solution%Example 7.30%The array v contains the solution%Set up the initial conditions v(1,1)=1 v(2,1)=0 t(1)=0%Setup

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ECE220 LAB6 Solution %Example 7.30 %The array v contains the solution %Set up the initial conditions v(1,1)=1; v(2,1)=0; t(1)=0; %Setup the step size h=0.001; %Set up the recursion for 10000 steps N=10000; %Set up the A matrix . A=[0 1;-7/4 -1/2]; for k=1:N t(k+1)=t(k)+h; v(:,k+1)=v(:,k)+h*A*v(:,k)+h*[0;5*sin(10*pi*t(k))]; end %Now plot the solution plot(t,v(1,:)); grid on xlabel( 't' ) ylabel( 'v(t)' ) 0 1 2 3 4 5 6 7 8 9 10 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 t v(t) Underdamped Case
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 ------------------------------------------------------------------------------------------------- If changing the values of the coefficients in eq. 7.112, and it becomes 1 5 sin(1 0) 4 v v vt p + + =⋅ & && . Note: The characteristic equation has two equal real roots. It is critically damped. As a result, the revision in Matlab script will be, %Set up the A matrix A=[0 1;-1/4 -1]; 0 1 2 3 4 5 6 7 8 9 10 0 0.2 0.4 0.6 0.8 1 1.2 1.4 t v(t) Critically Damped Case -------------------------------------------------------------------------------------------------------
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/30/2009 for the course ECE 220 taught by Professor Nilson during the Spring '08 term at N.C. State.

Page1 / 3

Lab6solutions - ECE220 LAB6 Solution%Example 7.30%The array v contains the solution%Set up the initial conditions v(1,1)=1 v(2,1)=0 t(1)=0%Setup

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online