Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING MATLAB FUNCTIONS Question .1 In a chemical reaction, one molecule of A combines with one molecule of B to form one molecule of the

image text in transcribed

USING MATLAB FUNCTIONS

Question .1 In a chemical reaction, one molecule of A combines with one molecule of B to form one molecule of the chemical C. It is found that the concentration y( ofC at time t is the solution to the Initial Value Problem (IVP). y-ka-y)(b-y) with y(0)-0; where is a positive constant and a and b are the initial concentrations of A and B, respectivel;y Find the solution for the concentration y() of C in the time interval [0, 20] using Matlab and hand calculations for k 0.01, a-70 llimoles/litre, and b-50 millimoles/litre. To find solution using Matlab you are required to perform the following tasks: 1. Write a function fun_ode.m in which you define your ordinary differential equation (1) (see an example in week10.zip). 2. Write another function in which you will solve equation (1) defined in fun ode.m. (a) By using Euler's method (function euler.m is available in week10.zip) with 2s and ?1-1s. (b) By using Heun's Method (you will need to modify euler.m to implement Heun's method) with ?1-2s. (c) By using ode45 Matlab function based on Runge-Kutta method with At-2s. (d) Compare results obtained in (a), (b) and (c with the exact solution y(t) 350-e02)/(7-5e') by plotting the solutions on the same graph. (e) Find the percentage errors for the results obtained in (a), (b) and (c) by comparing with the exact solution and plot them on separate graph. Comment on accuracy of the methods. In calculation of the error exclude initial point t0 To find solution using hand calculations you are requtred to perform the following tasks 3. use Euler's method with ?-2s over [0 4] and compare your solution with results obtained using Matlab function in 2(a) use Heun's method with ?-1s over [O 4] and compare your solution with results obtained using Matlab function in 2(b) 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago