Docsity

APPLIED NUMERICAL METHODS WITH PYTHON FOR ENGINEERS AND SCIENTISTS, Exams of Nursing

Toggle sidebar
bg1
APPLIED NUMERICAL METHODS WITH
PYTHON FOR ENGINEERS AND
SCIENTISTS
Question:
1ST EDITION STEVEN CHAPRA DAVID
CLOUGH SOLUTIONS MANUAL ALL
CHAPTERS ACTUAL EXAMINATION 2026
QUESTIONS WITH SOLUTIONS GRADED A+
 For the following conditions:
x = 0: 0.25: 10;
y(1) = 5;
dydx = @(y) tanh(y);
which of the following for loops could be make to work with Euler's
Method?
Answer:
Both of them
 Which line of code correctly sets the anonymous function dy/dt to be
used with the Euler's method if:
Question:
dydt=cos⁡(et)
Answer:
dydt = @(t) cos(exp(t))
 Which of the following lines of code would be used for the Euler's
Question:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30

Partial preview of the text

Download APPLIED NUMERICAL METHODS WITH PYTHON FOR ENGINEERS AND SCIENTISTS and more Exams Nursing in PDF only on Docsity!

APPLIED NUMERICAL METHODS WITH

PYTHON FOR ENGINEERS AND

SCIENTISTS

Question:

1ST EDITION STEVEN CHAPRA DAVID

CLOUGH SOLUTIONS MANUAL ALL

CHAPTERS ACTUAL EXAMINATION 2026

QUESTIONS WITH SOLUTIONS GRADED A+

For the following conditions: x = 0: 0.25: 10; y(1) = 5; dydx = @(y) tanh(y); which of the following for loops could be make to work with Euler's Method?

Answer:

Both of them Which line of code correctly sets the anonymous function dy/dt to be used with the Euler's method if:

Question:

dydt=cos(et)

Answer:

dydt = @(t) cos(exp(t)) Which of the following lines of code would be used for the Euler's

Question:

method if the derivative of y with respect to x is a function of x? Given that: dydx=excos(x) Matlab Code: dydx = @(x) exp(-x) * cos(x); h = 0.1; x = 0: h: 5; y(1) = 0; for k = 1: length(x)-1.. missing line.. end Pick the one that would replace the "missing line"

Answer:

Pick the for loop that should be used for an euler's method solution, given that x is from 0: 0.1: 10, and the initial value of y is 0, or.. h = 0.1; x = 0: h: 10;

Question:

y(1) = 0;

Answer:

for k = 1: length(x-1) Euler's Method will be exactly accurate if the solution turns out to be

Question:

what order of polynomial?

Answer:

0th, 1st

Question:

One way to make Euler's method more accurate is:

Answer:

Question:

where stuff is:

Answer:

forcing functions All of these (This one) independent variables parameters

Question:

Differential equations often can not be solved analytically

Answer:

True Consider the following differential equation dxdt=t+x

Question:

Is this a function of:

Answer:

both the dependent and independent variables A differential equation is written in terms of the differential rate of change of the variable we are interested in predicting, and is generally a function of both the dependent and independent variables dydt=f(t, y)

Question:

In this formulation, is y the dependent or independent variable?

Answer:

dependent To calculate the relative true error as a percentage you could use the following MATLAB code, assuming true_value and approximation are

Question:

variables that have already been defined.

Answer:

et = (true_value - approximation)/true_value * When calculating an approximate value for a series we need to decide when to quit executing the loop. One strategy is to define a stopping criteria, es, and compare it to the approximate error. If ea is calculated as ea = (present_approx-previous_approx)/present_approx*

Question:

The loop should be executed until

Answer:

|ea| with a finite number of terms?

Answer:

An nth order polynomial by an nth order Taylor's series The first backward difference formula, which can be used to

Question:

approximate the first derivative is

Answer:

f′(xi)=(f(xi)f(xi1))h where h=(xi+1xi) The first centered difference formula, which can be used to

Question:

approximate the first derivative is

Answer:

f'(x) = ((f(xi + 1) - f(xi - 1))/2h)

Question:

Which is the more accurate way to calculate a first derivative?

Answer:

first centered difference When using a centered difference approach to approximate a first

Question:

derivative, what is the impact of reducing the step size by a factor of 2?

Answer:

The error is reduced by approximately a factor of 4

Question:

The MacLaurin series is

Answer:

A special case of the Taylor series, expanded around 0 with a step size of x The following infinite series can be used to approximate ex ex=1+x+x22+x33!+..+xnn!

Question:

Another way to represent this is

Answer:

All of these (Correct Answer) ex=k=0nxkk! ex=1+k=1nxkk! ex=k=1n+1x(k1)(k1)!

Question:

The symbol! me

Answer:

factorial in mathematics. How do you calculate

Question:

factorials in MATLAB?

Answer:

ion. Answer: False It is possible to calculate a numerical value of et if you do not know

Question:

the true value of the unknown, when you are using a series exp

Answer:

ion to

Question:

create an estimate.

Answer:

False

Question:

In MATLAB NaN

Answer:

stands for Not a number From a coding perspective, which of the below is true for "for" loops

Question:

and "while" loops? Select all that are true.

Answer:

-for loops automatically update the index, while loops do not -for loops run for a fixed number of runs, while loops don't necessaril Which is a valid way to create a loop that runs until the solution

converges, assuming everything is defined in advance? Select all that could work. a) for n = 1: max_iterations calculate approx, ea if (abs(ea) < es) break end end b) while (1) calculate approx, ea if (abs(ea) < es) break end n = n+1; end c) while (abs(ea) > es) calculate approx, ea n = n+

Question:

end

Answer:

b) (while (1)) a) (for loop) c) (while loop) All of these What would you need to add to the following code snippet to get it to fix it so it works sig_fig = 5; es = 0.5*10^(2-sig_fig); x = 0.5; approx = 0; n = 0; while (~exist('ea') | abs(ea) > es) old = approx; approx = approx +

Answer:

bracketing methods Assume that for some function the absolute magnitude of the desired error in the solution obtained using bisection is 10-4 and the original difference between the upper and lower bounds is 2.. how many iterations are necessary? In other words Lk=10-4 and L0=2 and k is the number of iterations

Question:

Lk=2/2k

Answer:

The false position method is always faster than the bisection method

Question:

Answer:

False The Newton-Raphson Technique is based on the Taylor series

Question:

exp

Answer:

ion Answer: True The secant method is a variation of the Newton-Raphson technique. It requires that you be able to analytically define the first derivative of the

Question:

function

Answer:

False Unlike the Newton-Raphson technique, the secant method always

Question:

converges.

Answer:

False Which of these is not an open method for finding the root of a

Question:

nonlinear equation?

Answer:

Regula Falsi The Newton Raphson technique requires you to define an upper and

Question:

lower bound

Answer:

False The Bisection technique, Regula-Falsi technique, Newton_Raphson technique, Secant Method and Modified Secant Method all have the

Question:

following in common.

Bracketing techniques such as bisection and regula-falsi will find only one of the multiple roots that occur inside the specified range.

Question:

The fzero function found in MATLAB will

Answer:

return a single root of a non-linear equation

Question:

The roots function in MATLAB

Answer:

only works on polynomials

Question:

All of these (Correct

Answer:

finds both real and imaginary roots returns multiple roots if they exist While using the bisection method, which of the following code segments would mean the solution is on the left side of the midpoint, assuming xm is midpoint, xr is x at right end of the segment, and xl is x

Question:

at the left end of the segment?

Answer:

if (f(xl)*f(xm) < 0) A root-finding algorithm (such as the bisection method or Secant Method) can be used to find where a function has a constant, non-zero

Question:

value.

Answer:

True

Question:

What type of inputs does the built-in function "solve" expect?

Answer:

A symbolic expression Although in a general sense optimization is the process of creating something that is as effective as possible, from a mathematical

Question:

perspective optimization deals with finding

Answer:

extremes If you can find the derivative of a function analytically, you can use

Question:

root finding techniques to determine the maximum or minimum

Answer:

True Consider the following formula

Answer:

multiplying the function by -1 and finding the location of the minimum of the modified function. The fminbnd function is built into MATLAB and uses a combination of the Golden Section Method and the Parabolic Method. It is an

Question:

example of

Answer:

a one dimensional constrained optimization method

Question:

The Golden Section method is an example of

Answer:

a one dimensional constrained optimization method Consider the following code which defines and plots a MATLAB function clear, clc, clff=@(x) -3 -5x + x.^2 + x.^3 - 0.5x^4fplot(f, [- 2, 2])xlabel('x'), ylabel('y'), title('A 4th order polynomial'), grid on and creates this figure Which of the following pieces of code an be used to find the location of

Question:

the maximum, and the maximum function value?

Answer:

g=@(x) -f(x) x=fminbnd(g, -2, 2) fx=f(x) Our textbook defines the golden ratio as

ϕ=(1+5)2=1.618.. but the course PowerPoint and video presentations use an alternate definition ϕ2=(51)2=0.618..

Question:

You can convert between the two definitions by

Answer:

either approach If a one-dimensional function has multiple local minima and maxima which of the following can be used to determine the global extreme

Question:

(either minimum or maximum)

Answer:

Both strategies are appropriate If you can find the derivative of a function analytically you can use fzero to determine the location of the maximum or the minimum

Question:

Answer:

True Consider the following code clear, clcsyms xy= x^4 - 10x^3 -5x^2 +10*x -3fplot(y, [- 10, 12])xlabel('x'), ylabel('y'), title('A 4th order polynomial'), grid on which generates the following figure How could you use the built-in fzero function to find the location and