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
NeX [460]
4 years ago
8

In this this problem you will be using for loops to take a matrix of random number and create a new matrix that is the same as t

he random matrix, but with zeros on the diagonal. a) Create matrix m that is a 10x10 matrix of random whole numbers from 1 to 20. You will have to manipulate the random number generator function to modify the interval and get only whole numbers. b) Create a for loop that runs for index i equal to the index for every row in the matrix. Next, create a nested for loop that runs for index j equal to the index for every column in the matrix. This is very similar to the Your Turn - Extra slide of Lecture 13. c) Now, we want to use our for loops to create a new niatrix, n, that is equal to matrix m, but with zeros on the diagonal. You should use an if/else statement to create this new matrix. If the location is on the diagonal (i=j), then the value of matrix n at the location will be zero. Otherwise, the value of matrix n equals the value of matrix m at each location
Engineering
1 answer:
motikmotik4 years ago
5 0

Answer:

import numpy as np

# creating matrix of order 10*10 with random numbers between 1 and 20

m = np.random.randint(1,20, size=(10,10))

# create new matrix which reads matrix m and produces zero along the diagonal

n = np.random.randint(1,20, size=(10,10)) # create new matrix, n

for i in range(0,10): # loop through row of matrix

 for j in range(0,10): # loop through column of the matrix

   if i==j: # check for the diagonal element

     n[i][j] = 0 # asign diagonal value to zero

   else:

     n[i][j] = m[i][j] # assign the value of matrix m to n

# displaying m and n matrix in the given format using disp function

from io import StringIO

buf = StringIO()

np.disp(m,device=buf)

m = buf.getvalue()

m = m[1:-1] #removing the extra [ and ]from beginning and end

print("m = ")

print(m.replace(" [","").replace('[',"").replace(']',""))

buf = StringIO()

np.disp(n,device=buf)

n = buf.getvalue()

n = n[1:-1] #removing the extra [ and ]from beginning and end

print("n = ")

print(n.replace(" [","").replace('[',"").replace(']',""))

Explanation:

You might be interested in
Compute the fundamental natural frequency of the transverse vibration of a uniform beam of rectanqular cross section, with one e
marshall27 [118]

Answer:

The natural angular frequency of the rod is 53.56 rad/sec

Explanation:

Since the beam is free at one end and fixed at the other hence the beam is a cantilevered beam as shown in the attached figure

We know that when a unit force is placed at the end of a cantilever the displacement of the free end is given by

\Delta x=\frac{PL^3}{3EI}

Hence we can write

P=\frac{3EI\cdot \Delta x}{L^3}

Comparing with the standard spring equation F=kx we find the cantilever analogous to spring with k=\frac{3EI}{L^3}

Now the angular frequency of a spring is given by

\omega =\sqrt{\frac{k}{m}}

where

'm' is the mass of the load

Thus applying values we get

\omega _{beam}=\sqrt{\frac{\frac{3EI}{L^{3}}}{Area\times density}}

\omega _{beam}=\sqrt{\frac{\frac{3\times 20.5\times 10^{10}\times \frac{0.1\times 0.3^3}{12}}{5.9^{3}}}{0.3\times 0.1 \times 7830}}=53.56rad/sec

8 0
3 years ago
Read 2 more answers
a cubical box 20-cm on a side is contructed from 1.2 cm thick concrete panels. A 100-W light bulb is sealed inside the box. What
Flura [38]

Answer:

Temperature on the inside ofthe box

Explanation:

The power of the light bulb is the rate of heat conduction of the bulb, dq/dt = 100 W

The thickness of the wall, L = 1.2 cm = 0.012m

Length of the cube's side, x = 20cm = 0.2 m

The area of the cubical box, A = 6x²

A = 6 * 0.2² = 6 * 0.04

A = 0.24 m²

Temperature of the surrounding, T_0 = 20^0 C = 273 + 20 = 293 K

Temperature of the inside of the box, T_{in} = ?

Coefficient of thermal conductivity, k = 0.8 W/m-K

The formula for the rate of heat conduction is given by:

dq/dt = \frac{kA(T_{in} - T_0)}{L} \\\\100 = \frac{0.8*0.24(T_{in} - 293)}{0.012}\\\\T_{in} - 293 = \frac{100 * 0.012}{0.8*0.24} \\\\T_{in} - 293 = 6.25\\\\T_{in} = 293 + 6.25\\\\T_{in} = 299.25 K\\\\T_{in} = 299.25 - 273\\\\T_{in} = 26.25^0 C

5 0
4 years ago
If the same amount of force were applied to all four balls in the picture, which would experience the greatest change in motion?
nydimaria [60]
There is no image connected to this question. Next time attach something to your question to get a more successful answer.
6 0
4 years ago
Read 2 more answers
What is applied technology?
8090 [49]

Answer:

the application of scientific knowledge for practical purposes, especially in industry.

2. machinery and equipment developed from the application of scientific knowledge.

3. the branch of knowledge dealing with engineering or applied sciences.

Explanation:

6 0
3 years ago
(c) As Engineering and Computing students, you must be familiar, with the respective professional bodies, as well as, Rules of P
guajiro [1.7K]

The professional ethics for computer engineers are:

  • They will Contribute to society and to human well-being.
  • They will  Avoid harm.
  • Be honest and trustworthy.
  • They will be fair and take action that do to discriminate others.

<h3>What are the Characteristics of Code of Ethics?</h3>

The code of ethics are known to be a kind of a universal moral values, that is one that state that what a person expect of any given employee such as been trustworthy, respectful, responsible, and others.

Note that Rules of Practice, Professional Obligations and Codes of Ethics. are known to be put in place to avoid issues that may lead to conflict.

Therefore, i believe that  As Engineering and Computing students, the respective professional bodies, Rules of Practice, Professional Obligations and Codes of Ethics are good and acts as a check and balance to us.

Therefore, The professional ethics for computer engineers are:

  • They will Contribute to society and to human well-being.
  • They will  Avoid harm.
  • Be honest and trustworthy.
  • They will be fair and take action that do to discriminate others.

Learn more about Engineering rules from

brainly.com/question/17169621

#SPJ1

4 0
2 years ago
Other questions:
  • The popularity of orange juice, especially as a breakfast drink, makes it an important factor in the economy of orange-growing r
    14·1 answer
  • A mixing basin in a sewage filtration plant is stirred by a mechanical agitator with a power input/WF L T=. Other parameters de
    8·1 answer
  • 5.46 By supplying energy at an average rate of 24,000 kJ/h, a heat pump maintains the temperature of a dwelling at 20°C. If elec
    9·1 answer
  • piston-cylinder assembly contains water vapor, initially at 10 bar and 360 degC. The water undergoes a process where pv=constant
    7·1 answer
  • Hey answr this sajida Yusof
    15·2 answers
  • If the driver gear has 5 teeth and the driven gear has 10 teeth,what is the gear ratio?​
    13·2 answers
  • Which of the following identifies the beginning phase of the engineering design process?
    14·1 answer
  • 25 pts!!!
    12·1 answer
  • What was the reason alloys were used instead of metals like copper, tin, or iron?
    11·1 answer
  • 9.For a single-frequency sine wave modulating signal of 3 kHz with a carrier frequency of 36 MHz, what is the spacing between si
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!