MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 Homework #8 Due: Wednesday, April 8, in or before class. Note: Problems 2 (extra credit) and 3 have to be solved by hand. Problems 1 and 5 require MATLAB. The item 1(a) must be shown by hand. Problem 4 can be done either in Matlab or by hand. 1. Consider the following ODE: d y d x = ?8 y with y(0) = 3 on 0 < x < 5, (a) Calculate the largest step size required to maintain stability of the numerical solution to this equation using explicit Euler method. (b) Choose a step size two times smaller than this value. Solve the ODE with explicit Euler method using this step size. (c) Choose a step size two times larger than this value. Solve the ODE with explicit Euler method using this step size. (d) Now repeat parts (b) and (c) with implicit Euler method. (e) Plot all the solutions, including the analytical solution to this problem, on the same plot. Discuss your results. 2. Extra credit. Investigate the stability of the following numerical schemes on the example of an ODE d y d x = ? y with > 0. Show whether the scheme is conditionally or unconditionally stable. Derive the stability threshold if the scheme is conditionally stable. (a) The semi-implicit trapezoidal method: yi+1 = yi + 1 2 (f(xi; yi) + f(xi+1; yi+1)) h (b) The explicit midpoint method: yi+1 = yi + f  xi+1=2; yi + f(xi; yi) h 2  h 3. Solve Problem 25.1 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:5. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. 4. Solve Problem 25.2 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:25. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. There is a typo in this problem. The interval should be from t=0 to 1, not x=0 to 1. 5. For the following rst-order ODE d y d t = t2 ? 2 y t with y(1) = 2, the purpose will be to write MATLAB functions that solve this equation from t = 1 to t = 4 with 1 of 2 MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 (a) Third-order Runge-Kutta (page 734) (b) Fourth-order Runge-Kutta (page 735) For each method, (a) Write the MATLAB function that solves the ODE by using the number of intervals N as an input argument. (b) Solve the ODE using your MATLAB function for N equal to 8, 16, 32, 64. Calculate the step size h inside the function. (c) Calculate the EL2 errors between the true solution and the numerical solution for each N (consult HW6 for the true solution). The following plots should be presented: 1. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 8. Do not print out the values at your grid points. 2. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 32. Do not print out the values at your grid points. 3. Plot the values of EL2 errors for the methods (a), (b), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot. What do you observe? 4. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 5. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of N, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 6. Discuss whether your convergence results for each method correspond to the known order of accuracy for each method. Explain why or why not. 2 of 2

MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 Homework #8 Due: Wednesday, April 8, in or before class. Note: Problems 2 (extra credit) and 3 have to be solved by hand. Problems 1 and 5 require MATLAB. The item 1(a) must be shown by hand. Problem 4 can be done either in Matlab or by hand. 1. Consider the following ODE: d y d x = ?8 y with y(0) = 3 on 0 < x < 5, (a) Calculate the largest step size required to maintain stability of the numerical solution to this equation using explicit Euler method. (b) Choose a step size two times smaller than this value. Solve the ODE with explicit Euler method using this step size. (c) Choose a step size two times larger than this value. Solve the ODE with explicit Euler method using this step size. (d) Now repeat parts (b) and (c) with implicit Euler method. (e) Plot all the solutions, including the analytical solution to this problem, on the same plot. Discuss your results. 2. Extra credit. Investigate the stability of the following numerical schemes on the example of an ODE d y d x = ? y with > 0. Show whether the scheme is conditionally or unconditionally stable. Derive the stability threshold if the scheme is conditionally stable. (a) The semi-implicit trapezoidal method: yi+1 = yi + 1 2 (f(xi; yi) + f(xi+1; yi+1)) h (b) The explicit midpoint method: yi+1 = yi + f  xi+1=2; yi + f(xi; yi) h 2  h 3. Solve Problem 25.1 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:5. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. 4. Solve Problem 25.2 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:25. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. There is a typo in this problem. The interval should be from t=0 to 1, not x=0 to 1. 5. For the following rst-order ODE d y d t = t2 ? 2 y t with y(1) = 2, the purpose will be to write MATLAB functions that solve this equation from t = 1 to t = 4 with 1 of 2 MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 (a) Third-order Runge-Kutta (page 734) (b) Fourth-order Runge-Kutta (page 735) For each method, (a) Write the MATLAB function that solves the ODE by using the number of intervals N as an input argument. (b) Solve the ODE using your MATLAB function for N equal to 8, 16, 32, 64. Calculate the step size h inside the function. (c) Calculate the EL2 errors between the true solution and the numerical solution for each N (consult HW6 for the true solution). The following plots should be presented: 1. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 8. Do not print out the values at your grid points. 2. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 32. Do not print out the values at your grid points. 3. Plot the values of EL2 errors for the methods (a), (b), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot. What do you observe? 4. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 5. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of N, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 6. Discuss whether your convergence results for each method correspond to the known order of accuracy for each method. Explain why or why not. 2 of 2

Order of accuracy for Maximum step size for numerical stability … Read More...
Matlab project Note: Your final project must be uniquely different from anyone else’s including different from the example I posted!! You are NOT allowed to work together because this is your individual final project!! Anyone caught working together or with similar data/answers will get an automatic zero and will be reported to the Dean’s Office!! REQUIREMENTS %%0. Make a main m-file that you use to run and call your function file. Give it a unique name. Make sure and include your name, your section, and date at the top of the m-file. Suppress any extraneous info; only output what is useful and what follows the intent of your program. (8 points) %%1. Create and use at least one anonymous function somewhere in your program. (5 points) %%2. Make a useful function m-file. That is, create and use at least one user-defined function Use comments immediately below the function definition line that describe what the function does and its inputs and outputs. (10 points) %%3. Utilize proper coding and documentation practices. Comment throughout both the main m-file and the function m-file. Create at least one section (cells). (12 points) %%4. Create and use either one subfunction or one nested function within your function mfile, (10 points) %%5. Use some type of numerical approximation technique like Runge Kutta, Euler’s method, Midpoint Rule, some type of numeric series, etc., 10 pts %%6. Create and use at least one loop (for/while/midpoint), 10 pts %%7. Create and use at least one conditional statement, 10 pts %%8. Create at least one plot, including a title and axes labels at a minimum, 10pts %%9. Output an organized display of your values to a text file that can be opened outside of MATLAB. Include headings so that the display makes sense. 10pts Note: Project need not be fancy or overcomplicated. You want to make sure it runs, meets all the listed requirements, is well-commented and is YOUR OWN WORK !! DELIVERABLES:!! %%10. Submit the following files onto blackboard (ZIP them!): 1. A flowchart or pseudocode of your program plan, 5pts 2. Your main project m-file, 0 credit if not included! 3. Your function m-file, -50% if not included!

Matlab project Note: Your final project must be uniquely different from anyone else’s including different from the example I posted!! You are NOT allowed to work together because this is your individual final project!! Anyone caught working together or with similar data/answers will get an automatic zero and will be reported to the Dean’s Office!! REQUIREMENTS %%0. Make a main m-file that you use to run and call your function file. Give it a unique name. Make sure and include your name, your section, and date at the top of the m-file. Suppress any extraneous info; only output what is useful and what follows the intent of your program. (8 points) %%1. Create and use at least one anonymous function somewhere in your program. (5 points) %%2. Make a useful function m-file. That is, create and use at least one user-defined function Use comments immediately below the function definition line that describe what the function does and its inputs and outputs. (10 points) %%3. Utilize proper coding and documentation practices. Comment throughout both the main m-file and the function m-file. Create at least one section (cells). (12 points) %%4. Create and use either one subfunction or one nested function within your function mfile, (10 points) %%5. Use some type of numerical approximation technique like Runge Kutta, Euler’s method, Midpoint Rule, some type of numeric series, etc., 10 pts %%6. Create and use at least one loop (for/while/midpoint), 10 pts %%7. Create and use at least one conditional statement, 10 pts %%8. Create at least one plot, including a title and axes labels at a minimum, 10pts %%9. Output an organized display of your values to a text file that can be opened outside of MATLAB. Include headings so that the display makes sense. 10pts Note: Project need not be fancy or overcomplicated. You want to make sure it runs, meets all the listed requirements, is well-commented and is YOUR OWN WORK !! DELIVERABLES:!! %%10. Submit the following files onto blackboard (ZIP them!): 1. A flowchart or pseudocode of your program plan, 5pts 2. Your main project m-file, 0 credit if not included! 3. Your function m-file, -50% if not included!

No expert has answered this question yet. You can browse … Read More...
Homework Assignment 7. Due March 19 1. Consider the differential equation: ?? ?? = − 1 2 ? sin? ? with initial condition given by ?(0) = 1 Solve this equation from t = 0 to t = 8π using the following methods: (a) Solve analytically by separating variables and integrating. (b) Solve using the 4th-order Runge-Kutta method (write your own code for this, do not use the MATLAB provided ODE solvers) for the following two step sizes: I. Maximum step size for stability (don’t try and do this analytically – try out your code for different step sizes to find the stability limit). II. Maximum step size for a time-accurate solution. “Good” accuracy can be defined in several ways, but use the definition that the numerical solution remains within 2% of the true solution a t = nπ. (c) Solve using the MATLAB function ode45. 2. A car and its suspension system traveling over a bumpy road can be modeled as a mass/spring/damper system. In this model, ?? is the vertical motion of the wheel center of mass, ?? is the vertical motion of the car chassis, and ?? represents the displacement of the bottom of the tire due to the variation in the road surface. Applying Newton’s law to the two masses yields a system of second-order equations: ???̈? + ??(?̇? − ?̇?) + ??(?? − ??) + ???? = ???? ???̈? − ??(?̇? − ?̇?) − ??(?? − ??) + ???? = 0 (a) Convert the two second-order ODE’s into a system of 4 first-order ODE’s. Write them in standard “state-space” form. (b) Assume the car hits a large pothole at t = 0 so that ??(?) = ?−0.2 m 0 ≤ ? < 0.2 s 0 ? > 0.2 s Create a MATLAB function that returns the right hand sides of the state-space equations for an input t and an input state vector. (c) Solve the system on the time interval [0 60] seconds using the MATLAB function ode45. Find the displacement and velocity of the chassis and the wheel as a function of time. Use the following data: ?? = 100 kg, ?? = 1900 kg, ?? = 145 N/m, ?? = 25 N/m, ?? = 150 N-s/m 3. Write a MATLAB program to simulate the dynamics of a helicopter lifting a survivor. When lifting the survivor into the helicopter with a constant speed winch, the resulting dynamics are non-linear, and stability is dependent upon the winch speed. Using polar coordinates, we can find the equations of motion to be: −?? sin ? = ????̈ + 2?̇?̇? ?̇ = constant (negative) Notice that the mass of the survivor factors out and thus the solution is independent of the mass of the person being lifted. In these equations, r is the instantaneous length of the winch cable, g, is the gravitational constant, and θ is the angle of the swing. You may choose to use either your Runge-Kutta solver from problem 1 or ode45 to integrate the equations of motion. This problem is of particular interest to the survivor since an unstable condition can cause the angle of the swing to exceed 90⁰, essentially placing him/her in danger of being beheaded by the rotor blades of the rescue helicopter. Also, it is desirable to retrieve the survivor as fast as possible to get away from the danger. Use your program to determine the maximum winch speed for which the survivor will not swing above the helicopter attach point for a lift from the initial conditions: ?? = 0.1 ??? ?? ̇ = 0 ?? = 34 ? And ending when ? = 0.5 ?. The maximum lifting speed of the winch is 5 m/s. Present your results for the above problems in an appropriate fashion. For problem 1, be sure to include a comparison of the numerical methods with each other and with the true solution. Be sure to discuss your findings with respect to the notions of stability and accuracy of the numerical methods. For problem 2, ensure that your results are easily interpreted by a reader. Students receiving a score of 70% or above on these two problems will receive credit for outcome #5. For problem 3, if you receive at least 70% of the points, you will receive credit for outcome #4.

Homework Assignment 7. Due March 19 1. Consider the differential equation: ?? ?? = − 1 2 ? sin? ? with initial condition given by ?(0) = 1 Solve this equation from t = 0 to t = 8π using the following methods: (a) Solve analytically by separating variables and integrating. (b) Solve using the 4th-order Runge-Kutta method (write your own code for this, do not use the MATLAB provided ODE solvers) for the following two step sizes: I. Maximum step size for stability (don’t try and do this analytically – try out your code for different step sizes to find the stability limit). II. Maximum step size for a time-accurate solution. “Good” accuracy can be defined in several ways, but use the definition that the numerical solution remains within 2% of the true solution a t = nπ. (c) Solve using the MATLAB function ode45. 2. A car and its suspension system traveling over a bumpy road can be modeled as a mass/spring/damper system. In this model, ?? is the vertical motion of the wheel center of mass, ?? is the vertical motion of the car chassis, and ?? represents the displacement of the bottom of the tire due to the variation in the road surface. Applying Newton’s law to the two masses yields a system of second-order equations: ???̈? + ??(?̇? − ?̇?) + ??(?? − ??) + ???? = ???? ???̈? − ??(?̇? − ?̇?) − ??(?? − ??) + ???? = 0 (a) Convert the two second-order ODE’s into a system of 4 first-order ODE’s. Write them in standard “state-space” form. (b) Assume the car hits a large pothole at t = 0 so that ??(?) = ?−0.2 m 0 ≤ ? < 0.2 s 0 ? > 0.2 s Create a MATLAB function that returns the right hand sides of the state-space equations for an input t and an input state vector. (c) Solve the system on the time interval [0 60] seconds using the MATLAB function ode45. Find the displacement and velocity of the chassis and the wheel as a function of time. Use the following data: ?? = 100 kg, ?? = 1900 kg, ?? = 145 N/m, ?? = 25 N/m, ?? = 150 N-s/m 3. Write a MATLAB program to simulate the dynamics of a helicopter lifting a survivor. When lifting the survivor into the helicopter with a constant speed winch, the resulting dynamics are non-linear, and stability is dependent upon the winch speed. Using polar coordinates, we can find the equations of motion to be: −?? sin ? = ????̈ + 2?̇?̇? ?̇ = constant (negative) Notice that the mass of the survivor factors out and thus the solution is independent of the mass of the person being lifted. In these equations, r is the instantaneous length of the winch cable, g, is the gravitational constant, and θ is the angle of the swing. You may choose to use either your Runge-Kutta solver from problem 1 or ode45 to integrate the equations of motion. This problem is of particular interest to the survivor since an unstable condition can cause the angle of the swing to exceed 90⁰, essentially placing him/her in danger of being beheaded by the rotor blades of the rescue helicopter. Also, it is desirable to retrieve the survivor as fast as possible to get away from the danger. Use your program to determine the maximum winch speed for which the survivor will not swing above the helicopter attach point for a lift from the initial conditions: ?? = 0.1 ??? ?? ̇ = 0 ?? = 34 ? And ending when ? = 0.5 ?. The maximum lifting speed of the winch is 5 m/s. Present your results for the above problems in an appropriate fashion. For problem 1, be sure to include a comparison of the numerical methods with each other and with the true solution. Be sure to discuss your findings with respect to the notions of stability and accuracy of the numerical methods. For problem 2, ensure that your results are easily interpreted by a reader. Students receiving a score of 70% or above on these two problems will receive credit for outcome #5. For problem 3, if you receive at least 70% of the points, you will receive credit for outcome #4.

No expert has answered this question yet. You can browse … Read More...
Homework Assignment 5. Due February 26 1. A cam-follower system is a common mechanical engineering mechanism that will produce a linear displacement of a follower as the cam rotates. The displacement of the follower is determined by the shape of the cam which can be designed to produce a desired motion. The data in the file ‘cam.txt’ (which can be found on Blackboard) is the displacement of the follower, y (row 2 in data file), for a given angle of rotation of the cam, θ (row 1 in data file). Since we do not have the function of the displacement (which is piecewise in nature), create a MATLAB script that will accept, as user input, an angle between 0⁰ and 360⁰ and write to the command window, in a well-formatted output, the linear displacement at that point and the error of the interpolated value at that point. Use linear interpolation between points to get the linear displacement approximation for any value between those two points (you are basically creating a linear spline). Use the spline command in MATLAB as an approximation for the actual linear displacement. The percent difference between the linear approximation and the cubic spline fit (from the spline command) will be your error. Use your code to get values of linear displacements at the following angles: 8⁰, 50⁰, 100⁰, 217⁰, and 330⁰. When using the spline command, you will want to ensure the first derivatives at the end points are zero by appending zeros to the y-coordinates (without changing the x-coordinate vectors. As an example, for x-y coordinate pairs stored in vectors x and y, respectively we would use the spline command as follows >> f = spline(x,[0 y 0],xi); where x and y are row vectors of the same length and xi is the vector of x values on which we are evaluating the spline fit. 2. (This problem is worth 20 points) The figure below illustrates a thermocline, or region of strong temperature gradient in a stratified fluid. Oceans exhibit this type of behavior, though this problem refers to the temperature distribution in the tank of a reactor. The depth of the thermocline is defined as the location at which the curvature of the depth-temperature curve goes to zero (???⁄??? = 0, an inflection point). (a) Using either the Lagrange polynomial method or by solving a linear system (Vandermonde matrix), find the polynomial that passes through all data points. Plot the polynomial curve. On the same graph, plot the data points. Predict the thermocline depth using the interpolation results. You may want to use the MATLAB function roots for finding the inflection point, or you may wish to use fzero. (b) What is the minimum-order polynomial that could reasonably be used to predict the thermocline depth? (Hint: you are looking for an inflection point.) For this order polynomial, find the least-squares curve fit using your own regression program or using the MATLAB function polyfit. Plot the polynomial curve and the data points. Predict the thermocline location. (c) Use the MATLAB function spline to interpolate the data as cubic splines. You can call the function by typing >> f = spline(x,y,xi); where x is the vector of depth locations, y is the vector of temperatures and xi is a vector of depths at which the interpolation is to be completed. f will be a vector of interpolated temperatures. Plot the curve and the data points. To estimate the second derivative, you need to “unmake” the partial-polynomial form. To do this, type >> pp = spline(x,y); The resulting vector can be “unmade” by typing >> [breaks,coef,L,K] = unmkpp(pp); The matrix, coef, will be an N x 4 matrix where N is the number of intervals. The rows of the matrix are the cubic polynomial coefficients for the corresponding interval. For example, the cubic describing the second interval is given by In MATLAB, the ith interval falls between ???? and ??. Since you ought to be able to determine in which interval the inflection point will occur, you should be able to extract the depth where the second derivative reaches zero. Basically you need to find the cubic polynomial where you would expect the inflection point to occur and then find the actual value by finding where the second derivative reaches zero for that polynomial. (d) Compare the thermocline depth predictions from each of the three methods. Discuss. (e) For each of the above approximations, compute the heat flux from the surface layer (above the thermocline) to the bottom layers (below the thermocline) using Fourier’s law: ? = −? ?? ?? where k is the thermal conductivity = 0:556 W/m-⁰C. Compare and discuss the results. Which do you think is likely to give the most physically realistic result? For 10 points of extra credit, create your own cubic spline MATLAB program for part c (instead of using the MATLAB-provided functions like spline and unmkpp). This code needs to be general enough to work for any numbers of data points and should not be coded specifically tailored for this problem. Note this is completely optional.

Homework Assignment 5. Due February 26 1. A cam-follower system is a common mechanical engineering mechanism that will produce a linear displacement of a follower as the cam rotates. The displacement of the follower is determined by the shape of the cam which can be designed to produce a desired motion. The data in the file ‘cam.txt’ (which can be found on Blackboard) is the displacement of the follower, y (row 2 in data file), for a given angle of rotation of the cam, θ (row 1 in data file). Since we do not have the function of the displacement (which is piecewise in nature), create a MATLAB script that will accept, as user input, an angle between 0⁰ and 360⁰ and write to the command window, in a well-formatted output, the linear displacement at that point and the error of the interpolated value at that point. Use linear interpolation between points to get the linear displacement approximation for any value between those two points (you are basically creating a linear spline). Use the spline command in MATLAB as an approximation for the actual linear displacement. The percent difference between the linear approximation and the cubic spline fit (from the spline command) will be your error. Use your code to get values of linear displacements at the following angles: 8⁰, 50⁰, 100⁰, 217⁰, and 330⁰. When using the spline command, you will want to ensure the first derivatives at the end points are zero by appending zeros to the y-coordinates (without changing the x-coordinate vectors. As an example, for x-y coordinate pairs stored in vectors x and y, respectively we would use the spline command as follows >> f = spline(x,[0 y 0],xi); where x and y are row vectors of the same length and xi is the vector of x values on which we are evaluating the spline fit. 2. (This problem is worth 20 points) The figure below illustrates a thermocline, or region of strong temperature gradient in a stratified fluid. Oceans exhibit this type of behavior, though this problem refers to the temperature distribution in the tank of a reactor. The depth of the thermocline is defined as the location at which the curvature of the depth-temperature curve goes to zero (???⁄??? = 0, an inflection point). (a) Using either the Lagrange polynomial method or by solving a linear system (Vandermonde matrix), find the polynomial that passes through all data points. Plot the polynomial curve. On the same graph, plot the data points. Predict the thermocline depth using the interpolation results. You may want to use the MATLAB function roots for finding the inflection point, or you may wish to use fzero. (b) What is the minimum-order polynomial that could reasonably be used to predict the thermocline depth? (Hint: you are looking for an inflection point.) For this order polynomial, find the least-squares curve fit using your own regression program or using the MATLAB function polyfit. Plot the polynomial curve and the data points. Predict the thermocline location. (c) Use the MATLAB function spline to interpolate the data as cubic splines. You can call the function by typing >> f = spline(x,y,xi); where x is the vector of depth locations, y is the vector of temperatures and xi is a vector of depths at which the interpolation is to be completed. f will be a vector of interpolated temperatures. Plot the curve and the data points. To estimate the second derivative, you need to “unmake” the partial-polynomial form. To do this, type >> pp = spline(x,y); The resulting vector can be “unmade” by typing >> [breaks,coef,L,K] = unmkpp(pp); The matrix, coef, will be an N x 4 matrix where N is the number of intervals. The rows of the matrix are the cubic polynomial coefficients for the corresponding interval. For example, the cubic describing the second interval is given by In MATLAB, the ith interval falls between ???? and ??. Since you ought to be able to determine in which interval the inflection point will occur, you should be able to extract the depth where the second derivative reaches zero. Basically you need to find the cubic polynomial where you would expect the inflection point to occur and then find the actual value by finding where the second derivative reaches zero for that polynomial. (d) Compare the thermocline depth predictions from each of the three methods. Discuss. (e) For each of the above approximations, compute the heat flux from the surface layer (above the thermocline) to the bottom layers (below the thermocline) using Fourier’s law: ? = −? ?? ?? where k is the thermal conductivity = 0:556 W/m-⁰C. Compare and discuss the results. Which do you think is likely to give the most physically realistic result? For 10 points of extra credit, create your own cubic spline MATLAB program for part c (instead of using the MATLAB-provided functions like spline and unmkpp). This code needs to be general enough to work for any numbers of data points and should not be coded specifically tailored for this problem. Note this is completely optional.

info@checkyourstudy.com
The standard normal probability density function is a bell-shaped curve that can be represented as f(z) = 1 p 2    e?z2=2 Use MATLAB to generate a plot of this function from z = ?5 to z = 5. Label the ordinate as frequency and the abscissa as z.

The standard normal probability density function is a bell-shaped curve that can be represented as f(z) = 1 p 2    e?z2=2 Use MATLAB to generate a plot of this function from z = ?5 to z = 5. Label the ordinate as frequency and the abscissa as z.

For any additional help, please contact: info@checkyourstudy.com Call and Whatsapp … Read More...
EXPERIMENT 6 FET CHARACTERISTIC CURVES ________________________________________ Bring a diskette to save your data. ________________________________________ OBJECT: The objective of this lab is to investigate the DC characteristics and operation of a field effect transistor (FET). The FET recommended to be used in this lab is 2N5486 n-channel FET. • Gathering data for the DC characteristics ________________________________________ APPARATUS: Dual DC Power Supply, Voltmeter, and 1k resistors, 2N5486 N-Channel FET. ________________________________________ THEORY: A JFET (Junction Field Effect Transistor) is a three terminal device (drain, source, and gate) similar to the BJT. The difference between them is that the JFET is a voltage controlled constant current device, whereas BJT is a current controlled current source device. Whereas for BJT the relationship between an output parameter, iC, and an input parameter, iB, is given by a constant , the relationship in JFET between an output parameter, iD, and an input parameter, vGS, is more complex. PROCEDURE: Measuring ID versus VDS (Output Characteristics) 1. Build the circuit shown below. 2. Obtain the output characteristics i.e. ID versus VDS. a. Set VGS = 0. Vary the voltage across drain (VDS) from 0 to 8 V with steps of 1 V and measure the corresponding drain current (ID). b. Repeat the procedure for different values of VGS. (0V, -0.5V, -1V, -1.5V, -2V, -2.5V, -3.0V, -3.5V, -4.0V). 3. Record the values in Table 1 and plot the graph ID vs. VGS. VGS 0 -0.5 -1.0 -1.5` -2.0 -2.5 -3.0 -3.5 -4.0 VDS ID ID ID ID ID ID ID ID ID 0 0 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0mA 1 0 0.7 mA 0.7 mA 0.66 mA 0.6 mA 0.6 mA 0.5 0.1mA 0mA 2 0 1.5 mA 1.3 mA 1.3mA 1.2 mA 1.1 mA 0.7 0.1mA 0mA 3 0 2.1 mA 2.6 mA 1.9 mA 1.8 mA 1.5 mA 0.8 mA 0.1mA 0mA 4 0 2.7 mA 2.6 mA 2.5 mA 2.4 mA 1.7 mA 0.8 mA 0.1mA 0mA 5 0 3.4 mA 3.3 mA 3.1 mA 2.8 mA 1.8 mA 0.9 mA 0.1mA 0mA 6 0 4.1 mA 3.4 mA 3.7 mA 3.2 mA 1.9 mA 0.9 mA 0.1mA 0mA 7 0 4.7 mA 4.5 mA 4.2 mA 3.4 mA 1.9 mA 0.9 mA 0.1mA 0mA 8 0 5.3 mA 5.1 mA 6.6 mA 3.5 mA 2.0 mA 0.9 mA 0.1mA 0mA Table 1. vds=0:8; id=[0 6.2e-3 9.7e-3 11.3e-3 11.9e-3 12.2e-3 12.3e-3 12.3e-3 12.32e-3]; plot(vds,id);grid on;hold on id2=[0 5.23e-3 8.05e-3 9.15e-3 9.57e-3 9.77e-3 9.88e-3 9.9e-3 9.92e-3]; plot(vds,id2);grid on;hold on id3=[0 4.29e-3 6.41e-3 7.17e-3 7.46e-3 7.60e-3 7.67e-3 7.73e-3 7.76e-3]; plot(vds,id3);grid on;hold on ________________________________________ Measuring ID versus VGS (Transconductance Characteristics) 1. For the same circuit, obtain the transconductance characteristics. i.e. ID versus VGS. a. Set a particular value of voltage for VDS, i.e. 5V. Start with a gate voltage VGS of 0 V, and measure the corresponding drain current (ID). b. Then decrease VGS in steps of 0.5 V until VGS is -4V. c. At each step record the drain current. VDS = 5 V VGS ID 0 3.42 mA -0.5 3.36 mA -1.00 3.27 mA -1.50 3.12 mA -2.00 2.79 mA -2.50 1.84 mA -3.00 0.71 mA -3.50 0.11 mA -4.00 0 mA Table 2. 2. Plot the graph with ID versus VGS using Excel, MATLAB, or some other program. Discussion Questions—Make sure you answer the following questions in your discussion. Use all of the data obtained to answer the following questions: 1. Discuss the output and transconductance curves obtained in lab? Are they what you expected? 2. Are the output characteristics spaced evenly? Should they be? 3. What are the applications of a JFET?

EXPERIMENT 6 FET CHARACTERISTIC CURVES ________________________________________ Bring a diskette to save your data. ________________________________________ OBJECT: The objective of this lab is to investigate the DC characteristics and operation of a field effect transistor (FET). The FET recommended to be used in this lab is 2N5486 n-channel FET. • Gathering data for the DC characteristics ________________________________________ APPARATUS: Dual DC Power Supply, Voltmeter, and 1k resistors, 2N5486 N-Channel FET. ________________________________________ THEORY: A JFET (Junction Field Effect Transistor) is a three terminal device (drain, source, and gate) similar to the BJT. The difference between them is that the JFET is a voltage controlled constant current device, whereas BJT is a current controlled current source device. Whereas for BJT the relationship between an output parameter, iC, and an input parameter, iB, is given by a constant , the relationship in JFET between an output parameter, iD, and an input parameter, vGS, is more complex. PROCEDURE: Measuring ID versus VDS (Output Characteristics) 1. Build the circuit shown below. 2. Obtain the output characteristics i.e. ID versus VDS. a. Set VGS = 0. Vary the voltage across drain (VDS) from 0 to 8 V with steps of 1 V and measure the corresponding drain current (ID). b. Repeat the procedure for different values of VGS. (0V, -0.5V, -1V, -1.5V, -2V, -2.5V, -3.0V, -3.5V, -4.0V). 3. Record the values in Table 1 and plot the graph ID vs. VGS. VGS 0 -0.5 -1.0 -1.5` -2.0 -2.5 -3.0 -3.5 -4.0 VDS ID ID ID ID ID ID ID ID ID 0 0 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0.002mA 0mA 1 0 0.7 mA 0.7 mA 0.66 mA 0.6 mA 0.6 mA 0.5 0.1mA 0mA 2 0 1.5 mA 1.3 mA 1.3mA 1.2 mA 1.1 mA 0.7 0.1mA 0mA 3 0 2.1 mA 2.6 mA 1.9 mA 1.8 mA 1.5 mA 0.8 mA 0.1mA 0mA 4 0 2.7 mA 2.6 mA 2.5 mA 2.4 mA 1.7 mA 0.8 mA 0.1mA 0mA 5 0 3.4 mA 3.3 mA 3.1 mA 2.8 mA 1.8 mA 0.9 mA 0.1mA 0mA 6 0 4.1 mA 3.4 mA 3.7 mA 3.2 mA 1.9 mA 0.9 mA 0.1mA 0mA 7 0 4.7 mA 4.5 mA 4.2 mA 3.4 mA 1.9 mA 0.9 mA 0.1mA 0mA 8 0 5.3 mA 5.1 mA 6.6 mA 3.5 mA 2.0 mA 0.9 mA 0.1mA 0mA Table 1. vds=0:8; id=[0 6.2e-3 9.7e-3 11.3e-3 11.9e-3 12.2e-3 12.3e-3 12.3e-3 12.32e-3]; plot(vds,id);grid on;hold on id2=[0 5.23e-3 8.05e-3 9.15e-3 9.57e-3 9.77e-3 9.88e-3 9.9e-3 9.92e-3]; plot(vds,id2);grid on;hold on id3=[0 4.29e-3 6.41e-3 7.17e-3 7.46e-3 7.60e-3 7.67e-3 7.73e-3 7.76e-3]; plot(vds,id3);grid on;hold on ________________________________________ Measuring ID versus VGS (Transconductance Characteristics) 1. For the same circuit, obtain the transconductance characteristics. i.e. ID versus VGS. a. Set a particular value of voltage for VDS, i.e. 5V. Start with a gate voltage VGS of 0 V, and measure the corresponding drain current (ID). b. Then decrease VGS in steps of 0.5 V until VGS is -4V. c. At each step record the drain current. VDS = 5 V VGS ID 0 3.42 mA -0.5 3.36 mA -1.00 3.27 mA -1.50 3.12 mA -2.00 2.79 mA -2.50 1.84 mA -3.00 0.71 mA -3.50 0.11 mA -4.00 0 mA Table 2. 2. Plot the graph with ID versus VGS using Excel, MATLAB, or some other program. Discussion Questions—Make sure you answer the following questions in your discussion. Use all of the data obtained to answer the following questions: 1. Discuss the output and transconductance curves obtained in lab? Are they what you expected? 2. Are the output characteristics spaced evenly? Should they be? 3. What are the applications of a JFET?

No expert has answered this question yet. You can browse … Read More...
0 2p 1 2 Figure 1: PlotCycloidArc(8.5) Math98 HW4 The cylcoid is the plane curve traced out by a point on a circle as the circle rolls without slipping on a straight line.1 In this exercise we will use MATLAB to create an animation of a circle rolling on a straight line, while a point on the circle traces the cycloid. a. Implement a MATLAB function of the form function PlotCycloidArc(ArcLength). This function takes in a positive number ArcLength and displays a snapshot of the cirle rolling (without slipping) on the x-axis while a point on the cirlce traces the cycloid. The circle is initially centered at (0,1) and has radius 1, and the initial tracing point is taken to be (0, 0). An example output is shown in the above figure. As in the figure, plot the cycloid arc black, the circle blue, and use a red dot for the tracing point. Hint: If the circle has rolled for a length of arc t  0, the coordinates of the tracing point are (t−sin t, 1−cos t). b. Implement a MATLAB function of the form function CycloidMovie(NumHumps,NumIntervals). This function will output an animation of the circle rolling along a line while a point on the circle traces the cycloid. This function inputs two natural numbers NumHumps and NumIntervals representing the number of periods (or humps) of the cycloid and the number or frames per hump that will be used to make the animation, respectively. Use the getframe command to save frames outputted from PlotCycloidArc and the movie command to play them back together as a movie. Use the axis command to view the frames on the rectan- gle [0, 2NumHumps] × [0, 5/2]. Also label the ticks 0, 2, . . . , 2NumHumps on the x axis with the strings 1See Wikipedia for more on the cycloid. 0, 2, . . . , 2NumHumps and do the same for 1, 2 on the y axis (see the figure above). Label the movie ’Cycloid Animation’. Submit MATLAB code for both parts a and b and a printout the figures obtained by the commands PlotCycloidArc(8.5), PlotCycloidArc(12), and CycloidMovie(3,10).

0 2p 1 2 Figure 1: PlotCycloidArc(8.5) Math98 HW4 The cylcoid is the plane curve traced out by a point on a circle as the circle rolls without slipping on a straight line.1 In this exercise we will use MATLAB to create an animation of a circle rolling on a straight line, while a point on the circle traces the cycloid. a. Implement a MATLAB function of the form function PlotCycloidArc(ArcLength). This function takes in a positive number ArcLength and displays a snapshot of the cirle rolling (without slipping) on the x-axis while a point on the cirlce traces the cycloid. The circle is initially centered at (0,1) and has radius 1, and the initial tracing point is taken to be (0, 0). An example output is shown in the above figure. As in the figure, plot the cycloid arc black, the circle blue, and use a red dot for the tracing point. Hint: If the circle has rolled for a length of arc t  0, the coordinates of the tracing point are (t−sin t, 1−cos t). b. Implement a MATLAB function of the form function CycloidMovie(NumHumps,NumIntervals). This function will output an animation of the circle rolling along a line while a point on the circle traces the cycloid. This function inputs two natural numbers NumHumps and NumIntervals representing the number of periods (or humps) of the cycloid and the number or frames per hump that will be used to make the animation, respectively. Use the getframe command to save frames outputted from PlotCycloidArc and the movie command to play them back together as a movie. Use the axis command to view the frames on the rectan- gle [0, 2NumHumps] × [0, 5/2]. Also label the ticks 0, 2, . . . , 2NumHumps on the x axis with the strings 1See Wikipedia for more on the cycloid. 0, 2, . . . , 2NumHumps and do the same for 1, 2 on the y axis (see the figure above). Label the movie ’Cycloid Animation’. Submit MATLAB code for both parts a and b and a printout the figures obtained by the commands PlotCycloidArc(8.5), PlotCycloidArc(12), and CycloidMovie(3,10).

info@checkyourstudy.com Operations Team Whatsapp( +91 9911743277)
power flow of network in saudi arabia – network modules (load/demand) – types of generators – cost efficient – power flow after injecting renwable energy all using matlab and all about saudi arabia its for my project

power flow of network in saudi arabia – network modules (load/demand) – types of generators – cost efficient – power flow after injecting renwable energy all using matlab and all about saudi arabia its for my project

info@checkyourstudy.com power flow of network in saudi arabia – network … Read More...