Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
184_notes:examples:week3_plotting_potential [2017/08/28 16:55] – dmcpadden | 184_notes:examples:week3_plotting_potential [2017/08/28 17:06] – dmcpadden | ||
---|---|---|---|
Line 2: | Line 2: | ||
To make the 3D plots in Wolfram Alpha, first you need to create a free notebook with the Wolfram Cloud just like we did before. [[https:// | To make the 3D plots in Wolfram Alpha, first you need to create a free notebook with the Wolfram Cloud just like we did before. [[https:// | ||
- | This is where we will enter in the code that we want. At the top of the notebook, you will see a faint grey line (this is kind of like a cursor). | + | This is where we will enter in the code that we want. At the top of the notebook, you will see a faint grey line (this is kind of like a cursor). |
+ | ==== 3D Contour Plot ==== | ||
+ | To make the 3D plot, copy and paste the following code: | ||
ContourPlot3D[V == 5/((x - 2)^2 + y^2)^(1/2) - 5/((x - 8)^2 + y^2)^(1/2), {x, 0, 10}, {y, -5, 5}, {V, -10, 10}] | ContourPlot3D[V == 5/((x - 2)^2 + y^2)^(1/2) - 5/((x - 8)^2 + y^2)^(1/2), {x, 0, 10}, {y, -5, 5}, {V, -10, 10}] | ||
+ | |||
+ | Then press " | ||
+ | |||
+ | Try to answer the following questions, based on what you read in the notes and the 3D plot: | ||
+ | *What does the ((x - 2)^2 + y^2)^(1/2) and the ((x - 8)^2 + y^2)^(1/2) pieces of the code represent? | ||
+ | *What do the {x, | ||
+ | *Where are the charges located? How do you know that there are two charges? Can you change where the charges is located (i.e., move one of the charge to x=2, y=3)? | ||
+ | *Could you add a third charge to this plot? | ||
+ | *How do you know which charge is positive? Can you change the code to be all negative or all positive instead? | ||
+ | *What would happen if you increase the amount of charge on one of the charges? What changes about the graph? | ||
+ | |||
+ | ==== 2D Equipotential Plot ==== | ||
+ | |||
+ | In the next line (click below the graph or push the down button until the faint grey line appears again), copy and paste the following code to make the 2D equipotential lines: | ||
ContourPlot[5/ | ContourPlot[5/ | ||
+ | |||
+ | Then press " | ||
+ | |||
+ | Try to answer the following questions, based on what you read in the notes and the 3D plot: | ||
+ | *What is different about this line of code compared to the code 3D Contour Plot? | ||
+ | *Where are the charge located? How can you tell in the graph? | ||
+ | *Can you change where the charges are located (i.e., move the charge to x=2, y=3)? | ||
+ | *Can you add a third charge to the plot? What changes about the graph with the third charge? | ||
+ | *How do you know which charges are positive? Can you change the code to make them negative instead? | ||
+ | *What does the " |