Numerical and Computing Method :- one of the most easy subject in Chemical Engineering programme.
Same as most of the exam paper, this paper also require us to choose 5 question to answer from 6 question and I did choose 5 but with 1 question forgot part of the code-ing. The question answer should look like this :
- function dx = first_differential1a(t,x)
- global a b c
- XT1 = x(1);
- XT2 = x(2);
- XT3 = x(3);
- dXT1dt = (XT1 / XT2) - 3;
- dXT2dt = 3 * (XT2 / XT3) - 2;
- dXT3dt = 4 * (XT3 / XT1) - 1;
- dx=[dXT1dt; dXT2dt; dXT3dt];
- global a b c
- a = 2;
- b = 3;
- c = 4;
- xa(1, 1) = 300;
- xa(1, 2) = 300;
- xa(1, 3) = 300;
- ta(1) = 0;
- (I forgot this part)
- XT1(1) = xa(1, 1);
- XT2(1) = xa(1, 2);
- XT3(1) = xa(1, 3);
- tspan = [0 10];
- x0=[xa(1, 1); xa(1, 2); xa(1, 3)];
- options = odeset('RelTol', 1e-3, 'AbsTol',1e-4);
- [t, x] = ode23('first_differential1a', tspan, x0, options);
- xa = x;
- XT1 = xa(:, 1);
- XT2 = xa(:, 2);
- XT3 = xa(:, 3);
- figure(1)
- subplot(3, 1, 1)
- plot(t, XT1, '-')
- xlabel('time, hr')
- ylabel('temp, K')
- subplot(3, 1, 2)
- plot(t, XT2, '-')
- xlabel('time, hr')
- ylabel('temp, K')
- subplot(3, 1, 3)
- plot(t, XT3, '-')
- xlabel('time, hr')
- ylabel('temp, K')
- figure(2)
- plot(t, XT1, '-', t, XT2, '-', t, XT3, '-')
- xlabel('time, hr')
- ylabel('temp, K')
but with no worry, i sure i will not fail this subject and will not get only credit but pass with a good result ask y... ask y... XD
the identity of Alrin Lee |
-WAS- DONE WITH FIRST PAPER!!! |
No comments:
Post a Comment