Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code can be in java or python, java preferred. Consider the following linear system: 3x1 + 4x2 + 3x3 = 10 x1 + 5x2

image text in transcribed

The code can be in java or python, java preferred.

Consider the following linear system: 3x1 + 4x2 + 3x3 = 10 x1 + 5x2 - x3 = 7 6x1 + 3x2 + 7x3 = 15 Exercise 1 Solve the system using Naive Gaussian Elimination. Exercise 2 Solve the system using Gaussian Elimination with Scaled Partial Pivoting. Exercise 3 Write a program, in the language of your preference, that computes solutions for linear systems. The program should take as input a file which contains data for a linear system in the following format: a 11 a 12 ... a1n a21 a22 ... a 2n an1 an2.... ann b1 b2 ... bn The file should have extension lin, for example, sys 1.lin could a suitable file name. The program should use Naive Gaussian Elimination by default and should place the solution in a file with the same name as the input, but with extension .sol and with the following format: x1 x2 ...xn Additionally, the user should be able to modify the programs behavior with optional flag --spp, in which case the program will use Scaled Partial Pivoting to produce the solution. For example, for a system placed in file sys1.lin, the user could run: > gaussian sys1.lin > gaussian--spp sys1.lin In the first case the program will use NGE, and in the second it will use SPP. In both cases, the solution will be placed in file sys1.sol. Exercise 4 Using your program, compute solutions for the following system: 0.0001 -5.0300 5.8090 7.8320 2.2660 1.9950 1.2120 8.0080 8.8500 5.6810 4.5520 1.3020 6.7750 -2.2530 2.9080 3.9700 9.5740 7.2190 5.7300 6.2910 Run your program in both modes. Compare and discuss your results

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

Logics For Databases And Information Systems

Authors: Jan Chomicki ,Gunter Saake

1st Edition

1461375827, 978-1461375821

More Books

Students also viewed these Databases questions

Question

Evaluate the impact of unions on nurses and physicians.

Answered: 1 week ago

Question

Describe the impact of strikes on patient care.

Answered: 1 week ago

Question

Evaluate long-term care insurance.

Answered: 1 week ago