Select Page

Problem #1 – Central finite difference Jacobian
You learned how to use the Newton-Raphson method to find the solutions (roots) of a 2D
system of equations using the forward finite difference to approximate the partial derivatives in
the Jacobian matrix. Your job is to modify the function to use the central finite difference to
approximate the Jacobian matrix. I have supplied the script
(yourLastName_3854_HW7_P1_Newt_Raph.m) and function
(yourLastName_3854_HW7_P1_Forward_J.m) files necessary to solve the system of equations
below:
�!(�!, �”) = ‘c#,% + x! + x”+
‘c&,% − 2x! − x”+’c’,% − x!+
− 4 × 10()
�”(�!, �”) = ‘c#,% + x! + x”+
‘c&,% − 2x! − x”+

‘c*,% − x”+
− 3.7 × 10(“
• Modify the provided function to do the following:
o Use the central finite difference instead of the forward finite difference to
approximate the Jacobian matrix
o Save as (yourLastName_3854_HW7_P1_Central_J.m).
• Modify the provided script to do the following:
o Solve the system twice: once using a forward finite difference Jacobian and once
using the central finite difference Jacobian.
o Use true error instead of approximate error to determine when to terminate
o Output the number of iterations and the true error using both methods.
o Save as (yourLastName_3854_HW7_P1_Newt_Raph.m)
• Turn in both the function that I provided (yourLastName_3854_HW7_P1_Forward_J.m)
Hints:
• Use the specified initial conditions, error tolerance, and maximum iterations already
defined
• No need to modify the inputs or outputs of the function
• To calculate true error, you will need the true solutions to the system. Use MATLAB’s
built in fsolve function to obtain the “true” solutions before your while loop. I say
“true” solutions because technically this is still a numerical approximation, but it is very
accurate.
• It may be easiest to just use two separate while loops separately calling each Jacobian
function.
HW 7 Chemical Engineering Computations Fall 2020
ECH 3854 Dr. Thourson
2
• If you use two separate while loops, make sure you reset your iterations, approximate
error, and initial guess if you reuse your variable names.
Bonus #1 – True error limit (1 point)
• What happens when you try to improve the error (i.e. decrease specError)?
• Why is it that there’s a limit on the true error that can be achieved? (Hint: what happens
to dx?)
Problem #2 – Simpson’s 3/8 Rule
Using Simpson’s 3/8 Rule for multiple segments over an interval can be generally expressed as:
5 �(�)��
+
,
= 3ℎ
8 [(�% + �-) + 3(�! + �” + �) + �. + ⋯ + �-(!) + 2(�/ + �0 + �1 … + �-(/)]
• Write a script (yourLastName_3854_HW7_P2_Simp38.m) that uses Simpson’s 3/8 Rule
to approximate the integral of:
�(�) = 5 + 12� − 150�” + 370�/ − 100�) + 300�.
from � = 0 to � = 1 using � = 7 segments.
Bonus #2 – Simpson’s 1/3 Rule (1 point)
• Estimate the same integral in Problem #2 using Simpson’s 1/3 rule (just add to your
script)
• Find the true value of the integral using built-in MATLAB functions such as
vpaintegral(func,x,xi,xf)and compare the true error of Simpson’s 3/8 vs. 1/3
rules.
Hints:
• Simpson’s 3/8 Rule needs an odd number of segments.
• Use MATLAB’s mod function to determine if � is divisible by 3 in your for loop
• For Bonus #2:
o Simpson’s 1/3 Rule needs an even number of segments.
o Remember if you try to do both methods in the same script and reuse variables,
that can cause issues. Either write a new script, rename the variables, or make
sure you reset the variables before using the other method.

Sample Solution

#### Sample solution

Dante Alighieri played a critical role in the literature world through his poem Divine Comedy that was written in the 14th century. The poem contains Inferno, Purgatorio, and Paradiso. The Inferno is a description of the nine circles of torment that are found on the earth. It depicts the realms of the people that have gone against the spiritual values and who, instead, have chosen bestial appetite, violence, or fraud and malice. The nine circles of hell are limbo, lust, gluttony, greed and wrath. Others are heresy, violence, fraud, and treachery. The purpose of this paper is to examine the Dante’s Inferno in the perspective of its portrayal of God’s image and the justification of hell.

In this epic poem, God is portrayed as a super being guilty of multiple weaknesses including being egotistic, unjust, and hypocritical. Dante, in this poem, depicts God as being more human than divine by challenging God’s omnipotence. Additionally, the manner in which Dante describes Hell is in full contradiction to the morals of God as written in the Bible. When god arranges Hell to flatter Himself, He commits egotism, a sin that is common among human beings (Cheney, 2016). The weakness is depicted in Limbo and on the Gate of Hell where, for instance, God sends those who do not worship Him to Hell. This implies that failure to worship Him is a sin.

God is also depicted as lacking justice in His actions thus removing the godly image. The injustice is portrayed by the manner in which the sodomites and opportunists are treated. The opportunists are subjected to banner chasing in their lives after death followed by being stung by insects and maggots. They are known to having done neither good nor bad during their lifetimes and, therefore, justice could have demanded that they be granted a neutral punishment having lived a neutral life. The sodomites are also punished unfairly by God when Brunetto Lattini is condemned to hell despite being a good leader (Babor, T. F., McGovern, T., & Robaina, K. (2017). While he commited sodomy, God chooses to ignore all the other good deeds that Brunetto did.

Finally, God is also portrayed as being hypocritical in His actions, a sin that further diminishes His godliness and makes Him more human. A case in point is when God condemns the sin of egotism and goes ahead to commit it repeatedly. Proverbs 29:23 states that “arrogance will bring your downfall, but if you are humble, you will be respected.” When Slattery condemns Dante’s human state as being weak, doubtful, and limited, he is proving God’s hypocrisy because He is also human (Verdicchio, 2015). The actions of God in Hell as portrayed by Dante are inconsistent with the Biblical literature. Both Dante and God are prone to making mistakes, something common among human beings thus making God more human.

To wrap it up, Dante portrays God is more human since He commits the same sins that humans commit: egotism, hypocrisy, and injustice. Hell is justified as being a destination for victims of the mistakes committed by God. The Hell is presented as being a totally different place as compared to what is written about it in the Bible. As a result, reading through the text gives an image of God who is prone to the very mistakes common to humans thus ripping Him off His lofty status of divine and, instead, making Him a mere human. Whether or not Dante did it intentionally is subject to debate but one thing is clear in the poem: the misconstrued notion of God is revealed to future generations.

References

Babor, T. F., McGovern, T., & Robaina, K. (2017). Dante’s inferno: Seven deadly sins in scientific publishing and how to avoid them. Addiction Science: A Guide for the Perplexed, 267.

Cheney, L. D. G. (2016). Illustrations for Dante’s Inferno: A Comparative Study of Sandro Botticelli, Giovanni Stradano, and Federico Zuccaro. Cultural and Religious Studies4(8), 487.

Verdicchio, M. (2015). Irony and Desire in Dante’s” Inferno” 27. Italica, 285-297.