• No results found

> Question 3

N/A
N/A
Protected

Academic year: 2020

Share "> Question 3"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

> Question 3

* Information about the system:

Unit A – is 40% efficient

Unit B – Mixer

Unit C – Mixer/splitter so m₅, m₆ and m₁₀ are in the same proportion

Unit D – is 82% efficient so m₅ 18% of it is unconverted, m₇ and m₉ are split in equal proportions

Unit E – is 15% efficient, it converts m₇ and m₆ to by-products

* Equations:

A m₁ = 10 B m₂ = 2

C m₃ = 0.6m₁ + 0.6m₁₀ D m₄ = m₃ + m₂ + m₉ E m₅ =1/3 m₄ + 1/3 m₁₁ F m₆ = m₅

G m₇ = 0.09m₅

H m₈ = 0.85m₇ + 0.85m₆ I m₉ = m₇

(2)

1. The system of equations in the form of Ax= b

m1 m2 m3 m4 m5 m6

m7 =

(3)

2. Matlab Code:

MatrixQ3.m file

Q3Midterm2.m file

(4)

3. Adjusting the recycle ratio to obtain a flow rate of m₁₂ = 1.0 kg/hour can be completed through many ways one in which a for-loop Matlab code is constructed as shown below;

format long

b = [10; 2; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]; A = 0.2;

a(1)= A; n=1;

P=MatrixQ3(A); x=pinv(P)*b; z(n) = x(12); for n = 2:1:20 if n==2 A = 0.5; a(n) = A end

P=MatrixQ3(A); x=pinv(P)*b; z(n) = x(12);

a(n+1) = a(n) - ((z(n)-1)/(z(n) - z(n-1)))*(a(n)-a(n-1)); A = a(n+1);

if abs(a(n+1) - a(n)) < 0.01 break

end end a z

To perform the loop under 1% error with the least amount of function evaluation the secant method was used as the main strategy to target this problem and with the help of the for-loop the flow rates were obtained and the target of m12 of 1 kg/hr is accomplished.

z is the flow rates for each new .

(5)

Another method that could be performed is by setting the matrix b with the flow rate of m12 to be 1 kg/hr and then performing a regular mass balance on stream m11 to give a new P matrix that is only affected in m11 and m12, the new matrix is shown below;

This will result in different flow rates

Solving for from the new flow rates from the given equation m₁₁ = m₈

= m₁₁/ m₈

= 0.7866

(6)

> Question 4

The system behaves in second-order manner:

1. At steady state the tank temperature is usually at 318K, the type of feedback controller used is a proportional-only controller and is given by:

Where = -1.9 K/cP. Using this feedback controller to obtain new temperature at different viscosities is shown below:

When

When

The above temperature do make sense, since the viscosity at steady state is 30cP and when the polymer viscosity is at 35cP meaning it is more viscose, the temperature should be raised to break the molecular bonds within the polymer allowing the polymer to become less viscose and therefore getting back to steady state.

(7)

2. Since the system behaves in second-order manner and to be able to create a graph as well as to avoid complexity the system is converted to first-order ode and this is shown below:

Substituting T(t) into the equation yields

The above equation is in the form of

Let Z₁ = Z₂ =

Z’₂ =

+

Z’₁ = Z₂

Z₁(0) = 40 Z₂(0) = 0

Now this can be plotted in Matlab easily using the following code:

Q4Midterm.m

function zprime = Q4Midterm(t,z)

zprime = [z(2);3.23 - 0.108*z(1) - 0.476*z(2)]; end

Q4Midtermplot.m

z0 = [40;0]; time = [0 60];

[t,z] = ode45('Q4Midterm',time,z0);

plot(t,z, ':');

hold on

xlabel('Time (Min)') ylabel('Viscosity (cP)')

title('Viscosity VS Time Plot')

text(20,33,'Viscosity in terms of time')

(8)

From the plot the viscosity to reach steady state will approximately take 32 minutes

>Bonus:

Choosing 2 different values of one higher and lower:

This source was used to answer Q4

(9)

From the plot shown above with higher Kc and lower Kc values the steady state is always achieved at around 25 min or greater, even with a higher or lower Kc values.

(10)

>Question 2 1.

Prove

From the General Balance equation:

Accumulation + Consumption = input + generation – output

With no input, output and generation the general balance equation becomes

Accumulation = - Consumption

Assuming constant volume

2. Finding t

(11)

3. Using the Trapezoidal rule

Solving for n

Simpson’s 1/3 method

(12)

Process Modelling Formulation

3E04

Take Home Midterm

Monday 2010-11-22

Amer Khanfar

0845948

Sarah Najib

(13)

Question 1:

The following data regarding the concentration of drug in the blood stream with respect to time taken over 10 hours is given?

t [hour] 1 2 3 5 6 8 10

C [mg/L] 10.1 7.5 5.7 3.1 2.4 1.3 0.7

Part 1:

We had to provide an estimate of the drugs concentration at t = 0 hours.

- In order to determine the estimate of the drugs concentration, a function had to be fitted though these data points. This could be done using a few concepts that we have learnt in class such as:

I. Regression:

1. This will not exactly fit through the points and we will result in errors with points II. Interpolation:

- Since interpolation fits exactly through all the points and we do not experience any error at the points. One of the following techniques should be use to estimate the drug concentration

1. Spline interpolation:

i. Linear spline interpolation ii. Quadratic spline interpolation iii. Cubic spline interpolation

o Firstly, linear spline interpolation could not be used in our case since it does not provide the best estimate and the splines constructed in the interior points are not completely smooth which would not give us the best estimate.

o Since cubic spline interpolation has more coefficients it will give the best results out of them all and hence this method was used as seen later.

2. Polynomial interpolation:

i. Lagrange interpolating polynomials ii. Newton interpolating polynomials

o The following two points will provide higher order polynomials. Even though these polynomials can be easily differentiated, easily integrated and finding the root can be easily done, they are still capable of resulting in fluctuations between the data points.

Therefore, in the end we concluded that we should use the cubic spline interpolation method to find the estimate of our concentration.

(14)

We are given 7 ordered data points resulting in these equations:

a1 + b1x + c1x 2

+ d1x 3

x1 ≤ x < x2 a2 + b2x + c2x

2 + d2x

3

x2 ≤ x < x3 s3(x) = a3 + b3x + c3x

2 + d3x

3

x3 ≤ x < x4 a4 + b4x + c4x

2 + d4x

3

x4 ≤ x < x5 a5 + b5x + c5x

2 + d5x

3

x5 ≤ x < x6 a6 + b6x + c6x2 + d6x3 x6 ≤ x < x7

1- Prescribed value at end points (x1, x7):

s

3

(x

1

) = y

1

= a

1

+ b

1

x

1

+ c

1

x

12

+ d

1

x

13

2

s

3

(x

7

) = y

7

= a

6

+ b

6

x

7

+ c

6

x

72

+ d

6

x

73

23

2-

Prescribed value and continuity at interior knot (x

2

, x

3

, x

4

, x

5

, x

6

):

s3(x2) = y2 = a1 + b1x2 + c1x2 2

+ d1x2 3

3

s3(x2) = y2 = a2 + b2x2 + c2x2 2

+ d2x2 3

6

s3(x3) = y3 = a2 + b2x3 + c2x3 2

+ d2x3 3

7

s3(x3) = y3 = a3 + b3x3 + c3x3 2

+ d3x3 3

10

s3(x4) = y4 = a3 + b3x4 + c3x4 2

+ d3x4 3

11 s3(x4) = y4 = a4 + b4x4 + c4x4

2 + d4x4

3

14

s3(x5) = y5 = a4 + b4x5 + c4x5 2

+ d4x5 3

15

s3(x5) = y5 = a5 + b5x5 + c5x52 + d5x53 18

s3(x6) = y6 = a5 + b5x6 + c5x6 2

+ d5x6 3

19

s3(x6) = y6 = a6 + b6x6 + c6x6 2

+ d6x6 3

22

3- 1st derivative continuity at interior knots (x2, x3, x4, x5, x6):

s3’(x2) = b1 + 2c1x2 + 3d1x2 2

= b2 + 2c2x2 + 3d2x2 2

4

s3’(x3) = b2 + 2c2x3 + 3d2x3 2

= b3 + 2c3x3 + 3d3x3 2

8

s3’(x4) = b3 + 2c3x4 + 3d3x4 2

= b4 + 2c4x4 + 3d4x4 2

12

s3’(x5) = b4 + 2c4x5 + 3d4x5 2

= b5 + 2c5x5 + 3d5x5 2

16

s3’(x6) = b5 + 2c5x6 + 3d5x6 2

= b6 + 2c6x6 + 3d6x6 2

20

4 – 2nd derivative continuity at interior knots (x2, x3, x4, x5, x6):

(15)

s3’’(x5) = 2c4 + 6d4x5 = 2c5 + 6d5x5 17 s3’’(x6) = 2c5 + 6d5x6 = 2c6+ 6d6x6 21

(16)

s3’’(x1) = 2c1 + 6d1x1 1

s3’’(x7) = 2c6 + 6d6x7 24

After the following 24 equations with 24 unknowns, a matrix was made in the for Xa=y which was put in matlab to obtain the coefficient values. The code also incorporated the graph that showed the estimate was reasonable.

Code:

A=[0,0,2,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 1,2,4,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 0,1,4,12,0,-1,-4,-12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 0,0,2,12,0,0,-2,-12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 0,0,0,0,1,2,4,8,0,0,0,0,0,0,0,0,0,0,0,0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.1;2.4;1.3;0.7] tval=[1, 2, 3, 5, 6, 8, 10] y=cubic_spline_7pts(x,tval) plot(x,y); hold on; plot(tval,f,'k*') title(‘spline interpolation’) xlabel(‘Time (hour)’) ylabel(‘C (mg/L)’)

legend ('Cubic Spline', 'Nodes', ..., 'Cubic Spline', 0)

Function file:

(17)

y=zeros(size(x)); k=1;

for val=x if val <xx(2) y(k)=s1(val); elseif val<xx(3) y(k)=s2(val); elseif val<xx(4) y(k)=s3(val); elseif val<xx(5) y(k)=s4(val); elseif val<xx(6) y(k)=s5(val); else y(k)=s6(val); end k=k+l; end

function y = s1(x)

coef=[0.1951 -0.5853 -2.2098 12.7]; y=polyval(coef,x);

function y= s2(x)

coef=[-0.1755 1.6383 -6.657 15.6648]; y=polyval(coef,x);

function y=s3(x)

coef=[0.037 -0.2745 -0.9187 9.9265]; y=polyval(coef,x);

function y=s4(x)

coef=[-0.0948 1.7025 -10.8037 26.4015]; y=polyval(coef,x);

function y=s5(x)

coef=[0.0163 -0.2972 1.1947 2.4046]; y=polyval(coef,x);

function y=s6(x)

(18)

2.4046 1.1947 -0.2972 0.0163 18.8343 -4.9664 0.4729

Using the coefficients the following equations are obtained:

12.7 – 2.2098x – 0.5853x2 + 0.1951x3 1 ≤ x < 2 15.6648 – 6.657 x + 1.6383x2 – 0.1755x3 2 ≤ x < 3 s3(x) = 9.9265 – 0.9187x – 0.2745x

2

+ 0.037x3 3 ≤ x < 5 26.4015 – 10.8037x + 1.7025x2 – 0.0948x3 5 ≤ x < 6 2.4046 + 1.1947x – 0.2972x2 + 0.0163x3 6 ≤ x < 8 18.8343 – 4.9664x + 0.4729x2 – 0.0158x3 8 ≤ x < 10

Through extrapolation we use the first equation and get the following result:

s

3

(x) = 12.7 – 2.2098x – 0.5853x

2

+ 0.1951x

3

1 ≤ x < 2

s

3

(0) = 12.7

Therefore, at t=0 hours, the concentration of the drug is 12.7 g/L

Part 2:

In this part we are asked to find the lowest error estimate of dC/dt. Assuming that the

method used in part 1 gives the most accurate value hence assuming that the data points

do not have any error within them. By using this assumption we can use the equations

found in part 1 and differentiate each equation for the different points in part 1 and find the

differentiated value for each point.

s3(x) = 12.7 – 2.2098x – 0.5853x 2

+ 0.1951x3 1 ≤ x < 2 x=1

s3‘(x) = b1 + 2c1x + 3d1x 2

s3‘(1) = -2.795100

s3(x) = 15.6648 – 6.657 x + 1.6383x2 – 0.1755x3 2 ≤ x < 3 x = 2:

s3‘(x) = b2 + 2c2x + 3d2x 2

s3‘(2) = -2.209799

s3(x) = 9.9265 – 0.9187x – 0.2745x 2

+ 0.037x3 3 ≤ x < 5 x = 3

s3‘(x) = b3 + 2c2x + 3d2x 2

s3‘(3) = -1.565702

s3(x)= 26.4015 – 10.8037x + 1.7025x 2

(19)

s3‘(x) = b4 + 2c4x + 3d4x 2

s3‘(5) = -0.886188

s3(x)= 2.4046 + 1.1947x – 0.2972x 2

+ 0.0163x3 6 ≤ x < 8 x = 6

s3‘(x) = b5 + 2c5x + 3d5x 2

s3‘(6) =-0.608584

s3(x)= 2.4046 + 1.1947x – 0.2972x 2

+ 0.0163x3 6 ≤ x < 8 x = 8

s3‘(x) = b6 + 2c6x + 3d6x 2

s3‘(8) =-0.426118

s3(x)= 18.8343 – 4.9664x + 0.4729x 2

– 0.0158x3 8 ≤ x < 10 x = 10

s3‘(x) = b6 + 2c6x + 3d6x2 s3‘(10) =-0.236940

Therefore the errors are:

-2.795100 for x =1

-2.209799 for x=2

-1.565702 for x=3

-0.886188 for x=5

-0.608584 for x=6

-0.426118 for x=8

-0.236940 for x=10

Part 3:

Assuming that the drug is eliminated from the body at a rate of r=kC and the batch mode is

being operated with no inlet and outlet and of constant volume, the dynamic equation that

would describe the concentration of the drug in the blood stream as a function of time is

the following:

dm/dt = mass in – mass out + generation – depletion

d(C*V)/dt = rV

dC/dt = r

therefore,

dC/dt = -kC

Part 4:

(20)

Question 5:

The goal for this question was to maximize the production of E and F, which is achieved by minimizing the amount of unreacted D in the outlet from the reactor. Adjusting the jacket temperature was a way suggested to produce this outcome. For the intermediate concentration to be at its minimum we decided to choose temperatures using the following steps

1- Plot the concentration for the end points and the half mid point temperatures

 This helped gave us a visualization of how our graph looks like.

 After graphing the first four points we saw that the minimum concentration of D was occurring around point 4 with a temperature of about 336K.

 Therefore we decided to use the rest of the points near point 4 to get a more accurate minimum concentration

2- Placed the 5th point in between point 3 and point 4 at temperature of 345K.

 We noticed that the graph seemed to be decreasing between point 4 and point 5

3- We placed our point 6 between point 4 and 5 at 340.5K, which resulted in a concentration of 7.22, by far the lowest concentration.

 This confirmed our previous assumption that the lowest concentration was occurring around this area

 To get a more accurate lowest concentration we used our last 2 points closer to point 6 4- Choosing temperatures in the +/- 0.25K range we plotted jacket temperature values of 340.75 for

point 7 and 340.25 for point 8.

 Noticing that the program automatically rounded these temperatures, we got concentration values of about 7.36 and 8.01.

 Since the concentration randomly increased to 8.01 at temperature 340.25 we concluded that this could have been due to the noise.

(21)
(22)

Graphing these points gives the following results:

This graph emphasizes more on the sudden jump in point 8 due to the noise.

In order to get a more accurate jacket temperature, we attempted to use the methods learnt in class to determine a function that can be passed through points 4, 5, 6 and then taking the derivative of the function and setting it equal to 0 which will tell us the point where the maximum or minimum will take place. Since we already know that we are assuming that the minimum is taking place around those points we do not need to take the second derivative.

The methods that we used to get the accurate jacket temperature are:

1- Cubic spline interpolation

2- Lagrange polynomial interpolation 3- Newton polynomial interpolation

Since the noise between the values was really small, we did not attempt to use polynomial regression.

Cubic spline interpolation was ruled out since it gave a function that was an estimate and it did not take into account the noise.

Using the Lagrange approach, the following process was done:

D(T) = P2(T) = y1l1(T) + y2l2(T) + y3l3(T)

l1(T) = ((T-340.5)(T-345))/((336-340.5)(336-345))

0 5 10 15 20 25

278 288 298 308 318 328 338 348

Co

n

ce

n

tr

ation

Temperature (K)

Concentration versus Temperature

(23)

l1(T) = ((T-336)(T-345))/((340.5-336)(340.5-345))

l1(T) = ((T-336)(T-340.5))/((345-336)(345-340.5))

D(T) = P2(T) = 7.73l1(T) + 7.22l2(T) + 7.85l3(T)

D(T) = ((7.73/40.5)(T2-685.5T+117472.5))+((7.22/-20.5)(T2 – 681T+115920))+((7.85/40.5)(T2 – 676.5T+114408))

dD(T)/dT = 0 = ((7.73/40.5)(2T-685.5))+((7.22/-20.5)(2T – 681))+((7.85/40.5)(2T – 676.6))

T= 340.43K

References

Related documents

Most companies recruit for full-time and internship positions, but some indicate Co-Op as a recruiting priority, while not attending Professional Practice

Although theoretically the likelihood of finding evidence that dumped imports have in- jured the domestic industry should fall as the industry increases its output, the results from

In a surprise move, the Central Bank of Peru (BCRP) reduced its benchmark interest rate by 25 basis points (bps) to 3.25% in mid-January following disappointing economic growth data

Although total labor earnings increase with the unskilled unions’ bargaining power, we can say nothing when the increase in production is due to stronger skilled unions, since

Using a nationwide database of hospital admissions, we established that diverticulitis patients admitted to hospitals that encounter a low volume of diverticulitis cases have

In addition, this example, of a university President celebrating the building of ‘a very strong network of alumni in China and Hong Kong', highlighted the significance for

The Master Fund is authorised in Luxembourg as a specialised investment fund and is managed by a management company, Ress Capital Fund Management SA, who acts

de Klerk, South Africa’s last leader under the apartheid regime, Mandela found a negotiation partner who shared his vision of a peaceful transition and showed the courage to