NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Hello again,
The goal of the exercise is to use basic numerical tools for data analysis with python. All the input and output files are needed. Please upload an example of the output of your script in a separate file (txt or odt), in case my version of python could not run your script.
All the action must be done with a small python script.
• 1 - Manipulating numerical data, read and write data to a file,
1. Use a python program to read the joined file 'data.txt' as two numpy list named posX and posY.
2. Print posX, print posY
3. Find and print the maximum of posY, find the index of the maximum value of posY.
4. Sort posY by ascending value, and write the sorted values in a file.
• 2 - Plotting
1. Plot posY as a function of posX, add a legend, units, title, axis label.... nice color, or mark...
2. Plot on the same graph the sorted values of posY as a function of Posx, with a different color. Add the name of the new curve in the legend.
3. Plot both curves on two separate graphs using subplots command.
• 3 - Scientific computing
1. Fit posY as a function of posX with the equation posY= anp.sin(bposX+c)+d where a, b, c, d are parameters to determine thanks to a curve fitting. To have an idea of the initial guess for some of the parameters: find the average value and the median value of Posy, the max, and min of Posy, and be lucky. Print the parameters.
2. Build the list model_posY based on the test_func and the fitted parameters for posX. Calculate the error between posY and its model at each point: posY-model_posY
3. Calculate the average of the error
4. Calculate the standard deviation on the error.
5. plot posY and its model on the same graph
6. Make the derivation (finite differences) of the lists posy and its model model_posy. Compare with the exact solution obtained from the derivation of the equation in test_func. Try different methods (at least centered derivative, eventually forward, backward) comments differences and the error on each method. Make a zoom on the one period to see differences.
Have a look at these sites to help you to build a python function 'centered_derivatied': def centered_derivative(y,h):...
https://pythonnumericalmethods.berkeley.edu/notebooks/chapter20.02-Finite-Difference-Approximating-Derivatives.html
https://numpy.org/doc/stable/reference/generated/numpy.diff.html

8. Make the integration of the posy and its model. Try different methods (Trapezoidal, Simpson). Print the value of each integration. Comment the differences and the errors.
9. Plot sin(x) + sin((10.0 / 3.0) * x) for x in [2, 7]. Find the minimums amd the roots of the equation on the same interval.

Please find attached the data that you need to work on.

These are all the exercises needed. Please tell me if you believe you can solve them all. If yes, how much time do you think you need to finish the task.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.