Page 1 of 1

** Use Octave for this **

Posted: Thu May 12, 2022 10:01 am
by answerhappygod
** Use Octave for this **
Use Octave For This 1
Use Octave For This 1 (182.08 KiB) Viewed 26 times
Introduction In this assignment, you will learn how to use the quiver function to create a vector field. As you learned from your studies, a vector field is a vector valued function where each component is a function of the independent coordinates. Vector fields are everywhere in physics: electric fields, magnetic fields, gravitational fields, the velocities of fluids, etc. Furthermore, vector fields appear in differential equations, a class many of you will take. Objectives • Create an m-file that generates the code to create a vector field. • Introduction to using quiver. Instructions • Create an m-file with the title “last name_first_name_assignment_3.m”. • You'll need a set of x's and y's to evaluate your function. Create a set of evenly spaced x's and y's centered at the origin with a spacing of around 0.01. Don't let them get too big, too many points and your computer will slow down. • Create two new matrices x and y using meshgrid(). This will let you create a grid of x's and y's with which you can plug into a function of x and y. • The vector field has the form Ě = f(x, y)i + g(x,y)j. o Create two functions f(x,y) and g(x,y). Each has to contain both x and y. Don't make them too complicated though. You may consult your textbook and pick out a function if you want. Create the vector field using x and y from meshgrid using quiver. o You should include x and y as inputs. • Add labels to the x and y axes. The default font size is kind of small. Increase it to something that's easier to read. You'll have to play with the numbers a bit to see what works. • Your m-file should only create the graph. It should not print anything to the screen. • I encourage people to use the documentation in Octave or an external source like Octave Forge. This isn't a difficult assignment but you should attempt it on your own. Feel free to send me your m-file for feedback. .