-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove the use of 'p' and 'v' #3486
Comments
Looking into this more I realize it should be done through a more fundamental change of how we handle units. There is simply to may variables that are very close to each other in meaning. We could implement a hardcoded solution, but this should probably wait until we finish with our analysis of space, symbol and unit. |
I'm not sure I understand your point @ManvendraJani. The units for p and p(t) are the same. The units for v and v(t) are the same. The analysis of units won't change anything. Eventually we want to change how we handle functions, so that p(t) is more meaningful than it is right now. For the moment though, I think it is still worthwhile to remove instances of p and v, since in both cases where the symbols are used, the meaning is p(t) and v(t). |
The issue is that although the units are the same the meaning is different. Currently, v (speed) represents the magnitude of the velocity while v(t) (linear velocity) represents the velocity in a given direction. We are trying to represent both using the same units, and currently we cant do that. This falls into a similar vein as the discussion in #3432. |
Yes, we can represent them with the same units. The units for a vector are the units for each component of the vector. (This is a convention that we could probably more clearly communicate in the documentation.) No matter the outcome of our discussion on units, speed will have units of m/s and the components of the velocity vector will have units of m/s. I think we can proceed with fixing p(t) and v(t) without worrying about units. In the future we will improve Projectile even further, but the move to p(t) and v(t) is a move in the right direction, even if the implementation isn't as elegant as it will eventually be. 😄 |
I am sorry I was using the wrong term, I meant they have the same symbol. So, besides making much larger design changes the only solution is to mark all magnitudes of velocity(speed) as linear velocity and then manually change wherever we use the other characteristics of speed (like the Noun Phrase and definition) to match what we want to say. I was saying that we should wait until after the discussion on space, symbol and units as we would not want to make a big change right before we might completely change how we use them. |
@ManvendraJani can you tell me the concept that we attach to v and the concept that we attach to v(t). I'm not convinced that whatever distinction is being made isn't artificial. I'm heading to a meeting right now, so I don't have time to look at the SRS. 😄 |
Can you point out the code that disallows that? It is definitely "in bad taste" to use the same symbol for two different things however, I'm not sure it is legitimate to not allow it at all. [Same UID is a different thing, that is definitely not allowed.] My guess is that the doubling of concepts in the above chart might be a hack because older Drasil simply couldn't do certain things. What it says is not wrong, but also it's not clear that that's what we actually want to use in practice. |
@ManvendraJani I've looked at Projectile more closely and there are some inconsistencies in the spec. For instance, speed is a poor name for the magnitude of the velocity vector because magnitude is always positive, but in some cases speed is negative to show that it is going in the opposite direction. The magnitude of the velocity vector can change over time, but calling it v(t) is confusing because we use v(t) for 1D velocity. The magnitude is 1D (scalar), but it is associated with a 2D vector. We could write || v(t)||, but this would likely make the document confusing. I now agree that we should wait to figure out the best way to present this information in Projectile, but we aren't so much waiting for the discussion of symbol and state. What we really need to do is think about the refined theories version of Projectile. The issues come up when we combine knowledge of vectors with knowledge of physics. We've combined them in a somewhat ad hoc way at the moment. I don't think we need a fully formal treatment, but we do need to be more rigorous. |
This change was made regarding this PR. |
|
So you are somewhat misinterpreting what's going on. It's not that Drasil disallows duplication of symbols, it is that in the context of an SRS about a single piece of software, then symbols should be unique. It is a kind of "local uniqueness" but not global uniqueness. |
Surprisingly complicated! Assuming that Seeing So, now the big question is: when is Some questions that might help us (or at least me) understand how to proceed:
(The issue of how and when [EDIT: As already mentioned elsewhere, Drasil knows little about functions, but I think this is a good segue to teaching Drasil about functions] |
I think part of the way out of our confusion is to attach type information to every symbol. We also want to avoid sloppy conventions that engineers and scientists (including me!) often use. In the refined theories version of projectile I tried to add type information to the symbols. In 1D, the type of v is a function type (t -> R). The type of v(t) is R. In the new version of projectile I also tried to remove the confusion around the magnitude of a vector versus the component of a 1D vector. That is why I explicitly added the magnitude angle representation (polar representation) of a vector as a theory. Although it is still in the table of symbols, I don't think we still have the problem of v meaning speed and v(t) meaning 1D speed. I use |v| for magnitude, and v is the function mentioned above and v(t) is the speed at time t. (Similar changes are made for position.) If we can get the new version of projectile into Drasil, I think we'll really start to see the value of Drasil. Manually creating a document with all this information consistently presented is too difficult for most humans. I think Drasil will also catch incompleteness in what I've done. Another idea that we'll need to look at with respect to the clash of symbols, I don't think we'll be able to continue with one table of unique symbols for the entire document. For instance, velocity is 1D, 2D and 3D in the document for projectile. It is natural to use the same symbol for all 3, with the symbol being bold for the 2D and 3D cases, but the three have different types. At least to this point, the document seems to naturally have groups of theories that can share the same set of symbols. |
I believe we already have this, it's just not shown in the SRS artifacts. We just call it a 'space' on the backend (I suppose we should change that...): Drasil/code/drasil-lang/lib/Language/Drasil/Chunk/DefinedQuantity.hs Lines 23 to 32 in 061f90e
I agree. I wonder what our criteria is for deciding which are relevant. Assuming all the problems we discuss are ICO-style, then we probably only want to show symbols immediately mentioned in the inputs and outputs, and those found in the data definitions and other calculation-related formulas. For libraries, we might not want a global table of symbols, or we might want to allow users to define one on their own rather, grouping whatever symbols they deem fit, until we can come up with a better criterion. |
Furthermore I think we need to further dis-entangle display and meaning. It should be okay to elide the This will force us to make it clearer when we're talking about velocity as a function of time and an instantaneous velocity at a given time. They have different types! (Same with velocities in different dimensions). We will still want to associate 'display hints' to quantities. Right now, we have 'display orders' (i.e. you WILL display things this way). And our display orders don't necessarily match the type of the associated quantity. |
As mentioned in #3189 we would like to stop using p (position) and v (speed) instead use p(t) and v(t) respectively.
these, along with other uses of p and v should be changed to be dependent on time.
The text was updated successfully, but these errors were encountered: