Skip to content
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

Re-use of phrases in PDController quantities. #2397

Closed
JacquesCarette opened this issue May 8, 2021 · 9 comments
Closed

Re-use of phrases in PDController quantities. #2397

JacquesCarette opened this issue May 8, 2021 · 9 comments
Assignees

Comments

@JacquesCarette
Copy link
Owner

Take for example

qdCtrlVarTD
  = vc "qdCtrlVarTD" (nounPhraseSent (S "Control Variable in the time domain"))
      symCT
      Real

The phrase is of the form "X in the Y", for X and Y both concepts that pre-exist. So that's how it should be described, i.e. this should be essentially

qdCtrlVarTD = vc "qdCtrlVarTD" (controlVar `inThe` timeDomain) symCT Real

Note that I am not sure of the names controlVar or timeDomain (something like them should exist, or be created). Similarly, there might already be a inThe combinator that may or may not do the right thing. This needs to be investigated and dealt with first.

Also, I think there's a combinator that defaults to Real so this could be shortened further.

@Awurama-N
Copy link
Contributor

Awurama-N commented May 10, 2021

inThe combinator does indeed exist and is used (for example) in the following situation:

oIDQConstruct x = cic "outputInputDerivVals" (foldlSentCol [
  titleize output_, S "the", plural inValue `sAnd`
  S "derived", plural value  `inThe` S "following list"] +:+.
  foldlList Comma List x) "Output-Input-Derived-Values" funcReqDom

doesn't seem to work in the way needed for these phrases?

@JacquesCarette
Copy link
Owner Author

Right, this was discussed at the meeting today, and also arose in things that @Ant13731 was doing. The "problem" is that some of the combinators are for sentences (like inThe), while we'd also want a variant for concepts.

I think that @Ant13731 is working on changing drasil-utils in this direction. Once that's done, this can be changed.

@Awurama-N
Copy link
Contributor

@JacquesCarette I'm going to break the question into bits. So firstly:
How can I know what these "nounPhraseSent" strings should look like on either side of the combinator?

qdSetPointFD = vc "qdSetPointFD" (nounPhraseSent (S "Set-Point" `inThe` S "frequency domain")) symYrS Real

I was originally thinking frequency domain might be ccFrequencyDomain, but that still raises warnings.

@JacquesCarette
Copy link
Owner Author

nounPhraseSent is a function that creates a noun-phrase from a Sentence. [It's actually a bit of a hack, things should go in that direction!].

What would be optimal would be if there were concepts for "Set-Point" and "frequency domain", so that the phrase used to describe this new quantity could be derived from these.

ccFrequencyDomain is likely a ConceptChunk (from its name). So you'd want to use phrase ccFrequencyDomain where currently S "frequency domain" is used.

@Awurama-N
Copy link
Contributor

@JacquesCarette hmm okay, so should it look more like this then?

qdSetPointFD = vc "qdSetPointFD" ( setPoint `inThe` phrase ccFrequencyDomain) symYrS Real

@Ant13731
Copy link
Collaborator

Heyo @Awurama-N, I added a new inThe' function that should make this issue a little easier. If both setPoint and ccFrequencyDomain are a part of the NamedIdea class, then they should work well like this (so that you don't need to use a phrase function):

qdSetPointFD = vc "qdSetPointFD" (setPoint `inThe'` ccFrequencyDomain) symYrS Real

Check out this section of the Haddock docs
I hope this helps!

@Awurama-N
Copy link
Contributor

Hi
Yes it works now
Thank you!!
@Ant13731

@Awurama-N
Copy link
Contributor

@JacquesCarette for proportional control in

qdPropControlFD  = vc "qdPropControlFD"      (nounPhraseSent (S "Proportional control in the frequency domain"))      symPS   
   Real

i initially thought it would become

qdPropControlFD = vc "qdPropControlFD" (proportionalCI `inThe'` ccFrequencyDomain) symPS Real

but after checking the logs i realised that is just "proportional in the frequency domain" and not proportional control
I looked through PDController.Concepts.hs but it's not defined there or anywhere else in the PDController example.
would you like me to add that along with derivative control to concepts.hs before i proceed?

@JacquesCarette
Copy link
Owner Author

Thanks @Ant13731 for jumping in and helping.

Yes, please add new concepts for 'proportional control' and 'derivative control'. That is exactly the right fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants