question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manually specifying relationships between inter-model variables

See original GitHub issue

Extremely closely related to, and building on, issue #444.

Example of need 1: Specifying relationships between inter-model variables

Say I have a wing model and a tail model. Both of these models require a structure model, however the definition of the tail reference area, Svt, is different from the wing and structure models’ definitions of the reference area, S. More specifically Svt = S/2.

If I import the structure model into the tail model, I currently need to add a constraint that specifies Svt == S/2, which means I need to add a Variable declaration S = Var... that my base tail model otherwise wouldn’t care about. Otherwise I could add an Svt variable and corresponding constraint to the structure model, but it doesn’t care about Svt and is confused about what it is and why it has been burdened with another variable.

Example of need 2: Differently named variables in interacting models

The current solution to #444 is awesome, but it doesn’t discriminate between cases where variables with the same name are intended to be the same quantity and when they aren’t. I believe that the user should only be responsible for choosing unique names within the scope of a model. Consider an example where you have an aircraft with thrust T. Its engine and flight conditions submodels also has thrust variables named T. But by convention, the landing gear model uses T to mean wheel track. Obviously if thrust is equal to wheel track we have a problem, not to mention that pint will get wildly offended and throw a tantrum. If the designer is manually responsible for specifying which variables connect to each other then you put the responsibility on them to get the distinction right. You could argue the designer should use something other than T, but that is suggesting that any model curator should have perfect foresight for all future models and their variable naming conventions.

Another obvious variable name that will be wildly overloaded is W.

Very open to syntax suggestions. The only thing I can think of would replace the overloaded & (which, for the record, I do really like):

...
# parent = Model(objective, constraints)
base_tail = Model(objective, constraints)

# links = # {child_varkey: f(parent_variable)}
links = {'T': T, 'S': Svt*2, `AR`: A} 

# parent.import_model(child)
base_tail.import_model(Structure())

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
bqpdcommented, Mar 15, 2016

@pgkirsch:

Need 1 still isn’t solved, but Need 2 can be met by: m.subinplace(wing["x"], tail["y"]) or m.subinplace({wing["x"]: tail["y"], ...})

0reactions
bqpdcommented, Jun 27, 2017

Documented (and heavily built upon) by the performance-modeling example 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Patterns - Cypher Manual - Neo4j
A more powerful construct is a pattern that describes multiple nodes and relationships between them. Cypher patterns describe relationships by employing an ...
Read more >
Automated Analysis of Regularities Between Model ... - JASSS
The tool first approximates input-output relationships by developing a metamodel, a simplified representation of the original agent-based model. For this ...
Read more >
Correlation Analysis to Identify the Effective Data in Machine ...
Correlation analysis is an extensively used technique that identifies interesting relationships in data. These relationships help us realize ...
Read more >
Full article: Evaluating road–rail intermodal transport services
The aim of this paper is to develop an approach for evaluating intermodal transport solutions based on a road–rail interconnection that incorporates ...
Read more >
Voxel‐wise intermodal coupling analysis of two or more ...
Previous studies have shown that local covariance structures between modalities, or intermodal coupling (IMCo), can be summarized for two ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found