Question: 6. expanding the code to take in a variable amount of CO. We want to change the code to take in a variable amount of

6. expanding the code to take in a variable amount of CO. We want to change the code to take in a variable amount of CO, where the amount of CO is represented as n, according to the equation: = 2 (1)()

In this case x can be solved for using the quadratic equation with a = k-1 b=-(n+1)*k c=n*k

Modify the code to take in both T and n and implement this new form.

Keep in mind that both n and k can be arrays, and thus element by element multiplication is needed. What is the conversion when T is 400 and n = 0.5, 1, and 2.? (0.4997, 0.9751, 0.9993) What is the conversion as a function of both T and n, at T = 400, 500 and 600 & n= 0.5, 1, and 2?

Ideally we should have 9 answers, but how many do you get?

Why?

The element by element method takes only the 3 pairs, 400 and 0.5, 500 and 1, and 600 and 2. The mesh command builds a matrix of elements forming a mesh. It works as follows [T1, n1] = meshgrid(T,n) What happens? What are T1 and n1? Modify the code to account for the mesh. The scaffold should look like: Function call taking in T and n, and reporting x Create a T and n mesh Calculate k Calculate a Calculate b Calculate c Solve the quadratic equation end What do you get for conversion now when you T = 400, 500 and 600 & n= 0.5, 1, and 2? It should be: ans = 0.4997 0.4964 0.4838 0.9751 0.9211 0.8409 0.9993 0.9928 0.9675 Set the output of the function to x Use the meshgrid command to make T1 and n1 meshes from T and n using: [T1, n1] = meshgrid(T,n) ; Now use plot3 to get a 3d plot: plot3(T1, n1,x) Now plot a surface using the surf command surf(T1,n1,x)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!