Sei sulla pagina 1di 8

QUESTION 1:

Answer:

Gauss Siedel

enter the no. of equation

Enter the equation of B:

Also enter the initial gu

x1 x2 x3

0.5000 0.7500 3.2500

0.1250 -0.6875 4.6875

0.8438 -1.7656 5.7656

1.3828 -2.5742 6.5742

1.7871 -3.1807 7.1807

2.0903 -3.6355 7.6355

2.3177 -3.9766 7.9766

2.4883 -4.2325 8.2325

2.6162 -4.4244 8.4244

2.7122 -4.5683 8.5683

2.7841 -4.6762 8.6762

2.8381 -4.7571 8.7571

2.8786 -4.8179 8.8179

2.9089 -4.8634 8.8634

2.9317 -4.8975 8.8975

2.9488 -4.9232 8.9232

2.9616 -4.9424 8.9424

2.9712 -4.9568 8.9568

2.9784 -4.9676 8.9676

2.9838 -4.9757 8.9757

2.9878 -4.9818 8.9818

2.9909 -4.9863 8.9863

2.9932 -4.9897 8.9897

2.9949 -4.9923 8.9923


2.9962 -4.9942 8.9942

2.9971 -4.9957 8.9957

2.9978 -4.9968 8.9968

2.9984 -4.9976 8.9976

2.9988 -4.9982 8.9982

2.9991 -4.9986 8.9986

2.9993 -4.9990 8.9990

2.9995 -4.9992 8.9992

2.9996 -4.9994 8.9994

2.9997 -4.9996 8.9996

2.9998 -4.9997 8.9997

2.9998 -4.9998 8.9998

2.9999 -4.9998 8.9998

2.9999 -4.9999 8.9999

2.9999 -4.9999 8.9999

2.9999 -4.9999 8.9999

3.0000 -4.9999 8.9999

3.0000 -5.0000 9.0000

3.0000 -5.0000 9.0000

JACOBI

enter the no. of equation

Enter the equation of B:

Also enter the initial gu

x1 x2 x3

0.0000 0.0000 0.0000

0.5000 1.0000 4.0000

0.0000 -1.2500 3.0000

1.1250 -0.5000 5.2500

0.7500 -2.1875 4.5000


1.5938 -1.6250 6.1875

1.3125 -2.8906 5.6250

1.9453 -2.4688 6.8906

1.7344 -3.4180 6.4688

2.2090 -3.1016 7.4180

2.0508 -3.8135 7.1016

2.4067 -3.5762 7.8135

2.2881 -4.1101 7.5762

2.5551 -3.9321 8.1101

2.4661 -4.3326 7.9321

2.6663 -4.1991 8.3326

2.5995 -4.4994 8.1991

2.7497 -4.3993 8.4994

2.6997 -4.6246 8.3993

2.8123 -4.5495 8.6246

2.7747 -4.7184 8.5495

2.8592 -4.6621 8.7184

2.8311 -4.7888 8.6621

2.8944 -4.7466 8.7888

2.8733 -4.8416 8.7466

2.9208 -4.8099 8.8416

2.9050 -4.8812 8.8099

2.9406 -4.8575 8.8812

2.9287 -4.9109 8.8575

2.9555 -4.8931 8.9109

2.9465 -4.9332 8.8931

2.9666 -4.9198 8.9332

2.9599 -4.9499 8.9198

2.9749 -4.9399 8.9499

2.9699 -4.9624 8.9399

2.9812 -4.9549 8.9624


2.9774 -4.9718 8.9549

2.9859 -4.9662 8.9718

2.9831 -4.9789 8.9662

2.9894 -4.9746 8.9789

2.9873 -4.9841 8.9746

2.9921 -4.9810 8.9841

2.9905 -4.9881 8.9810

2.9941 -4.9857 8.9881

2.9929 -4.9911 8.9857

2.9955 -4.9893 8.9911

2.9946 -4.9933 8.9893

2.9967 -4.9920 8.9933

2.9960 -4.9950 8.9920

2.9975 -4.9940 8.9950

2.9970 -4.9962 8.9940

2.9981 -4.9955 8.9962

2.9977 -4.9972 8.9955

2.9986 -4.9966 8.9972

2.9983 -4.9979 8.9966

2.9989 -4.9975 8.9979

2.9987 -4.9984 8.9975

2.9992 -4.9981 8.9984

2.9990 -4.9988 8.9981

2.9994 -4.9986 8.9988

2.9993 -4.9991 8.9986

2.9996 -4.9989 8.9991

2.9995 -4.9993 8.9989

2.9997 -4.9992 8.9993

2.9996 -4.9995 8.9992

2.9997 -4.9994 8.9995

2.9997 -4.9996 8.9994


2.9998 -4.9995 8.9996

2.9998 -4.9997 8.9995

2.9999 -4.9997 8.9997

2.9998 -4.9998 8.9997

2.9999 -4.9997 8.9998

2.9999 -4.9998 8.9997

2.9999 -4.9998 8.9998

2.9999 -4.9999 8.9998

2.9999 -4.9999 8.9999

2.9999 -4.9999 8.9999

3.0000 -4.9999 8.9999

2.9999 -4.9999 8.9999

3.0000 -4.9999 8.9999

3.0000 -4.9999 8.9999

3.0000 -4.9999 8.9999

3.0000 -5.0000 8.9999

3.0000 -5.0000 9.0000

3.0000 -5.0000 9.0000

3.0000 -5.0000 9.0000

EXPLANATION:

For GS method, the values of X’s were changed even during the same iteration.

For Jacobian,the values of X’s were changed after every iteration.

Instead of defining a tolerance value, I have used the concept that if 3 iteration contains the same
value, the cursor exits from the loop.
QUESTION 2:

ANSWER:

Please, have a look in MS-excel file called “Book1” in the same folder

EXPLANATION:

Error approximation in Gauss-Siedel is greater than in that of Jacobian.


QUESTION 2:

ANSWER:

enter the no. of equations you have

Enter the equation of B:

Also enter the initial guesses

x1 x2 x3

-1.2500 0.1250 4.3750

1.2812 -2.1719 5.9219

1.7383 -3.0449 7.1699

2.1646 -3.8718 7.8093

2.5716 -4.2480 8.2793

2.6502 -4.5534 8.5378

2.8400 -4.7092 8.7170

2.8619 -4.8241 8.8202

2.9371 -4.8871 8.8891

2.9468 -4.9309 8.9299

2.9748 -4.9561 8.9566

2.9797 -4.9729 8.9727

2.9899 -4.9829 8.9830

2.9922 -4.9894 8.9893

2.9959 -4.9933 8.9934

2.9970 -4.9959 8.9958

2.9984 -4.9974 8.9974

2.9989 -4.9984 8.9984

2.9994 -4.9990 8.9990

2.9996 -4.9994 8.9994

2.9997 -4.9996 8.9996

2.9998 -4.9998 8.9998

2.9999 -4.9998 8.9998

2.9999 -4.9999 8.9999

3.0000 -4.9999 8.9999


3.0000 -5.0000 9.0000

3.0000 -5.0000 9.0000

EXPLANATION:

Using SOR we have reduced the steps to 26 from initial which was 42(without SOR). Also, the pic
uploaded in the same folder gives us a clear idea that using SOR, how fast the error reduces after 2-3
iterations in comparison to that of general Gauss-Siedel or Jacobian.

Potrebbero piacerti anche