Singularity_310 - - 5)^4; end elseif x(npts,1) < 8 for i...

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

View Full Document Right Arrow Icon
dx = 0.1; final = 6; x = (0:dx:final)'; npts = size (x,1); U = zeros (npts,1); U if x(npts,1) < 5 for i = 1:5/dx U(i,1) = (57/6)*x(i,1)^3 - 238.25*x(i, 1) + (-5/6)*x(i, 1)^4; end elseif x(npts,1) < 7 for i = 1:5/dx U(i,1) = (57/6)*x(i,1)^3 - 238.25*x(i, 1) + (-5/6)*x(i, 1)^4; end for i = 5/dx:final/dx U(i,1) = (57/6)*x(i, 1)^3 - 238.25*x(i, 1) + (-5/6)*x(i, 1)^4 + (5/6)*(x(i, 1)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: - 5)^4; end elseif x(npts,1) < 8 for i = 1:npts U(i,1) = (57/6)*x(i, 1)^3 - 238.25*x(i, 1) + (-5/6)*x(i, 1)^4 + (5/6)*(x(i, 1) - 5)^4 + 75*(x(i, 1) - 7)^2; end else x(npts,1) >= 8 for i = 1:npts U(i,1) = (57/6)*x(i, 1)^3 - 238.25*x(i, 1) + (-5/6)*x(i, 1)^4 + (5/6)*(x(i, 1) - 5)^4 + 75*(x(i, 1) - 7)^2 + (15/6)*(x(i, 1) - 8)^3; end end e plot (x, U) p...
View Full Document

This note was uploaded on 09/21/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Ask a homework question - tutors are online