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
aleksley [76]
3 years ago
12

Piecewise functions are sometimes useful when the relationship between a dependent and an independent variable cannot be adequat

ely represented by a single equation. For example, the velocity of a rocket might be described by where v is the rocket velocity in m/s and t is the time in seconds. Write a program to compute v as a function of t. Generate a plot of v versus t for t = −5 s to 70 s using 100 points for t. Requirement:
Computers and Technology
1 answer:
Andru [333]3 years ago
8 0

Answer:

//Set a piecewise function v(t).

function v = vpiece(t)

//Set the condition first for t.

if ((0<=t)and(t<=8))  //Set if condition

// first equation of velocity.

   v = 10*t^2 - 5*t;

//Set the condition second for t.

elseif((8<=t)and(t<=16))  //Set elseif condition

//second equation of velocity.

v = 624 - 5*t;

//set the condition third for t.

elseif((16<=t)and (t<=26))  //Set elseif condition  

//third equation of velocity.

v = 36*t + 12*(t - 16)^2;

//Set the fourth condition for t.

elseif t>26

//fourth equation of velocity.

v = 2136*exp(-0.1*(t-26));

//Last condition.

else

//fifth equation of velocity.

v = 0;

//End of the function v.

end

//set a variable and initialize it to 0.

a=0;

//Starting the loop.

for j = -5: 0.5 : 70

//Increment the value of a by 1.

a = a + 1;

t(a) = j;

v(a) = vpiece(t(a));

//End of for loop.

end

//Plot the graph between t and v.

plot(t,v)

//Write the label for the x-axis.

xlabel('t')

//Write the label for the y-axis.

ylabel('velocity')

//Write the title of the plot.

title('Plot of velocity vs t')

Explanation:

Firstly, we set the piecewise method.

Then we set the first condition, after that we apply the condition of velocity.

Then we set the second condition, after that we apply the condition of velocity.

Then we set the third condition, after that we apply the condition of velocity.

Then we set the fourth condition, after that we apply the condition of velocity.

Then we set the last or fifth condition, after that we apply the condition of velocity.

Then we set the variable "a" to 0.

Then start the loop and increase the value by 1.

And after all, we write the title of the plot.

You might be interested in
If your computer will not turn on, What is something you can would you use to diagnose the problem?
inysia [295]
3. See if its plugged in
3 0
3 years ago
Read 2 more answers
You are designing a wireless network for a client. your client needs the network to support a data rate of at least 54 mbps. in
vitfil [10]
Um... that is hard to explain Idk
5 0
4 years ago
Read the following code: x = currentWeight print(x - 20) What value will this code calculate?
Serga [27]

D because weight print = x and -20 is the pound loss.

5 0
3 years ago
A(n) sentinel is a special value that marks the end of a sequence of items.
Anuta_ua [19.1K]

Answer:

Sentinel value

Explanation:

It is the sentinel value in computer programming which is also being termed as the flag value, rogue value, dummy data signal value or the trip value. It has its meaning in the context of the algo, and that clarifies that it is the end of the block or code basically inside a loop or in any kind of recursive algo.

7 0
3 years ago
Which two devices are paired to create a memory cell? what term is used to describe this common form of computer memory? (2 poin
elena-14-01-66 [18.8K]

A transistor and A capacitor

<h3>What are transistors and capacitors?</h3>
  • Transistors are semiconductor devices used to amplify or switch electronic signals.
  • Inductors are passive electrical devices in electrical circuits for their property of inductance.
  • While a capacitor opposes changes in voltage, an inductor opposes changes in current.

To learn more about it, refer

to https://brainly.in/question/413163

#SPJ4

6 0
2 years ago
Other questions:
  • Which of the following is NOT one of the responsibilities of the Federal Reserve?
    10·1 answer
  • I want to be a teacher some day and i know this question------------- Humans have a nose to breath , but what do fishes use to h
    6·2 answers
  • A graphic design student is putting the finishing touches on her PowerPoint presentation for her speech. She is carefully analyz
    12·1 answer
  • Jenna wants to convert a decimal number to its octal form. Which option will she use to calculate the octal number?
    8·1 answer
  • Question 4 / 5
    11·1 answer
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    9·1 answer
  • __________ is a collection of formatting options—such as a frame, a rounded shape, and a shadow—that changes a picture’s overall
    5·1 answer
  • Discuss the 21 st century competencies or skills required in the information society and 4 ways you can apply it during supporte
    6·1 answer
  • 7. In order to check your following distance, use a fixed object and count seconds.
    5·2 answers
  • Will Give Brainiest to the first correct answer!!!!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!