Question

Plot exact and inexact Fahrenheit- Celsius conversion formulas A simple rule to quickly compute the Celsius temperature from the Fahrenheit degrees 2 points is to subtract 30 and then divide by 2 F -30 Compare this curve against the exact curve C (F-32) n a plot. Let F vary between-20 and 120 with 101 points. You should include both the approximate and exact formulae, and the absolute value of their difference (the error) You will need to plot the data using a black dashed line ( -- ) for the approximate formula: a black solid line for the accurate formula; and a black dotted line ) for the error (preserve this orderl) change the plot range to match the specification above (use the plt.xlim( a,b) function, where you provide a and b) add axes labels to your plot, temperature / and temperature/c . Your submission should include a plot. Make sure to inport matplotlib.pyplot as p plt.plot but not plt.show in your submission. (This assignment is based on Langtangen. Exercise 5,12) 0 Type here to search len
0 0
Add a comment Improve this question Transcribed image text
Answer #1
#If there is any problem, please tell in comments
import numpy as np
import matplotlib.pyplot as plt
F=np.linspace(-20,120,101)
Capp=(F-30)/2
Cexact=(F-32)*(5/9)
er=np.abs(Capp-Cexact)
plt.plot(F,Capp,'k--')
plt.plot(F,Cexact,'k')
plt.plot(F,er,'k:')
a=-20#change value for limits according to specification above, which you have not provided
b=120
plt.xlim(a,b)
plt.xlabel('temperature / F')
plt.ylabel('temperature / C')
#plt.show()#remove # at the start to see plot

50 40 30 20 10 0 -10 -20 -30 0 20 40 60 temperature F -20 80 100 120

Add a comment
Know the answer?
Add Answer to:
Plot exact and inexact Fahrenheit- Celsius conversion formulas A simple rule to quickly compute the Celsius...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT