Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Numerical Methods Homework Assignment 3: Solving Linear Systems using Gauss-Elimination - , Assignments of Engineering

A university homework assignment from the university of california, davis, department of applied science, spring 2008, numerical methods course (ead 115) by david m. Rocke. Students are required to solve problems from the text and implement naive gaussian elimination using vba or another programming language. They are also asked to compare the results with the solution obtained using matlab.

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-si8
koofers-user-si8 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Numerical Methods Homework Assignment 3: Solving Linear Systems using Gauss-Elimination - and more Assignments Engineering in PDF only on Docsity! University of California, Davis Department of Applied Science Spring 2008 David M. Rocke Numerical Methods EAD 115 April 17, 2008 Homework Assignment 3 Due April 24, 2008 1. Do the following problems from the text: 9.8, 10.2โ€“10.4, 10.16. 2. Write a program in a language of your choice to implement Naive Gaussian Elimination. Below is the framework for a VBA implementation (available for download on the web site). You may use this, or you may write the equivalent in another language. Option Explicit Sub Gauss() โ€™ โ€™ Declarations โ€™ Dim A() As Variant, b() As Variant, x() As Variant Dim nrows As Integer, ncols As Integer, n As Integer Dim rng1 As Range, rng2 As Range, rng3 As Range Dim i As Integer, j As Integer, k As Integer Dim factor As Double, sum As Double โ€™ โ€™ Get input ranges, check for correct shape, and set arrays โ€™ Call GetRange(rng1, "Enter n by n input range for matrix of coefficients") Call GetRange(rng2, "Enter n by 1 input range for RHS") Call GetRange(rng3, "Enter n by 1 output range for solution") ncols = rng1.Columns.Count nrows = rng1.Rows.Count If (nrows <> ncols) Then MsgBox "Matrix not square" Exit Sub End If n = nrows If ((rng2.Rows.Count <> n) Or (rng3.Rows.Count <> n) Or _ (rng2.Columns.Count <> 1) Or (rng3.Columns.Count <> 1)) Then
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved