logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
StatAnalytica ExpertPolitical science
(5/5)

851 Answers

Hire Me
expert
Quality ExpertBusiness
(5/5)

551 Answers

Hire Me
expert
Umar AbdullaEconomics
(3/5)

668 Answers

Hire Me
expert
Milton BlahaaFinance
(5/5)

803 Answers

Hire Me
SAS
(5/5)

write a sas iml code function to implement newton raphson method to solve non-linear equation

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

In this Homework 3 you will write a SAS IML code/function to implement NewtonRaphson (NR) method to solve non-linear equation.

For linear equation e.g. 𝑓(π‘₯) = 2π‘₯ + 5 the solution is easy, it is 2π‘₯ + 5 = 0 or π‘₯ = −2.5

So, Solution is that value of π‘₯ for which 𝑓(π‘₯) = 0

For non-linear question this is not so straightforward. Here is some introduction to the above from Mathworld for non-linear equation.

You stop the iteration when ο€­ ο€Ό ο₯ n n x x 1

, i.e. your two iterative evaluation of π‘₯ΰ―‘is close.

Note that the equation (5) is the key element here. Your task is to Implement NR in IML. 

You stop the iteration when ο€­ ο€Ό ο₯ n n x x 1 , i.e. your two iterative evaluation of π‘₯ ΰ―‘is close.

Note that the equation (5) is the key element here. Your task is to Implement NR in IML.

You need to solve the root for two equations via IML.

You need to provide in each case a starting value ( ) 0 x and a convergence parameter(ο₯ ), typically 0.001 or a smaller value.

Starting value could be any number. Try with few different choices to ensure in all cases you always get a single solution.

(1) ( ) 5 3 3 f x ο€½ x  x ο€­ , note, 𝑓 ᇱ(π‘₯) = 3π‘₯ΰ¬Ά + 5

(2) ( ) 6 2 f x ο€½ e ο€­ x ο€­ x , note, 𝑓 ᇱ(π‘₯) = 2𝑒ଢ௫ − 1

Print also your SAS output showing the root and each iteration. Once you find a solution check that if 𝑓(π‘₯ΰ―‘ ) ≈ 0 (i.e. very close to zero if not exactly zero) for that π‘₯ΰ―‘. Now use the same code to find, Note, 𝑓 ᇱ(π‘₯) = ଡ ΰ―« for, 𝑦 = 𝑓(π‘₯) = ln (π‘₯), so you may need to update you code accordingly. What you must provide, 1. SAS code for each case (as word/SAS file),

2. Final Solution to each equation in SAS output window, print π‘₯଴, πœ€, π‘₯ΰ―‘ and print final ο€­ ο€Ό ο₯ n n x x 1 to show convergence. Also show iteration number of convergence. However, please don’t print all iterations as it could take many lines before convergence.

Total points 70 (20 for correct implementation of NR, 15 for each of the three problems correct solution and 5 for the cleverness and compactness of your code)

Hints: - You need to use some kind of loop structure within IML, which will be exited only when the condition ο€­ ο€Ό ο₯ n n x x 1 is true. However, be careful not to get stuck in an infinite loop. Therefore, you may want to give a “max iteration” (<5000) number to guard against that.

Note: - You should not use SAS built in function like “polyroot”, “NLPNRA” or Proc FCMP etc.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. ThisΒ  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme