Problem 1.1
Describethedifferencesbetweenanalyticandalgorithmicsolutions.
Answer:
An analytic solution is an exact solution, based on the application of the mathematical principles of algebra, calculus, etc.
An algorithmic solution is an approximate solution, based on the application of a computational procedure. The algorithm will generally rely on principles of arithmetic only to solve the problem; therefore, while the solution is approximate, it also eliminates the need to apply more complicated mathematics to the problem
Developthepseudocodeforanalgorithmicsolutionforfindingthetwopointswherethe function crossesthe -axis.
Answer:
1. Defineaninitialvaluefor ;e.g. .
2 Calculatethevalueof at ,
3. Addasmallincrementto toget ;e.g.
4. Calculatethevalueof at ,
5 If and havethesamesign,thenmake GotoStep2andrepeat. If and havedifferentsigns,thencalculatethefirstaxiscrossingtobeat andcontinue.
6. Define .
7 Calculatethevalueof at ,
8. Addasmallincrementto toget ;e.g.
9. Calculatethevalueof at ,
10.If and havethesamesign,thenmake . GotoStep7andrepeat. If and havedifferentsigns,thencalculatethesecondaxiscrossingtobeat
11.Endthealgorithm,andreporttheresults and .
Problem 1.3
ConsiderthecannonmodeldevelopedinSection111
a) Usingtheequationsdevelopedandalaunchspeedof10.0m/s,developthe pseudocodeforanalgorithmicsolutiontodeterminethelaunchanglerequiredto reachapeakheightofatleast25meters.
b) Usingdiscretevaluesspaced5° apart,carryoutthealgorithmicsolutionbyhand. Reporteachstepinthealgorithminatable.
c) Performananalyticsolutionforthisproblem,andcomparetheresultwithyour algorithmicsolution.
Solution:
a) Inthisalgorithm,intervalsof and and willbeused.
1. Definethevariable .
2. Definethevariable
3. Definethevariable .
4. Calculate
5. Definethevariable
6. Calculate
7. If ,thenmake .
8. If ,set , , andreturntoStep4.
9. If ,thenmake ,andreturntoStep3.
10 Reportthevaluefor ,andendthealgorithm
b) Carryingoutthealgorithmyields:
Answer: Alaunchangleof50°willyieldapeakheightgreaterthan25m.
c) Theanalyticsolutionisasfollows:
FromEq.1.4,theheightwillbemaximumat:
SubstitutingthisintoEq.1.1,withtheheightsetat2.5m,yields:
With and ,thiscanbesolvedfor analytically: =.4905
or:
Answer: Alaunchangleof yieldsapeakheightof2.5m.
Discussion: Whileboththealgorithmicandtheanalyticsolutionproducedanswersthat yieldedapeakheightof at least 25m,thediscretenatureofthealgorithmicsolution missedthesmallestlaunchanglethatwouldachievethisgoal. Usingthe50°launchangle givenbythealgorithmicsolution,thepeakheightwouldactuallybe3.0m.
Copyright 2021 © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
ConsiderthecannonballproblemdescribedinSection1.1.1. Youhavebeenaskedto determineacombinationoflaunchspeedandanglerequiredtocleara5-meterwall erected8metersfromthelaunchpoint. Developthepseudocodeforanalgorithmic solutiontothisproblem.
Answer: Thisalgorithmassumesthatsomemaximumspeedofthecannon, ,is known,andthatthereisasolutiontotheproblem Also,averysmalltimestepwouldbe recommended.
1. Definethevariables and (somepracticalarbitrarystarting values).
2. Definethevariable .
3. Calculate
4 If ,thenincrease andrepeatStep3
5 Calculate

6. If and ,thenincrease andreturntoStep2.
7 If and ,thenset , increase , andreturnto Step2.
8. Reportthevaluesfor and ,andendthealgorithm.