1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leya [2.2K]
3 years ago
13

The "divide and average" method, an old-time method for approximating the square root of any positive number a, can be formulate

d as:
x= (x +a/x)/2

Write a well-structured M-file function based on the while...break loop structure to implement this algorithm. Use proper indentation so that the structure is clear. At each step estimate the error in your approximation as:

ε= |x^new- x^old/x^new|

Repeat the loop until ε is less than or equal to a specified value. Design your program so that it returns both the result and the error. Make sure that it can evaluate the square root of numbers that are equal to and less than zero. For the latter case, display the result as an imaginary number. For example, the square root of -4 would return 2i. Test your program by evaluating a = 0,2, 10 and-4 for ε = 10^-4

Engineering
1 answer:
Shalnov [3]3 years ago
4 0

Answer:

<u>note:</u>

find the attachment:

You might be interested in
A hollow aluminum sphere, with an electrical heater in the center, is used in tests to determine the thermal conductivity of ins
Stella [2.4K]

Answer:

K_{ins}=\frac {0.157892}{2.854263}=0.055318 W/m.K

Explanation:

Generally, thermal resistance for conduction heat transfer in a sphere.

R_{cond} = \frac{{\left( {1/{r_i}} \right) - \left( {1/{r_o}} \right)}}{{4\pi K}}  

Where R_{cond} is the thermal resistance for conduction, K is the thermal conductivity of the material, r_{i} is the inner radius of the sphere, and r_{o} is the outer radius of the sphere.

The surface area of sphere, A_{s} is given by

A_{s}=4\pi {r^2}

For aluminum sphere, the thermal resistance for conductive heat transfer is given by

Calculate the thermal resistance for conductive heat transfer through the aluminum sphere.

R_{cond,s{\rm{ - 1}}} = \frac{{\left( {1/{r_i}} \right) - \left( {1/{r_o}} \right)}}{{4\pi {K_{Al}}}}

Where K_{Al} is aluminum’s thermal conductivity at T_{s}

Thermal resistance for conductive heat transfer through the insulation.

R_{cond,1{\rm{ - 2}}} = \frac{{\left( {1/{r_o}} \right) - \left( {1/r} \right)}}{{4\pi {K_{ins}}}}

Thermal resistance for convection is given by

R_{conv} = \frac{1}{{hA}}

Where h is convective heat transfer coefficient, R_{conv} is thermal resistance for convection and A is the cross-sectional area normal to the direction of flow of heat energy

Thermal resistance for convective heat transfer in-between the outer surface of the insulation and the ambient air.

R_{conv,2{\rm{ - }}\infty } = \frac{1}{{h{A_s}}}

Where h represents convective heat transfer coefficient at the outer surface of the insulation. Since A_{s} is already defined, substituting it into the above formula yields

R_{conv,2{\rm{ - }}\infty } = \frac{1}{{h\left( {4\pi {r^2}} \right)}}

To obtain radial distance of the outer surface of the insulation from the center of the sphere.

r = r_{o} + t where t is thickness of insulation

r=0.21+0.15=0.36m

Total thermal resistance

R_{eq} = {R_{cond,s{\rm{ - 1}}}} + {R_{cond,1{\rm{ - 2}}}} +{R_{conv,2{\rm{ - }}\infty }}

Where R_{eq} is total thermal resistance

R_{eq} = \frac{{\left( {1/{r_i}} \right) - \left( {1/{r_o}} \right)}}{{4\pi {K_{Al}}}} + \frac{{\left( {1/{r_o}} \right) - \left( {1/r} \right)}}{{4\pi {K_{ins}}}} + \frac{1}{{h\left( {4\pi {r^2}} \right)}}

Consider the thermal conductivity of aluminum at temperature T_{s} as 234W/m.K

Rate of heat transfer for the given process

\dot Q_{s - \infty } = \frac{{{T_s} - {T_\infty }}}{{{R_{eq}}}}

Where \dot Q_{s - \infty }} is the steady state heat transfer rate in-between the inner surface of the sphere and the ambient air.

Substituting \left( {\frac{{\left( {1/{r_i}} \right) - \left( {1/{r_o}} \right)}}{{4\pi {K_{Al}}}} + \frac{{\left( {1/{r_o}} \right) - \left( {1/r} \right)}}{{4\pi {K_{ins}}}} + \frac{1}{{h\left( {4\pi {r^2}} \right)}}} \right) for R_{eq} we obtain

\dot Q_{s - \infty } = \frac{{{T_s} - {T_\infty }}}{{\left( {\frac{{\left( {1/{r_i}} \right) - \left( {1/{r_o}} \right)}}{{4\pi {K_{Al}}}} + \frac{{\left( {1/{r_o}} \right) - \left( {1/r} \right)}}{{4\pi {K_{ins}}}} + \frac{1}{{h\left( {4\pi {r^2}} \right)}}} \right)}}

\begin{array}{l}\\80{\rm{ W}} = \frac{{250{\rm{ }}^\circ {\rm{C}} - 20{\rm{ }}^\circ {\rm{C}}}}{{\left( {\frac{{\left( {\frac{1}{{0.18{\rm{ m}}}}} \right) - \left( {\frac{1}{{0.21{\rm{ m}}}}} \right)}}{{4\pi \left( {234{\rm{ W/m}} \cdot {\rm{K}}} \right)}} + \frac{1}{{30{\rm{ W/}}{{\rm{m}}^2} \cdot {\rm{K}}\left( {4\pi {{\left( {0.36{\rm{ m}}} \right)}^2}} \right)}}\frac{{\left( {\frac{1}{{0.21{\rm{ m}}}}} \right) - \left( {\frac{1}{{0.36{\rm{ m}}}}} \right)}}{{4\pi {K_{ins}}}} + } \right)}}\\\\80{\rm{ W}}\left( {{\rm{0}}{\rm{0.020737 K/W}} + \frac{{{\rm{0}}{\rm{0.157892/m}}}}{{{K_{ins}}}}} \right) = 230{\rm{ K}}\\\\\frac{{{\rm{0}}{\rm{0.157892/m}}}}{{{K_{ins}}}} = \frac{{230{\rm{ K}}}}{{80{\rm{ W}}}} - {\rm{0}}{\rm{0.020737 K/W}}\\\\\frac{{{\rm{0}}{\rm{0.157892/m}}}}{{{K_{ins}}}} = {\rm{2}}{\rm{.854263 K/W}}\\\end{array}

K_{ins}=\frac {0.157892}{2.854263}=0.055318 W/m.K

7 0
3 years ago
Carbon dioxide (CO2) expands isothermally at steady state with no irreversibilities through a turbine from 10 bar, 500 K to 2 ba
xenn [34]

Answer:

The answer to the question above is = 152.02 KJ/Kg

Explanation:

Given:

Temperature at first state, (T1)= 500k

Temperature at second state, (T2)= 500k

The above explains an isothermal process as a thermodynamic process,in which the temperature of the system remains constant

Pressure at first state, (p1) = 10 bar

Pressure at second state, (p2) = 2 bar

The heat transfer=

Qrev/m= T x [s(T2) - s(T1) - R ㏑ (p2 ÷ p1)]

Isothermal means the temperature does not change, while Expansion means the volume has increased.

For the internal isothermal process:

Qrev/m=  T x [- R ㏑ (p2 ÷ p1)]

= 500 x  - (8.314 ÷ 44.01) x In (2 ÷ 10) = 152.02 KJ/Kg

Energy equation at turbine is for the internally reversible isothermal process is:

Q-w = m [( (V2²- V1²) ÷ 2) + g ( Z2 - Z1)]

where w= the most efficient work possible in  J

Neglecting the effect of both potential and kinetic energy

(w/ m) = Qrev/ m

= 152.02 KJ/Kg

4 0
3 years ago
Consider a steam turbine, with inflow at 500oC and 7.9 MPa. The machine has a total-to-static efficiency ofηts=0.91, and the pre
sergiy2304 [10]

Answer: \dot m_{in} = 23.942 \frac{kg}{s}, \dot H_{out} = 39632.62 kW

Explanation:

Since there is no information related to volume flow to and from turbine, let is assume that volume flow at inlet equals to \dot V = 1 \frac{m^{3}}{s}. Turbine is a steady-flow system modelled by using Principle of Mass Conservation and First Law of Thermodynamics:

Principle of Mass Conservation

\dot m_{in} - \dot m_{out} = 0

First Law of Thermodynamics

- \dot W_{out} + \eta\cdot (\dot m_{in} \dot h_{in} - \dot m_{out} \dot h_{out}) = 0

This 2 x 2 System can be reduced into one equation as follows:

-\dot W_{out} + \eta \cdot \dot m \cdot ( h_{in}- h_{out})=0

The water goes to the turbine as Superheated steam and goes out as saturated vapor or a liquid-vapor mix. Specific volume and specific enthalpy at inflow are required to determine specific enthalpy at outflow and mass flow rate, respectively. Property tables are a practical form to get information:

Inflow (Superheated Steam)

\nu_{in} = 0.041767 \frac{m^{3}}{kg} \\h_{in} = 3399.5 \frac{kJ}{kg}

The mass flow rate can be calculated by using this expression:

\dot m_{in} =\frac{\dot V_{in}}{\nu_{in}}

\dot m_{in} = 23.942 \frac{kg}{s}

Afterwards, the specific enthalpy at outflow is determined by isolating it from energy balance:

h_{out} =h_{in}-\frac{\dot W_{out}}{\eta \cdot \dot m}

h_{out} = 1655.36 \frac{kJ}{kg}

The enthalpy rate at outflow is:

\dot H_{out} = \dot m \cdot h_{out}

\dot H_{out} = 39632.62 kW

3 0
3 years ago
How could increasing the budget for testing have prevented the problem experienced by the mars orbiter?
vlada-n [284]

Answer:

this might help

Explanation:

https://science.ksc.nasa.gov/mars/msp98/misc/MCO_MIB_Report.pdf

5 0
2 years ago
3) What kind of bridges direct their load along it's curve and into the
AlladinOne [14]

Explanation:

suspension is the answer

8 0
3 years ago
Other questions:
  • Identify each statement as referring to a series or parallel circuit.
    15·1 answer
  • A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions wit
    14·1 answer
  • Consider a 0.15-mm-diameter air bubble in a liquid. Determine the pressure difference between the inside and outside of the air
    10·1 answer
  • Which section of business plan should be the bulk of the plan
    7·1 answer
  • A 1/20 scale model of a wing is used to determine forces on the actual airplane. the 1/20 scale refers to the:_____
    10·2 answers
  • que sabemos de la revolución industrial y como ese proceso impulso el uso de los controles eléctricos en las industrias
    6·1 answer
  • A) If a given directional antenna can receive 15 times the power of an isotropic antenna, what is
    11·1 answer
  • Task Three :Write a C++ program to read temperature
    15·1 answer
  • 3. If nothing can ever be at absolute zero, why does the concept exist?
    10·1 answer
  • Which level of acceleration should you use when accelerating on a short highway entry ramp?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!