EBK NUMERICAL METHODS FOR ENGINEERS
EBK NUMERICAL METHODS FOR ENGINEERS
7th Edition
ISBN: 9780100254145
Author: Chapra
Publisher: YUZU
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 14P

Two distances are required to specify the location of a point relative to an origin in two-dimensional space (Fig. P2.14):

The horizontal and vertical distances ( x ,   y ) inCartesian coordinates

The radius and angle ( r ,   θ ) in radial coordinates.

Chapter 2, Problem 14P, 2.14	Two distances are required to specify the location of a point relative to an origin in

FIGURE P2.14

It is relatively straight forward to compute Cartesian coordinates ( x ,   y ) on the basis of polar coordinates ( r ,   θ ) . The reverseprocess is not so simple. The radius can be computed by the following formula:

r = x 2 + y 2

If the coordinates lie within the first and fourth coordinates ( i .e . ,   x > 0 ) , then a simple formula can be used to compute θ

θ = tan 1 ( y x )

The difficulty arises for the other cases. The following table summarizes the possibilities:

x Y θ
< 0 >0 tan 1 ( y / x ) + π
< 0 < 0 tan 1 ( y / x ) π
< 0 = 0 π
= 0 >0 π / 2
= 0 < 0 π / 2
= 0 = 0 0

(a) Write a well-structured flowchart for a subroutine procedure to calculate r and θ as a function of x and y. Express the finalresults for θ in degrees.

(b) Write a well-structured function procedure based on your flowchart. Test your program by using it to fill out the following table:

x Y r θ
1 0
1 1
0 1
–1 1
–1 0
–1 –1
0 –1
1 –1
0 0

(a)

Expert Solution
Check Mark
To determine

A well-structured flowchart for a subordinate procedure to calculate r and θ as a function of x and y for the table given below, if two distances are required to specify the location of a point relative to an origin in two-dimensional space.

xyθ<0>0tan1(y/x)+π<0<0tan1(y/x)π<0=0π=0>0π/2=0<0π/2=0=00

Answer to Problem 14P

Solution:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  1

Explanation of Solution

Given Information:

To specify the location of a point relative to origin, cartesian coordinates (x,y) and polar coordinates (r,θ) are used.

Cartesian coordinates can be easily computed from the polar coordinates.

Polar coordinates are computed as follows:

r=x2+y2,θ=tan1(yx)

Formula used:

Calculation:

The flowchart for converting from Cartesian to polar coordinates is as follows

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  2

(b)

Expert Solution
Check Mark
To determine

A well-structured function procedure based on flowchart of part (a) if two distances are required to specify the location of a point relative to an origin in two-dimensional space. Also, test the program by filling the table given below:

xyrθ101101111011011100

Answer to Problem 14P

Solution:

The values of r and θ corresponding to provided x and y are:

xyrθ1010111.41424501190111.4142135101180111.41421350111111.4142450000

Explanation of Solution

Given Information:

To specify the location of a point relative to origin, cartesian coordinates (x,y) and polar coordinates (r,θ) are used.

Cartesian coordinates can be easily computed from the polar coordinates.

Polar coordinates are computed as follows:

r=x2+y2,θ=tan1(yx)

Calculation:

The MATLAB program for converting Cartesian to polar coordinates is as follows:

% Define a function polar()

function polar(x, y)

% Formula to calculate r

r = sqrt (x.^ 2+ y.^ 2);

if x > 0

% Formula to calculate theta

th= atan(y/ x);

elseif x < 0

% Use for loop to check the condition

if y > 0

th= atan(y / x)+ pi;

elseif y < 0

th= atan(y / x)- pi;

else

th= pi;

end

else

if y > 0

th= pi / 2;

elseif y < 0

th=- pi / 2;

else

th= 0;

end

end

theta = th* 180 / pi;

% Display the polar coordinates

fprintf('r = %4.4f theta = %4.2f\n',r,theta);

Now, to test the program use the following command.

First find polar coordinates for x=1,y=0.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  3

Now, for polar coordinates for x=1,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  4

Now, for polar coordinates for x=0,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  5

Now, forpolar coordinates for x=1,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  6

Now, forpolar coordinates for x=1,y=0.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  7

Now, forpolar coordinates for x=1,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  8

Now, forpolar coordinates for x=0,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  9

Now, forpolar coordinates for x=1,y=1.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  10

Now, forpolar coordinates for x=0,y=0.

OUTPUT:

EBK NUMERICAL METHODS FOR ENGINEERS, Chapter 2, Problem 14P , additional homework tip  11

Hence, the values of r and θ corresponding to provided x and y are:

xyrθ1010111.41424501190111.4142135101180111.41421350111111.4142450000

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
For each system below with transfer function G(s), plot the pole(s) on the s-plane. and indicate whether the system is: (a) "stable" (i.e., a bounded input will always result in a bounded output), (b) "marginally stable," or (c) "unstable" Sketch a rough graph of the time response to a step input. 8 a) G(s) = 5-5 8 b) G(s) = c) G(s) = = s+5 3s + 8 s² - 2s +2 3s +8 d) G(s): = s²+2s+2 3s+8 e) G(s): = s² +9 f) G(s): 8 00 == S
Please answer the following question. Include all work and plase explain. Graphs are provided below. "Consider the Mg (Magnesium) - Ni (Nickel) phase diagram shown below. This phase diagram contains two eutectic reactions and two intermediate phases (Mg2Ni and MgNi2). At a temperature of 505oC, determine what the composition of an alloy would need to be to contain a mass fraction of 0.20 Mg and 0.80 Mg2Ni."
The triangular plate, having a 90∘∘ angle at AA, supports the load PP = 370 lblb as shown in (Figure 1).

Chapter 2 Solutions

EBK NUMERICAL METHODS FOR ENGINEERS

Knowledge Booster
Background pattern image
Mechanical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Text book image
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Text book image
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Text book image
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Text book image
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Text book image
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Chain Rule dy:dx = dy:du*du:dx; Author: Robert Cappetta;https://www.youtube.com/watch?v=IUYniALwbHs;License: Standard YouTube License, CC-BY
CHAIN RULE Part 1; Author: Btech Maths Hub;https://www.youtube.com/watch?v=TIAw6AJ_5Po;License: Standard YouTube License, CC-BY