e computing task is to write a PYTHON program to read in data from the supplied file for voltage ( V (t)) and current ( I (t)) and plot, via pyplot, the log power, being p (t) = log (V (t) I (t)) ere log is natural log to base e. ur program should: • Prompt for the filename to be read. • Read in the required data from sample.txt file and display p (t) over the supplied range of t with suitable titles and axis labels. • You must use a function of the form Logpower(voltage, current) to form the p (t), and a main() program.
sample.txt file :
0.277098834317 , 0.985278943914
0.30469825847 , 1.07113274478
0.335349108089 , 1.04643731403
0.313771100286 , 1.06608032983
0.291255984459 , 1.00377316356
0.294997556075 , 1.00510748569
0.30551242839 , 1.04908293211
0.312278701405 , 1.0005416134
0.229034833336 , 1.0765010996
0.238560972323 , 1.04040848232
0.217499589016 , 1.17299765768
0.316159908608 , 1.16858917543
0.311929396532 , 1.13799423115
0.421567449877 , 1.16485288772
0.305392530731 , 1.07273915851
0.342611226456 , 0.988023951248
0.310465976618 , 1.03107535278
0.290874789102 , 1.02786385723
0.365324167651 , 0.932011471
0.324532611761 , 0.834645132333
0.307651402732 , 1.01830758749
0.325937725289 , 1.09399854694
0.323733397397 , 0.978775845607
0.31329702072 , 1.06333299307
0.296978896122 , 1.22846432128
0.345083122488 , 0.950486344926
0.257474591167 , 1.18137084707
0.30852261837 , 1.1886059616
0.287400310146 , 1.13483382864
0.492626799434 , 1.10371521908
0.36692925721 , 1.02828700147
0.4290602186 , 1.2799895449
0.427877860063 , 1.31236316296
0.416315039305 , 1.26466307297
0.400779235467 , 0.911465817099
0.361951642914 , 1.18820604194
0.369262902604 , 1.18854720106
0.329855648429 , 1.11707596056
0.335422485993 , 0.919756726808
0.32075775795 , 1.05507887953
0.431021368611 , 0.936912134833
0.469732466679 , 1.10985100581
0.423367628748 , 1.18264790043
0.260444789333 , 1.24694304916
0.338667358408 , 1.1442729916
0.383376849567 , 1.03042110006
0.4023367928 , 1.22809612846
0.42409537463 , 1.01245077722
0.387341870228 , 1.10189899521
0.404240964506 , 1.34423526975
0.41617915563 , 0.980473330052
0.353648636264 , 1.14944523804
0.503423761968 , 1.24030784603
0.489872775186 , 1.0650351625
0.464952628195 , 1.25595069622
0.442556552645 , 0.989576186683
0.41009693239 , 1.01980632097
0.238694306153 , 1.00171872953
0.338464000985 , 1.28837606468
0.443151438119 , 1.09571599373
0.435067968067 , 1.14589838437
0.383621524637 , 1.09024450164
0.420635182822 , 1.05562269045


Step by step
Solved in 4 steps with 2 images









