Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
183_notes:vpython_resources [2015/05/28 13:27] – [PhysUtil] caballero | 183_notes:vpython_resources [2022/11/14 15:52] (current) – valen176 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | |||
+ | In class, you will make use of [[https:// | ||
- | In class, you will make use of [[http:// | ||
===== VPython ===== | ===== VPython ===== | ||
- | VPython | + | The class uses Glowscript and by default |
* create visual objects in 3 dimensions, | * create visual objects in 3 dimensions, | ||
Line 10: | Line 11: | ||
* move the visualization around with mouse interactions | * move the visualization around with mouse interactions | ||
- | Extensive documentation for VPython | + | All of this allows us to create computational models that are modeling real-world physical phenomenon that can help you gain an understanding and insight into physics concepts that you will interact within this class. |
- | ===== PhysUtil | + | |
+ | |||
+ | |||
+ | Below is a list of errors or unexpected behaviors that you might experience and how you might go about resolving them. By no means is this comprehensive and we definitely encourage you to research the internet to find solutions. You can copy and paste code from other places you just have to understand why it is doing what it is doing. | ||
+ | |||
+ | ===== Python Troubleshooting | ||
+ | * Syntax errors – A syntax error occurs when python is unable to interpret a line of code. This usually occurs because of a simple typo, misspelling, | ||
+ | * Indentation errors – This is caused by an inconsistency in the indentation of the while loop. To fix this highlight the while loop, click “Format” (on the top bar of the laptop), click “dedent region”, then use tab to re indent everything that was indented to start. | ||
+ | * Float Error: scalar vs. vector – when coding using both scalar and vector values, keep in mind that you cannot multiply, divided, or put a vector to the power of a number without first taking the magnitude of the vector (to make the vector a scalar value). | ||
+ | * Name Error – This error occurs when you are trying to call a variable that has not already been defined above. To fix this, the line that defines the variable must be moved above the equation that the variable is being used in. This also occurs if the defined variable is misspelled. | ||
+ | * Type Error – This error is much like a float error. | ||
+ | * Spazzing Graph – When putting in the first line of code it needs to be placed under the # | ||
+ | * Magnitude vs. Dot product – to find the size or absolute value of a vector, take the magnitude of that vector; this yields a scalar quantity with no directional information and is never negative. | ||
- | PhysUtil is a module for VPython that makes it simpler to create highly visual simulations. With very little code, PhysUtil lets you: | ||
- | * generate motion maps, {{: | ||
- | * plot graphs, {{: | ||
- | * make timers, and | ||
- | * import CSV data | ||
- | Extensive documentation for PhysUtil is [[https:// |