Evaluate the time required for the initial oxygen


MATLAB Assignment

In an attempt to understand the mechanism of the depolarization process in a direct methanol fuel cell (DMFC), an electro-kinetic model for mixed oxygen-methanol current on platinum was developed in the laboratory at Florida A&M University (read more about DMFC in textbook Ch 07.00B). A simplified model of the reaction developed suggests a functional relation in an integral form:

T = x1x2 (6.73x + 6.725 × 10-8 + 7.26 × 10-4Cme) dx / (3.62 × 10-12x + 3.908 × 10-8 x Cme)

where

T = Time it takes to consume certain amount of oxygen concentration in the fuel cell, sec
x = Concentration of oxygen, moles/cm3
x1 = Initial concentration of oxygen, moles/cm3
x2 = Concentration of oxygen after T seconds, moles/cm3
Cme = Concentration of methanol, moles/cm3
0 ≤ Cme ≤ 5 × 10-4 moles/cm3
0.2 × 10-6 ≤ x ≤ 1.22 × 10-6 moles/cm3

Task 1

Use MATLAB to evaluate the time required for the initial oxygen concentration to be reduced by half (x2 = x1/2) in the fuel cell using various numerical integration methods.

Write a function to perform analytical and various numerical integration methods for the integration. Your function should meet the following requirements:

• It should be named EKdmfc
• The function should have three input arguments:

1) Concentration of methanol, Cme
2) Initial concentration of oxygen, x1
3) The number of intervals, n

• The function should have a single output argument in the form of a row vector that contains five items (in this order):

1) The value of the analytical integral using the built-in ‘int' command.
2) The value of the numerical integral using the built-in ‘integral' command.
3) The value of the numerical integral using the built-in ‘quadgk' command.
4) The value of the numerical integral using the built-in 'trapz' command with the input value of number intervals n.
5) The value of the numerical integration using Simpson's 1/3 rule. Write your own code to perform multiple-segment Simpson's 1/3 rule.

• Note that for multiple-segment Simpson's 1/3 rule, n must be an even natural number (read more about this in Ch 07.03). Your code should check the input value of ??, and return ‘inf' for this part if ?? does not meet this requirement. (Hint: an even number is divisible by 2 while an odd number is not. In other words, the remainder after division by 2 for an even number is 0, but is 1 for an odd number. There are at least two MATLAB built-in functions that you can use to obtain the remainder after division.) Demonstrate this portion of your code in your report.

• Display the input and output in the command window. The display should be professionally formatted and the precision of the display controlled.

Your solution will be tested three times with randomly generated input arguments.

Task 2

Assume Cme = 3 × 10-4, and x1 = 1.00 × 10-6. Analyze the results from your function and compare the resulting integral values from different methods. Employ the concepts of errors for different numerical integration methods you have learned in this course and discuss the accuracy of these results. Explain why certain methods are more accurate than others. Use your code, explore how the error from the trapezoidal method and the Simpson's 1/3 method change as you vary the number of intervals.

Task 3

Plot time required vs. initial oxygen concentration for a range of x1 values (0.2 × 10-6 ≤ x1 ≤ 1.22 × 10-6) for Cme= 3.5 × 10-4 moles/cm3. Initial oxygen concentration (x1) should be on the x-axis and time is on the y-axis. From your plot, what is the relation (Linear, Quadratic, Cubic, Exponential etc.) between time required vs. initial oxygen concentration? Try to prove your opinion.

Problem Description

Write a function to perform analytical and various numerical integration methods for the integration in Matlab Assignment. Your function should meet the following requirements:

• It should be named EKdmfc
• The function should have three input arguments:

1) Concentration of methanol, Cme
2) Initial concentration of oxygen, xl
3) The number of intervals, n, for Simpson's 1/3 rule

• The function should have a single output argument in the form of a row vector that contains five items (in this order):

1) The value of the analytical integration;
2) The value of numerical integration using built-in 'integral' command;
3) The value of numerical integration using built-in 'quadgk' command;
4) The value of numerical integration using multiple-segment trapezoidal rule;
5) The value of numerical integration using Simpson's 1/3 rule.

Note that for multiple-segment Simpson's 1/3 rule, IT must be an even natural number (read more about this in Ch 07.03). Your code should check the input value of n , and return 'inf' for this part if IT does not meet the requirement. ('_Hint_*: an even number is divisible by 2 while an odd number is not). In other words, the remainder after division by 2 for an even number is 0, but is 1 for an odd number. There are at least two MATLAB built-in functions that you can use to obtain the remainder after division.) Demonstrate this portion of your code in your report.

• Display the input and output in the command window. The display should be professionally formatted and the precision of the display controlled.

Attachment:- Mat-Lab.zip

Request for Solution File

Ask an Expert for Answer!!
Simulation in MATLAB: Evaluate the time required for the initial oxygen
Reference No:- TGS02523773

Expected delivery within 24 Hours