Project 2: due date is April 5th , 2017 before class time The objective of this project is to use ARM assembly to branch to functions and pass the argument to the functions using the stack and either receive the result on the stack or in a register. 1. Write your project in pseudocode. 2. Place the following integers into an input file. Use them as an inputs for running operations: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 3. Have 2 output files. The first one must have three columns: the first is the integer, the second is the summation (using the algorithm n/2 *(n+1)), and the third column is the factorial of the number. Prior to column headings there should be string(s) of character that lists your class name, number, and your name and last name. The second output file is described in part 4. 4. Use the following functions in this problem: • File open • File append • Number factorial • Number summation For each integer, save the results of factorial and summation in a memory array contiguously. For example, the array would read: A = …, (n-1)!, Σ𝑖𝑛−1𝑖=0, n!, Σ𝑖𝑛𝑖=0,… After processing all the integers, perform an insertion sort on the resultant array. You can find its explanation on the internet. The example below is from Wikipedia: for i = 1 to length (A) -1 x = A[i] j = i – 1 While j >= 0 and A[j] > x A[j + 1] = A[j] j = j – 1 end while A[j + 1] = x End for loop Note: A is the array of integer values calculated by your summation and factorial functions. Write the calculated integer values from the sorted array to the second output file. The integers must be sorted in an ascending order. Note: 1. Each subroutine/function must have comment block in the beginning which explains which variables are the inputs that are received from caller and where they are located, and what is (are) the function’s output(s), where it is located, and how its returned to the caller. 2. Utilize the stack for passing parameters.

Project 2: due date is April 5th , 2017 before class time The objective of this project is to use ARM assembly to branch to functions and pass the argument to the functions using the stack and either receive the result on the stack or in a register. 1. Write your project in pseudocode. 2. Place the following integers into an input file. Use them as an inputs for running operations: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 3. Have 2 output files. The first one must have three columns: the first is the integer, the second is the summation (using the algorithm n/2 *(n+1)), and the third column is the factorial of the number. Prior to column headings there should be string(s) of character that lists your class name, number, and your name and last name. The second output file is described in part 4. 4. Use the following functions in this problem: • File open • File append • Number factorial • Number summation For each integer, save the results of factorial and summation in a memory array contiguously. For example, the array would read: A = …, (n-1)!, Σ𝑖𝑛−1𝑖=0, n!, Σ𝑖𝑛𝑖=0,… After processing all the integers, perform an insertion sort on the resultant array. You can find its explanation on the internet. The example below is from Wikipedia: for i = 1 to length (A) -1 x = A[i] j = i – 1 While j >= 0 and A[j] > x A[j + 1] = A[j] j = j – 1 end while A[j + 1] = x End for loop Note: A is the array of integer values calculated by your summation and factorial functions. Write the calculated integer values from the sorted array to the second output file. The integers must be sorted in an ascending order. Note: 1. Each subroutine/function must have comment block in the beginning which explains which variables are the inputs that are received from caller and where they are located, and what is (are) the function’s output(s), where it is located, and how its returned to the caller. 2. Utilize the stack for passing parameters.

checkyourstudy.com Whatsapp +919911743277
MATH 248 SPRING 2017 – LABORATORY ASSIGNMENT 6 – Sochacki DUE: Wednesday April 12, 2017 POINTS: 50 You are to write a Matlab script that will determine approximations to the first and second derivatives for the solution to the initial value ordinary differential equation (IVODE) problem ‘()*(); (0)xtaxtbxα=−= at a given t. You should ask the user for the numbers ,,,abtα and other parameters needed to approximate the first and second derivative. Guidelines: (1) First you should do a neat one-three page (8.5 x 11) write up showing properties of the solution to this system. You should sketch what solutions to this equation look like. These sketches should be accurate. Since you can solve this equation exactly, you should give the error bounds for your approximations to the derivatives. (2) Your program should print the approximations with labels indicating what the output represents. (3) You should make sure your code minimizes calculation and errors. (4) Since you know the exact answer, you should have your code output the absolute error for your approximations. (5) Give a plot of your numerical solution to this IVODE for the parameters I give you.

MATH 248 SPRING 2017 – LABORATORY ASSIGNMENT 6 – Sochacki DUE: Wednesday April 12, 2017 POINTS: 50 You are to write a Matlab script that will determine approximations to the first and second derivatives for the solution to the initial value ordinary differential equation (IVODE) problem ‘()*(); (0)xtaxtbxα=−= at a given t. You should ask the user for the numbers ,,,abtα and other parameters needed to approximate the first and second derivative. Guidelines: (1) First you should do a neat one-three page (8.5 x 11) write up showing properties of the solution to this system. You should sketch what solutions to this equation look like. These sketches should be accurate. Since you can solve this equation exactly, you should give the error bounds for your approximations to the derivatives. (2) Your program should print the approximations with labels indicating what the output represents. (3) You should make sure your code minimizes calculation and errors. (4) Since you know the exact answer, you should have your code output the absolute error for your approximations. (5) Give a plot of your numerical solution to this IVODE for the parameters I give you.

checkyourstudy.com Whatsapp +919911743277

checkyourstudy.com Whatsapp +919911743277

checkyourstudy.com Whatsapp +919911743277

checkyourstudy.com Whatsapp +919911743277
PDE assignment 3 Numerical Problems 1. (From Problem 1, Chapter 2, of Smith) Calculate a finite-difference solution of ut 􀀝 uxx 􀂟0 􀀜 x 􀀜 1, t 􀀞 0􀂠 satisfying the initial condition u 􀀝 sin􀂟􀀽x􀂠 when t 􀀝 0 for 0 ≤ x ≤ 1 and u 􀀝 0 at x 􀀝 0,1 for t 􀀞 0 Use the explicit method with 􀀭x 􀀝 0. 1, r 􀀝 0.1. Compare to the answers in Smith to check that your code is working. Then compute with 􀀭x 􀀝 0. 01, r 􀀝 0.1 and r 􀀝 0. 5. Determine and plot the solution to t 􀀝 0.01 and t 􀀝 0.1 for each case. Do not provide all output, just the plots and the specific approximations where you computed the exact solutions. Show that a solution of the PDE, satisfying the BC’s and IC’s is U􀂟x, t􀂠 􀀝 e−􀀽2t sin􀂟􀀽x􀂠 Verify the accuracy of your numerical approximations at t 􀀝 0. 005, t 􀀝 0.01 and t 􀀝 0.1 for x 􀀝 0.2 and x 􀀝 0.5 2. Showthat theCrank-Nicholsonschemeisconsistentandthat thelocal truncationerrorat the point 􀂟ih, jk􀂠 of the Crank-Nicholson approximation to Ut 􀀝 Uxx is of order O􀂟h2􀂠 􀀎 O􀂟k2􀂠. Then under the assumption that the scheme is unconditionally stable, prove that the solutions of the Crank-Nicholson scheme will converge to the true solution of the heat equation. 3. Provide the detail to show why the result of p. 56 of Smith proves that the Crank-Nicholson Scheme is unconditionally stable. That is, demonstrate why the spectral radius is as indicated and why it must be less than 1. See “challenge problem” below. 4. An alternate notation for writing out finite difference schemes employs the discrete differential operators, of order two 􀀭xUi, j 􀀝 Ui􀀎 12 , j − Ui− 12 , j 􀀭x 2Ui, j 􀀝 Ui􀀎1, j − 2Ui, j 􀀎 Ui−1, j The difference equation 1 − 12 r − 16 􀀭x 2 Ui, j􀀎1 􀀝 1 􀀎 12 r 􀀎 16 􀀭x 2 Ui, j gives the Douglas formula. Explicitly write out the Douglas formula in a form that allows us to write out the equivalent matrix formulation of the method. Also, write out the matricies for the formula. 5. Determine the matrix formulation of the Crank-Nicholson Scheme (e.g., BUj􀀎1 􀀝 CUj 􀀎 bj. Explicitlywrite out thematricies B,C and the vector b. 1 6. Develop the Crank-Nicholson equations for the problem in exercise 1 of Smith except with r 􀀝 k/h, 􀀭x 􀀝 0. 1, r 􀀝 0.5 . Solve them directly for two time-steps. Evaluate the corresponding analytical solution and calculate the absolute and relative errors in the numerical solution at the second time step for x 􀀝 0.2 and x 􀀝 0.5. Compare the result of this problem at t 􀀝 0.1 to the solution determined by the explicit method for the same r value. Discuss any observations. 7. (See problem 7 of Smith Chapter 2) A uniform solid rod of one-half a unit of length is thermally insulated along its length and its initial temperature at zero time is 0°C. One end is thermally insulated and the other supplied heat at a steady rate. Show that the subsequent temperatures at points within the rod are given, in non-dimensional form, by the solution of the equation ∂U ∂t 􀀝 ∂2U ∂x2 􀂟0 􀀜 x 􀀜 12 , t 􀀞 0􀂠 satisfying the initial condition U 􀀝 0 when t 􀀝 0 􀂟0 ≤ x ≤ 12 􀂠 and the boundary conditions ∂U ∂x 􀀝 0 at x 􀀝 0, t 􀀞 0, ∂U ∂x 􀀝 f at x 􀀝 12 , t 􀀞 0 where f is a constant. Solve this problem numerically for f 􀀝 1, to t 􀀝 1. 0, using a. theexplicitmethodwith 􀀭x 􀀝 0. 01, r 􀀝 14 b. theCrank-Nicholsonmethodwith􀀭x 􀀝 0. 01, r 􀀝 1.0 􀂀 Display tables of heat values for times t 􀀝 0. 01, 0. 05, 0. 1, 0. 5, 1.0 for both methods. Plot the solutions through t 􀀝 1.0 (3-D plots), 1 plot for each method. The analytical solution of the PDE is U 􀀝 2t 􀀎 12 12×2 − 1 6 − 2 􀀽2 Σ n􀀝1 􀀮 e−4􀀽2n2t cos􀂟2n􀀽x􀂠 􀀝 2 tΣn􀀝0 􀀮 i erf c 􀂟2n 􀀎 1 − 2x􀂠 4 t 􀀎 i erf c 􀂟2n 􀀎 1 􀀎 2x􀂠 4 t Compare the true solution at x 􀀝 0.3 for t 􀀝 0. 01, 0. 05, 0. 1, 0. 5, 1.0 to the approximate solutions from parts a. and b. above Here “compare” is most easily done by creating a small table with the analytical solution, explicit method solution and associated relative error, the C-N solution and its relative error. Discuss your observations. 8. Complete problem 6 of Smith Chapter 2. 9. Complete problem 13 of Smith Chapter 2. 2 Challenge Problem Using the cool fact about eigenvalues of a tridiagonal matrix, prove that the Crank-Nicholson difference approximation to the heat equation is unconditionally stable. Recall, the eigenvalues of an N 􀂕 N tridiagonal matrix are: 􀀵i 􀀝 a 􀀎 2 bc cos i􀀽 N 􀀎 1 , i 􀀝 1, . . . ,N where a,b and c may be real or complex numbers and each full row of the matrix has these constants in the order: c b a. 3

PDE assignment 3 Numerical Problems 1. (From Problem 1, Chapter 2, of Smith) Calculate a finite-difference solution of ut 􀀝 uxx 􀂟0 􀀜 x 􀀜 1, t 􀀞 0􀂠 satisfying the initial condition u 􀀝 sin􀂟􀀽x􀂠 when t 􀀝 0 for 0 ≤ x ≤ 1 and u 􀀝 0 at x 􀀝 0,1 for t 􀀞 0 Use the explicit method with 􀀭x 􀀝 0. 1, r 􀀝 0.1. Compare to the answers in Smith to check that your code is working. Then compute with 􀀭x 􀀝 0. 01, r 􀀝 0.1 and r 􀀝 0. 5. Determine and plot the solution to t 􀀝 0.01 and t 􀀝 0.1 for each case. Do not provide all output, just the plots and the specific approximations where you computed the exact solutions. Show that a solution of the PDE, satisfying the BC’s and IC’s is U􀂟x, t􀂠 􀀝 e−􀀽2t sin􀂟􀀽x􀂠 Verify the accuracy of your numerical approximations at t 􀀝 0. 005, t 􀀝 0.01 and t 􀀝 0.1 for x 􀀝 0.2 and x 􀀝 0.5 2. Showthat theCrank-Nicholsonschemeisconsistentandthat thelocal truncationerrorat the point 􀂟ih, jk􀂠 of the Crank-Nicholson approximation to Ut 􀀝 Uxx is of order O􀂟h2􀂠 􀀎 O􀂟k2􀂠. Then under the assumption that the scheme is unconditionally stable, prove that the solutions of the Crank-Nicholson scheme will converge to the true solution of the heat equation. 3. Provide the detail to show why the result of p. 56 of Smith proves that the Crank-Nicholson Scheme is unconditionally stable. That is, demonstrate why the spectral radius is as indicated and why it must be less than 1. See “challenge problem” below. 4. An alternate notation for writing out finite difference schemes employs the discrete differential operators, of order two 􀀭xUi, j 􀀝 Ui􀀎 12 , j − Ui− 12 , j 􀀭x 2Ui, j 􀀝 Ui􀀎1, j − 2Ui, j 􀀎 Ui−1, j The difference equation 1 − 12 r − 16 􀀭x 2 Ui, j􀀎1 􀀝 1 􀀎 12 r 􀀎 16 􀀭x 2 Ui, j gives the Douglas formula. Explicitly write out the Douglas formula in a form that allows us to write out the equivalent matrix formulation of the method. Also, write out the matricies for the formula. 5. Determine the matrix formulation of the Crank-Nicholson Scheme (e.g., BUj􀀎1 􀀝 CUj 􀀎 bj. Explicitlywrite out thematricies B,C and the vector b. 1 6. Develop the Crank-Nicholson equations for the problem in exercise 1 of Smith except with r 􀀝 k/h, 􀀭x 􀀝 0. 1, r 􀀝 0.5 . Solve them directly for two time-steps. Evaluate the corresponding analytical solution and calculate the absolute and relative errors in the numerical solution at the second time step for x 􀀝 0.2 and x 􀀝 0.5. Compare the result of this problem at t 􀀝 0.1 to the solution determined by the explicit method for the same r value. Discuss any observations. 7. (See problem 7 of Smith Chapter 2) A uniform solid rod of one-half a unit of length is thermally insulated along its length and its initial temperature at zero time is 0°C. One end is thermally insulated and the other supplied heat at a steady rate. Show that the subsequent temperatures at points within the rod are given, in non-dimensional form, by the solution of the equation ∂U ∂t 􀀝 ∂2U ∂x2 􀂟0 􀀜 x 􀀜 12 , t 􀀞 0􀂠 satisfying the initial condition U 􀀝 0 when t 􀀝 0 􀂟0 ≤ x ≤ 12 􀂠 and the boundary conditions ∂U ∂x 􀀝 0 at x 􀀝 0, t 􀀞 0, ∂U ∂x 􀀝 f at x 􀀝 12 , t 􀀞 0 where f is a constant. Solve this problem numerically for f 􀀝 1, to t 􀀝 1. 0, using a. theexplicitmethodwith 􀀭x 􀀝 0. 01, r 􀀝 14 b. theCrank-Nicholsonmethodwith􀀭x 􀀝 0. 01, r 􀀝 1.0 􀂀 Display tables of heat values for times t 􀀝 0. 01, 0. 05, 0. 1, 0. 5, 1.0 for both methods. Plot the solutions through t 􀀝 1.0 (3-D plots), 1 plot for each method. The analytical solution of the PDE is U 􀀝 2t 􀀎 12 12×2 − 1 6 − 2 􀀽2 Σ n􀀝1 􀀮 e−4􀀽2n2t cos􀂟2n􀀽x􀂠 􀀝 2 tΣn􀀝0 􀀮 i erf c 􀂟2n 􀀎 1 − 2x􀂠 4 t 􀀎 i erf c 􀂟2n 􀀎 1 􀀎 2x􀂠 4 t Compare the true solution at x 􀀝 0.3 for t 􀀝 0. 01, 0. 05, 0. 1, 0. 5, 1.0 to the approximate solutions from parts a. and b. above Here “compare” is most easily done by creating a small table with the analytical solution, explicit method solution and associated relative error, the C-N solution and its relative error. Discuss your observations. 8. Complete problem 6 of Smith Chapter 2. 9. Complete problem 13 of Smith Chapter 2. 2 Challenge Problem Using the cool fact about eigenvalues of a tridiagonal matrix, prove that the Crank-Nicholson difference approximation to the heat equation is unconditionally stable. Recall, the eigenvalues of an N 􀂕 N tridiagonal matrix are: 􀀵i 􀀝 a 􀀎 2 bc cos i􀀽 N 􀀎 1 , i 􀀝 1, . . . ,N where a,b and c may be real or complex numbers and each full row of the matrix has these constants in the order: c b a. 3

checkyourstudy.com Whatsapp +919911743277

checkyourstudy.com Whatsapp +919911743277
MATH 248 SPRIN 2017 – LABORATORY ASSIGNMENT 5 – Sochacki DUE: Monday April 3, 2017 POINTS: 50 You are to write a Matlab script that will solve an arbitrary tri-diagonal matrix system of equations using Gaussian elimination. Your program should determine if a unique solution exists and if it does give an approximation to this unique solution. You MUST use the computer with formatted output in a nice layout. Guidelines: (1) First you should do a neat one-three page (8.5 x 11) write up showing how to solve a tri-diagonal system of equations and do an operation count to determine the solution. (2) Your program should print the answer as a column in a nice format. (3) You should make sure your code can minimize round-off errors. (4) As usual, the professional quality of your scripts and write up is part of your evaluation. (5) You can do the following bonus problems for 2 points each. (i) Give the determinant of the matrix defining the SLE (ii) Give the inverse of the matrix defining the SLE

MATH 248 SPRIN 2017 – LABORATORY ASSIGNMENT 5 – Sochacki DUE: Monday April 3, 2017 POINTS: 50 You are to write a Matlab script that will solve an arbitrary tri-diagonal matrix system of equations using Gaussian elimination. Your program should determine if a unique solution exists and if it does give an approximation to this unique solution. You MUST use the computer with formatted output in a nice layout. Guidelines: (1) First you should do a neat one-three page (8.5 x 11) write up showing how to solve a tri-diagonal system of equations and do an operation count to determine the solution. (2) Your program should print the answer as a column in a nice format. (3) You should make sure your code can minimize round-off errors. (4) As usual, the professional quality of your scripts and write up is part of your evaluation. (5) You can do the following bonus problems for 2 points each. (i) Give the determinant of the matrix defining the SLE (ii) Give the inverse of the matrix defining the SLE

checkyourstudy.com Whatsapp +919911743277