I understand that some numbers cannot be represented in floating point but I don't understand why the way we obtain those numbers matters. In python, if I type print(0.1) or print(1/10) I get 0.1 but if I type print(0.3-0.2) I get 0.09999999... Why the difference?
If it makes you feel any better, Biden is very strongly anti-war. He was a critic of our ongoing wars in the Middle East and the last thing he wants is to get involved in another drawn-out conflict.
Yes, that is what I've been doing. I do have a heck of a lot of global variables which did seem awkward to me. I'll try the dictionary strategy and let you know how it goes.
I'm not using git. In fact, although I've heard it mentioned over and over, I'm not really quite sure what it is. I suppose my next step should be to look into it. Dropbox is where I've been keeping all my important files for many years. Guess I'll have to make a change.
Hello again @pbuk :) . I seem to be having the same problem even in the command prompt (except for the fact that running the master file from the command prompt did not stop other python files from working in vscode). Below are pictures of what's going on. I called my make_worksheet function to...
Hi @Mark44. Thanks for the help. Unfortunately I'm still seeing the same behavior. It ran a couple times then stopped. I noticed something which might be a clue. I have a "make_worksheet" function which should generate as many versions of a worksheet as I want. After a couple run throughs with...
I have been using Visual Studio Code for a couple months now and it has been fine. When I want to run some code, there is usually a little green triangle button in the top right corner that I can click on. A few days ago, that triangle turned white only for Python files (it is still green for...
I did see that stackexchange post but when I tried copying and pasting the code, it didn't work. I downloaded TeXMaker and tried following your instructions but I'm still getting the same error. Here's what I did...
1. I entered the PythonTeX user command.
2. I chose PDFLaTeX from the...
Thanks very much. This seems to
Thank you very much. I feel like I'm getting closer to solving this problem but I still have some questions. You said you used the steps pdflatex test.tex, pythontex test.tex, pdflatex test.tex. I'm not sure what you meant by that. Do you mean you converted the...
Thank you for your response. This might be something for me to look into later, but right now it is beyond my meager skills. The immediate problem I'm trying to solve is to make those double question marks going away so I can define some variables and have latex render them correctly.
I'm using Visual Studio Code as my text editor. My ultimate goal is to use PythonTex in a Latex file so that I can generate multiple versions of the same worksheet for my class. As a test, I defined a variable myvar = "hi" but I can't get it to render correctly in the pdf when I use \py{myvar}...
If we were to use three-dimensional spheres to represent sets, could a 3D Venn diagram be constructed that could not be drawn as a normal 2D Venn diagram without changing the relationships between the sets?
I am trying to learn how to code, reading the info on w3schools, doing Google searches, etc. I recently ran into a small problem with MySQL and wanted to find a good website where I could post the issue I was having and see if anyone had any suggestions. I love PhysicsForums but I'm not sure...
I got it from Google images after typing something like "four fundamental forces" or "force carriers". I don't remember exactly. It seemed to outline some useful information in a concise way. Other than the words "acts between objects with mass" and "all particles with mass", is the information...
Einstein's theory describes gravity as a curvature of spacetime. As such, everything is affected by it. This includes light, which has no mass, as was made clear for the first time during the famous 1919 solar eclipse. In the standard model, the cause of gravity is supposed to be gravitons...
My first question is actually, what happens when any two objects get near each other? This question is often phrased as "Why can't you really touch anything?" or "Why can't you walk through walls?" I have heard two answers: 1. the repulsion between electrons 2. the Pauli exclusion principle...
I guess the jump from two things producing the same field to those two things reacting in the same way to a nearby object is not so obvious to me. After all, the forces are supposed to act on charges, not fields. To make a weird analogy - if two people happen to draw the same waves in a...
@alan123hk @Charles Link
I was thinking about this thread again and one nagging thought occurred to me. I understand (hopefully) the equivalent current as the current that would produce the same magnetic field as is seen around the magnet and is in reality produced by the spin of the...
Thanks, @alan123hk ! This seems to be EXACTLY what I was looking for!
A couple of quick questions to make sure I'm interpreting everything correctly...
1. The black arrows representing the equivalent magnetization current would be the v in the F = qv x B formula (and, of course, the red arrows...
In the picture below, the direction of the magnetic field lines can be determined by using the right-hand rule with the thumb pointing in the direction of the current.
If we use the right hand rule in the picture below, thinking of the yellow arrow as the current, we would not get the correct...
When I say "electric field line", I mean an imaginary line which can be drawn such that any charged particle will be accelerated in a direction parallel to the line.
When I say "magnetic field line", I mean an imaginary line which can be drawn such that any moving charged particle will be...
A slightly off-topic question - are the following statements true?
1. The ultimate source of any electric field is a charged particle.
2. The ultimate source of any magnetic field is either the movement of a charged particle or the intrinsic spin of a charged particle.
Thank you for your response. I am looking for a more intuitive answer based on the Lorentz force (if one exists). For example, we know that a positively charged particle will create an electric field pointing a way from it and a negatively charged particle will create an electric field pointing...
I'm trying to understand how the Lorentz force can explain why magnets attract and repel. The explanations that I have found have mostly involved the magnets moving in a way that decreases the forces between them ( ) but I have not been able to find any intuitive explanation involving the...
Okay, so we're extending our idea of what we call a "force" to include not only something that results in acceleration but also something that results in particles decaying into other particles. The reason for this extension is that both acceleration and decay are the result of carrier particles...
Hi everyone,
The four fundamental forces are gravity (I understand that G.R. does not look upon gravity as a force but I'm not worried about that here), the Lorentz force, the weak force, and the strong force. I'm familiar with the inverse square law for gravitation and the Lorentz force...
Right. Okay, I think I'm seeing where my thinking went off the rails. If we have light of many different frequencies then the luminosity function is sort of a filter which picks out the frequencies we can see and attaches different weights to them. I was confused about the need for the...
Okay, so I get that the units are not the same. There's still something that's bothering me, though. If the light is of only one frequency and the radiant intensity is within the limits of what the eye can handle, wouldn't the "weight" that we multiply the radiant intensity by to get the...
I'm trying to wrap my head around the definition of a candela:
"The candela is the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540×10^12 hertz and that has a radiant intensity in that direction of 1/683 watt per steradian."
I'm aware...
In something I was reading, I saw the "stiffness" of a material measured in Newtons per meter which makes sense to me because something that is stiff would require more force to change its length. In other words, "Stiffness is the number of Newtons required to condense a material by one meter."...