Holarch
कोर्स के अध्याय

प्रशिक्षण · ट्रैक 9. SysML v2 की मूल बातें · 8 में से अध्याय 9.7

9.7 Constraints और गणनाएं 4:26

constraints और calculations लिखें, इकाइयों के साथ सेडान के मान जांचें, और खुले मान चिह्नित करें।

Holarch 2.22 दिखाता है।

आप क्या सीखेंगे

  • पैरामीटर के साथ एक constraint परिभाषा और एक calculation परिभाषा लिखें
  • किसी constraint usage के पैरामीटर को मॉडल के मानों से बाइंड करें
  • Parametric View में किसी constraint को पास और फ़ेल होते देखें, और सभी हल करें से हर constraint जांचें
  • खुले मानों को TBD और TBR metadata से चिह्नित करें और उन्हें TBD/TBR रजिस्टर में खोजें
  • बजट और TPM में किसी part का द्रव्यमान रोल अप करें

एक छोटे Hybrid Car प्रोजेक्ट पर SysML v2 ट्यूटोरियल Constraints and Calculations का पालन करते हुए Holarch में SysML v2 constraints और calculations लिखें: एक constraint परिभाषा और एक calculation, सेडान के मानों से बाइंड किया गया constraint usage, एक Parametric View जहाँ जांच फ़ेल और पास होती है, सभी हल करें, एक analysis case, अपने रजिस्टर के साथ TBD और TBR मान, और बजट में द्रव्यमान रोल-अप। SysML, Object Management Group, Inc. का पंजीकृत ट्रेडमार्क है।

प्रोजेक्ट फ़ाइलें

वीडियो holarch.app से चलता है; गोपनीयता नीति देखें।

अभ्यास

यह स्वयं Holarch में, Hybrid Car डेमो प्रोजेक्ट (SysML v2) पर करें।

  1. अपना Hybrid Car डेमो प्रोजेक्ट खोलें (ज़रूरत हो तो उसे बनाएं: प्रोजेक्ट प्रबंधित करें → प्रोजेक्ट फ़ाइलें ▾ → नया डेमो प्रोजेक्ट → Hybrid Car (SysML v2)), मॉडल → संपादक और पैकेज VehicleRequirements खोलें।
  2. constraint def SpeedLimit के बाद constraint sedanBatteryCheck : MassLimit { in mass = fleet.sedan.powertrain.battery.mass; in limit = 50 [kg]; } जोड़ें।
  3. आरेख पेज पर + नया आरेख पर क्लिक करें, Parametric View और दिखाता है के अंतर्गत VehicleRequirements चुनें, और बनाएं पर क्लिक करें। नई जांच पास होती है: 48 kg, 50 kg के भीतर है।
  4. पैकेज Vehicles में सेडान बैटरी का द्रव्यमान 52 [kg] करें; व्यू जांच को फ़ेल होते दिखाता है। ⌘Z / Ctrl+Z दबाएं, फिर हर constraint दोबारा जांचने के लिए सभी हल करें पर क्लिक करें।
  5. requirement def <'VR-2'> Acceleration में attribute zeroToHundred : TimeValue; को attribute zeroToHundred : TimeValue { @TBD { owner = "Test lead"; rationale = "The test track is not booked yet."; } } से बदलें। ज़रूरतें और आवश्यकताएं → TBD/TBR खोलें और आवश्यकता को उसके स्वामी के साथ खोजें।
  6. आर्किटेक्चर → बजट और TPM खोलें, रूट भाग चुनें… पर क्लिक करें और sedan चुनें। मात्रा के अंतर्गत द्रव्यमान चुनें और बैटरी का 48 kg खोजें।

आपका काम तब पूरा है जब sedanBatteryCheck Parametric View में पास दिखाता है और TBD/TBR रजिस्टर Acceleration आवश्यकता को स्वामी Test lead के साथ सूचीबद्ध करता है।

स्वयं जांचें

  1. constraint def और calc def में क्या अंतर है?
  2. Parametric View में कोई constraint इनपुट चाहिए दिखाता है। क्या गायब है?
  3. मान के रूप में TBD लिखने के बजाय किसी खुले मान को #TBD या @TBD { … } से क्यों चिह्नित करें?
  4. analysis case किसी calculation में क्या जोड़ता है?
उत्तर दिखाएं
  1. constraint def और calc def में क्या अंतर है?

    constraint परिभाषा अपने पैरामीटर पर एक शर्त बताती है जो पूरी होती है या नहीं, जैसे mass <= limit। calculation परिभाषा एक मान की गणना करके उसे लौटाती है, जैसे return ratio = power / mass;।

  2. Parametric View में कोई constraint इनपुट चाहिए दिखाता है। क्या गायब है?

    किसी पैरामीटर का अभी कोई मान नहीं है। हर पैरामीटर को किसी मान से बाइंड करें, उदाहरण के लिए in mass = fleet.sedan.curbMass;।

  3. मान के रूप में TBD लिखने के बजाय किसी खुले मान को #TBD या @TBD { … } से क्यों चिह्नित करें?

    मान की जगह TBD वैध SysML नहीं है। Holarch के HolarchMetadata पैकेज का metadata टेक्स्ट को वैध रखता है; TBD और TBR मानक StatusInfo metadata को विशेषीकृत करते हैं, इसलिए अन्य SysML v2 टूल उन्हें स्थिति एनोटेशन के रूप में पढ़ते हैं।

  4. analysis case किसी calculation में क्या जोड़ता है?

    यह calculation को किसी subject पर लागू करता है, जैसे सेडान, परिणाम लौटाता है, और इसका एक objective होता है जिसके require constraint का Holarch किसी भी अन्य constraint की तरह मूल्यांकन करता है।

और पढ़ें

ट्रांसक्रिप्ट

ट्रांसक्रिप्ट दिखाएं (नरेशन और स्क्रीन पर क्या है)

Introduction

Chapter seven: constraints and calculations. They turn the model's values into checks and results that Holarch evaluates with units.

In this chapter you write a constraint and a calculation, bind a check to the sedan's values, see it fail and pass in a Parametric View, run an analysis case, and mark open values.

Start the tutorial

Start the tutorial Constraints and Calculations from Project Files, Start a Tutorial. Its starter project holds the sedan with its engine and battery values, and two targets: the maximum curb mass and the minimum power to weight.

On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Constraints and Calculations → Start; Model → Editor.

Constraints and calculations

A constraint definition states a condition over its parameters. After the constraints comment, write the mass limit: the mass is at most the limit.

On screen: After // ---- Constraints and calculations ----: constraint def MassLimit.

Below it, a calculation: power to weight divides the power by the mass, and returns the ratio.

On screen: Below it: calc def PowerToWeight.

A constraint usage binds each parameter to a value: here, the sedan's curb mass and the maximum curb mass.

On screen: Below it: constraint sedanMassCheck : MassLimit with bound inputs.

The Parametric View

Open the Diagrams page, click New Diagram, and choose Parametric View. Choose the vehicle analysis package under Shows, and click Create.

On screen: Diagrams → + New Diagram → Parametric View; Shows: VehicleAnalysis; Create.

The check shows its expression, with its parameters bound to the values. Fifteen hundred eighty kilograms is within sixteen hundred fifty, so it passes.

On screen: The mass check: pass.

In the Editor, change the sedan's curb mass to seventeen hundred kilograms. Back in the Parametric View, the mass check now fails.

On screen: Model → Editor: curbMass 1580 → 1700; Diagrams → the Parametric View: fail.

Change it back to fifteen hundred eighty in the Editor. In the view, Solve All checks every constraint again, with units.

On screen: Model → Editor: 1700 → 1580; the view → Solve All → Pass; Close.

An analysis case

An analysis case computes a result for a subject. At the end of the package, add the power to weight analysis, and apply it to the sedan. Its objective requires at least the minimum, and the checker evaluates it like any constraint.

On screen: Model → Editor; after sedanMassCheck: analysis def PowerToWeightAnalysis; analysis sedanPowerToWeight.

TBD and TBR

Values that are still open get a mark. First import Holarch's metadata package after the other imports.

On screen: After the imports: private import HolarchMetadata::*;

Then add a charge time requirement. TBR marks the time limit to be reviewed, and TBD marks the charger power to be determined, with an owner, a due date and a rationale. Both come from Holarch's metadata library and specialize the standard status metadata, so other SysML v2 tools see them as status annotations.

On screen: At the end: requirement def <'VR-5'> ChargeTime with #TBR and @TBD.

Open Needs and Requirements, then TBD/TBR. The charge time is listed with the owner and the due date from its metadata. The register only lists them: to change them, edit the metadata in the Editor.

On screen: Needs & Requirements → TBD/TBR; the ChargeTime row with owner and due date.

Budgets

Last, open Architecture, then Budgets, and select the sedan as the root part. The quantity Mass reads each part's mass attribute with its unit: the battery shows the sedan's own forty eight kilograms.

On screen: Architecture → Budgets & TPMs → Select Root Part… → sedan; the battery 48 kg.

Recap

Every step is ticked off. Click Mark as Done.

On screen: Step panel → Mark as Done.

Let's recap. You wrote a constraint and a calculation, bound a check to the sedan's values, saw it fail and pass in a Parametric View, ran an analysis case, marked open values for the register, and rolled up the mass.

Next, variants and configurations describe a product line.