Simple C++ program using "if" statements.
Not what you're looking for?
A control system applies a force to an actuator proportional to the voltage of a signal coming into the control system. It is desired not to allow actuator to quiver back and forth in the presence of small corrections near zero-force point. More force is required for the actuator to move to the left (negative direction of motion) then is required for the motion to the right (positive direction of motion). Assume that the transfer function (the relationship between the voltage and the movement) of the actuator is:
? Voltage less the -0.2 volt: actuator moves 1 cm/volt in the negative direction
? Absolute value of voltage less the or equal to 0.2 volts, no motion
? Voltage greater than 0.2 volts, actuator moves 2 cm/volt in the positive direction
Write the function to compute total motion for any single signal input. Write the main function that repeatedly calls the motion calculation function using an input signal stream such as this:-10.v, -8.0v,-0.21v,-0.20v,-0.05v,1.5v,0.00v,4.5v. The main function should also take as user input an initial position of the actuator and should output a final position resulting from applying the signals of the given control system. For one test simulate the effect of the given voltages for an initial position of 1.5 cm to find the final position of the actuator.
Purchase this Solution
Solution Summary
This solution shows how to use nested "if" statements in C++. The example program is a voltage transfer function.
Solution Preview
This problem is broken down into a C++ function that calculates the
appropriate force based on the supplied voltage and a main ...
Purchase this Solution
Free BrainMass Quizzes
Basic Networking Questions
This quiz consists of some basic networking questions.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
C# variables and classes
This quiz contains questions about C# classes and variables.
Javscript Basics
Quiz on basics of javascript programming language.