Assingnment Contoh - Project mini Mat523 PDF

Title Assingnment Contoh - Project mini Mat523
Course Mathematics
Institution Universiti Teknologi MARA
Pages 21
File Size 966.9 KB
File Type PDF
Total Downloads 7
Total Views 615

Summary

FACULTY OF COMPUTER SCIENCE AND MATHEMATICS MINI PROJECT ASSIGNMENT MAT (MATRICES AND SYSTEM OF LINEAR EQUATION)GROUP MEMBER:NAME STUDENT ID NO IC MUHAMAD AIMAN ZULHAIKAL BIN AZIZUL 2019295106 001129080545RAJA MOHD ILHAM SYAFIQ BIN RAJA SEMAN 2019219636 990503126795MUHAMMAD MUHSINUL MURSYID BIN MOHD...


Description

FACULTY OF COMPUTER SCIENCE AND MATHEMATICS MINI PROJECT ASSIGNMENT MAT523 (MATRICES AND SYSTEM OF LINEAR EQUATION)

GROUP MEMBER: NAME

STUDENT ID

NO IC

MUHAMAD AIMAN ZULHAIKAL BIN AZIZUL

2019295106

001129080545

RAJA MOHD ILHAM SYAFIQ BIN RAJA SEMAN

2019219636

990503126795

MUHAMMAD MUHSINUL MURSYID BIN MOHD 2019627662

991022085691

NASIR

CLASS: CS2492A2 LECTURER: NOOREHAN AWANG

Intoduction Dengue cases are getting worse year by year in Malaysia. Many died cause dengue disease. Dengue fever is a type of viral infection that spreads through the infected Aedes mosquito bites. In the first three weeks of 2020, many people died of dengue. Selangor has recorded death and highest cases. So, we take 20 random place in Selangor as 20 data. The following data from Dengue Cases Reported In The Week 03/2020 ( 12th January until 18th January 2020) shows the relationship between the number of cases and the duration of outbreak(days).

X ( number of cases) 47 35 18 40 24 49 40 24 27 61 33 14 22 21 16 22 10 14 34 28

Y (duration of outbreak(days)) 131 104 101 99 95 94 92 89 86 86 86 84 82 81 80 80 80 79 79 76

Implementation Linear model: y = a + bx The data generates a system of linear equations with the matrix representation as below: (47,131) 131=a+b(47)

(33,86) 86=a+b(33)

(35,104) 104=a+b(35)

(14,84) 84=a+b(14)

(18,101) 101=a+b(18)

(22,82) 82=a+b(22)

(40,99) 99=a+b(40)

(21,81) 81=a+b(21)

(24,95) 95=a+b(24)

(16,80) 80=a+b(16)

(49,94) 94=a+b(49)

(22,80) 80=a+b(22)

(40,92) 92=a+b(40)

(10,80) 80=a+b(10)

(24,89) 89=a+b(24)

(14,79) 79=a+b(14)

(27,86) 86=a+b(27)

(34,79) 79=a+b(34)

(61,86) 86=a+b(61)

(28,76) 76=a+b(28)

V=(MTM)-1 MTy

1

47

131

1

35

104

1

18

101

1

40

99

1

24

95

1

49

94

1

40

92

1

24

89

1

27

1

61

86

1

33

86

1

14

84

1

22

82

1

21

81

1

16

80

1

22

80

1

10

80

1

14

79

1

34

79

1

28

76

v = 86

Matrix M

Matrix y

Its normal equation is 20 579

579 20147

a = b

Matix MTM

1784 53124 Matrix MTy

The least squares solution is

V = a = 0.2976 b

-0.0086

-0.0086 1784 0.0003 53124

= 76.5662 0.4364

Matrix (MTM)-1MTy

. . . The

best fit linear curve is y=76.5662 + 0.4364x

Error vector

131

97.0771

33.9229

104

91.8402

12.1598

101

84.4214

16.5786

99

94.0222

4.9778

95

87.0398

7.9602

94

97.9499

-3.9499

92

94.0222

-2.0222

89

87.0398

1.9602

86

88.3490

-2.3490

e= y- Mv = 86

_

103.1867

=

-17.1867

86

90.9674

-4.9674

84

82.6758

1.3242

82

86.1670

-4.1670

81

85.7306

-4.7306

80

83.5486

-3.5486

80

86.1670

-6.1670

80

80.9302

-0.9302

79

82.6758

-3.6758

79

91.4038

-12.4038

76

88.7854

-12.7854

||e|| = 49.3411

Quadratic model: y = a + bx + cx2 The matrix representation of the above system is

(47,131) 131=a+b(47)+c(2209)

(33,86) 86=a+b(33)+c(1089)

(35,104) 104=a+b(35)+c(1225)

(14,84) 84=a+b(14)+c(196)

(18,101) 101=a+b(18)+c(324)

(22,82) 82=a+b(22)+c(484)

(40,99) 99=a+b(40)+c(1600)

(21,81) 81=a+b(21)+c(441)

(24,95) 95=a+b(24)+c(576)

(16,80) 80=a+b(16)+c(256)

(49,94) 94=a+b(49)+c(2401)

(22,80) 80=a+b(22)+c(484)

(40,92) 92=a+b(40)+c(1600)

(10,80) 80=a+b(10)+c(100)

(24,89) 89=a+b(24)+c(576)

(14,79) 79=a+b(14)+c(196)

(27,86) 86=a+b(27)+c(729)

(34,79) 79=a+b(34)+c(1156)

(61,86) 86=a+b(61)+c(3721)

(28,76) 76=a+b(28)+c(784)

v=(MTM)-1 MTy

1

47

2209

131

1

35

1225

104

1

18

324

101

1

40

1600

99

1

24

576

95

1

49

2401

94

1

40

1600

92

1

24

576

89

1

27

729

86

1

61

3721 v=

1

33

1089

86

1

14

196

84

1

22

484

82

1

21

441

81

1

16

256

80

1

22

484

80

1

10

100

80

1

14

196

79

1

34

1156

79

1

28

784

76

Matrix M

86

Matrix y

and its normal equation is

20

579

579

20147

810825

810825

36363191

20147

20147

Matrix MTM

a

1784 b

= 53124 c

1888600

Matrix MTy

The least squares solution is

a v= b = c

1.4445 -0.0907 -0.0907

0.0012

1784

0.0062 -0.0001

0.0012 -0.0001

0.0000

53124

1888600

67.0088 =

1.1207 -0.0102

Matrix(MTM)-1MTy

. . .

The best fit quadratic curve is y = 67.0088 + 1.1207x - 0.0102x2

Error vector

131

97.1976

33.8024

104

93.7649

10.2351

101

83.8838

17.1162

99

95.5515

3.4485

95

88.0431

6.9569

94

97.4848

-3.4848

92

95.5515

-3.5515

89

88.0431

0.9569

e= y - Mv = 86

_

89.8479

=

-3.8479

86

97.4974

-11.4974

86

92.9078

-6.9078

84

80.7038

3.2962

82

86.7381

-4.7381

81

86.0550

-5.0550

80

82.3345

-2.3345

80

86.7381

-6.7381

80

77.1981

2.8019

79

80.7038

-1.7038

79

93.3465

-14.3465

76

90.4087

-14.4087

||e||=48.5274

Cubic model y = a + bx + cx2 + dx3

The matrix representation of the above system is

(47,131) 131=a+b(47)+c(2209)+d(103823)

(33,86) 86=a+b(33)+c(1089)+d(35937)

(35,104) 104=a+b(35)+c(1225)+d(42875)

(14,84) 84=a+b(14)+c(196)+d(2744)

(18,101) 101=a+b(18)+c(324)+d(5832)

(22,82) 82=a+b(22)+c(484)+d(10648)

(40,99) 99=a+b(40)+c(1600)+d(64000)

(21,81) 81=a+b(21)+c(441)+d(9261)

(24,95) 95=a+b(24)+c(576)+d(13824)

(16,80) 80=a+b(16)+c(256)+d(4096)

(49,94) 94=a+b(49)+c(2401)+d(117649)

(22,80) 80=a+b(22)+c(484)+d(10648)

(40,92) 92=a+b(40)+c(1600)+d(64000)

(10,80) 80=a+b(10)+c(100)+d(1000)

(24,89) 89=a+b(24)+c(576)+d(13824)

(14,79) 79=a+b(14)+c(196)+d(2744)

(27,86) 86=a+b(27)+c(729)+d(19683)

(34,79) 79=a+b(34)+c(1156)+d(39304)

(61,86) 86=a+b(61)+c(3721)+d(226981)

(28,76) 76=a+b(28)+c(784)+d(21952)

v=(MTM)-1 MTy

1

47

2209

103823

131

1

35

1225

42875

1

18

324

5832

1

40

1600

64000

99

1

24

576

13824

95

1

49

2401

117649

94

1

40

1600

64000

92

1

24

576

13824

89

1

27

729

19683

86

1

61

3721

226981

1

33

1089

35937

1

14

196

2744

84

1

22

484

10648

82

1

21

441

9261

81

1

16

256

4096

80

1

22

484

10648

80

1

10

100

1000

80

1

14

196

2744

79

1

34

1156

39304

79

1

28

784

21952

76

Matrix M

104 101

v=

86 86

Matrix y

and its normal equation is

20

579

20147

810825

a

579

20147

810825

36363191

20147

810825

36363191

1764298929.00000

810825 36363191

1784 b

= c

1888600

1764298929.00000 90638306087.0000

Matrix MTM

53124

d

76882590

1784

111.4093

Matrix MTy

The least squares solution is

a

6.7447

V= b = -0.6851

-0.6851

0.0204

0.0728

-0.0022

-0.0022

7.0384e-05

-1.8173e-04 2.0381e-05

c

0.0204

-6.5611e-07

d

-1.8173e-04 2.0381e-05 -6.5611e-07

53124

= -3.8588

1888600

6.2313e-09

0.1501

76882590

-0.0015

Matrix(MTM)-1MTy . . .the

best fit cubic curve is y = 111.4093 - 3.8588x + 0.1501x2 - 0.0015x3

Error vector

131

103.5991

27.4009

104

94.9750

9.0250

101

81.7113

19.2887

99

99.8149

-0.8149

95

84.2216

10.7784

94

103.6556

92

99.8149

-7.8149

89

84.2216

4.7784

e= y - Mv =

86

_

86.6938

-9.6556

=

-0.6938

86

89.0593

-3.0593

86

92.8388

-6.8388

84

82.6323

1.3677

82

82.9634

-0.9634

81

82.4786

-1.4786

80

81.8636

-1.8636

80

82.9634

-2.9634

80

86.3111

-6.3111

79

82.6323

-3.6323

79

93.9121

-14.9121

76

87.6372

-11.6372

||e||= 44.5304

Graph of best fit curve against its observed

A) Linear model

B) Quadratic model

C) Cubic model

GRAPH OF THE ERROR VECTOR AGAINST X VALUES

A) Error magnitude of linear model

B) Error magnitude of quadratic model

C) Error magnitude of cubic model

Analysis and Conclusion

Based on the three models above, the following error magnitudes in the approximation are obtained. Types of Best Fit Curve

Error magnitude

Linear

49.3411

Quadratic

48.5274

Cubic

44.5304

.

the best fit curves in this case which will give the best approximation is the cubic best fit curve because it has the minimum error in terms of its magnitude.

. .

Cubic model

Error magnitude of cubic model

The projected graph of best fit curve against its observed data that produces the least error.

Appendix...


Similar Free PDFs