Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop C code that convert Celsius to Fahrenheit temperature (local variable vesselTemp_F). This data will represent a temperature sensor input with a specific operating range.

Develop C code that convert Celsius to Fahrenheit temperature (local variable vesselTemp_F). This data will represent a temperature sensor input with a specific operating range. The program will have two pairs of data points See Appendix A, which provide corresponding pressure for a given Fahrenheit temperature. One data pair is the upper and lower degree Fahrenheit and the other pair is the upper and lower relative saturated pressure for the corresponding temperature. Compute the saturated pressure from the temperature input.

When sensors are saturated or at their limits of operations, the sensor may respond (signal) with unknown values outside its working range. This could cause erratic or catastrophic conditions for control systems. This is solved by placing limiter testing at saturation points of sensors. Saturation testing imposes upper and lower bounds on a signal. When the input signal is within the range specified by lower limit and upper limit parameters, the input signal passes through unchanged. When the input signal is outside these bounds, the signal is clipped to the upper or lower bound values. The sensor range and set points are defined in the table in Appendix A.

Temperature will be provided by using a random number generator. Use the modulus operator to place your random number closer to the range vesselTemp_C (12-23C). This temperature represents an electrical sensor input converted to engineering units. Google or Bing C rand() examples to understand how the random number generator function works.[DVM1]

Use limiting logic to make sure the converted Celsius is within the data range of 60 and 70 F. [DVM2] This means if data is outside the range of your algorithm, in this assignment means that the calculated vesselTemp_F is greater than 70 or less than 60, you need to limit the data. To limit, would be to clamp the values to the known values: 60 or 70 or anything in between. The algorithm and data work only when the vesselTemp_F is between 60 and 70.

Not every Temperature input will have a direct corresponding pressure. For example, if vesselTemp_C=18, which is neither of the known Fahrenheit limits. Linear interpolation is a way to fill in the holes'' in tables. Linear Interpolation is a method of constructing new data points within the range of a discrete set of known data points. Linear interpolation is quick and easy, but at times not very precise, to increase precision is to increase the number of data points with in the know set of data points.

In this assignment, you only have two data points, which represent the upper and lower data range.

Interpolation example with Appendix A:

vesselTemp_C = 18

image text in transcribed

Result of hand test is psi~= 0.3033 psi

[DVM1]The equation is to find values between 60-70F, your data is in C as random numbers. Your range of data in C is 23-12=11, what modulus will give you a range of 0-11?, then add the new data C to the offset of C lower (12). Now your data is always within 12 and 23C.

[DVM2]This is the requirements of the logic, your interpolation algorithm deals with data 60 to 70F. Your logic is to deal with data outside that range.

Appendix A

Temperature - t - (oF)

Pressure - pv - (psia, lb/in2)

60

0.2563

70

0.3631

fahrenhiet - f _lower psi = psi_lower + (psi_upper psi_lower) ( f _upper - f _lower 64.4 - 60 psi = 0.2563+1 **( 70-60 (0.3631 0.2563) fahrenhiet - f _lower psi = psi_lower + (psi_upper psi_lower) ( f _upper - f _lower 64.4 - 60 psi = 0.2563+1 **( 70-60 (0.3631 0.2563)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions