과정의 장
교육 · 트랙 9. SysML v2 기초 · 9.7장 (전체 8장)
9.7 제약 조건과 계산 4:26
제약 조건과 계산을 작성하고, 세단의 값을 단위와 함께 검사하고, 미정 값을 표시합니다.
Holarch 2.22 화면입니다.
학습 내용
- 파라미터가 있는 제약 조건 정의와 계산 정의 작성하기
- 제약 조건 사용의 파라미터를 모델의 값에 바인딩하기
- 파라메트릭 뷰에서 제약 조건의 합격과 불합격을 보고 모두 풀기로 모든 제약 조건 검사하기
- TBD 및 TBR 메타데이터로 미정 값을 표시하고 TBD/TBR 등록부에서 찾기
- 예산 및 TPM에서 파트의 질량 집계하기
Hybrid Car라는 작은 프로젝트에서 SysML v2 튜토리얼 Constraints and Calculations를 따라 Holarch에서 SysML v2 제약 조건과 계산을 작성합니다. 제약 조건 정의와 계산, 세단의 값에 바인딩된 제약 조건 사용, 검사가 불합격했다가 합격하는 파라메트릭 뷰, 모두 풀기, 분석 케이스, TBD 및 TBR 값과 그 등록부, 그리고 예산에서의 질량 집계를 다룹니다. SysML은 Object Management Group, Inc.의 등록 상표입니다.
실습
Hybrid Car 데모 프로젝트(SysML v2)에서 Holarch로 직접 해 보십시오.
- Hybrid Car 데모 프로젝트를 열고(필요하면 만드십시오: 프로젝트 관리 → 프로젝트 파일 ▾ → 새 데모 프로젝트 → Hybrid Car (SysML v2)), 모델 → 편집기와 패키지
VehicleRequirements를 엽니다. constraint def SpeedLimit뒤에constraint sedanBatteryCheck : MassLimit { in mass = fleet.sedan.powertrain.battery.mass; in limit = 50 [kg]; }를 추가합니다.- 다이어그램 페이지에서 + 새 다이어그램을 클릭하고, 파라메트릭 뷰와 표시 대상 아래의
VehicleRequirements를 선택한 다음 만들기를 클릭합니다. 새 검사는 합격입니다. 48 kg은 50 kg 이내입니다. - 패키지
Vehicles에서 세단 배터리의 질량을52 [kg]로 바꾸면 뷰에 검사 불합격이 표시됩니다. ⌘Z / Ctrl+Z를 누른 다음 모두 풀기를 클릭해 모든 제약 조건을 다시 검사합니다. 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을 열고 담당자와 함께 요구사항을 찾습니다.- 아키텍처 → 예산 및 TPM을 열고 루트 부품 선택…을 클릭한 다음
sedan을 선택합니다. 수량에서 Mass를 선택하고 배터리의 48 kg을 찾습니다.
파라메트릭 뷰에서 sedanBatteryCheck가 합격으로 표시되고, TBD/TBR 등록부에 담당자 Test lead와 함께 Acceleration 요구사항이 나열되면 완료입니다.
스스로 확인
constraint def와calc def의 차이는 무엇입니까?- 파라메트릭 뷰의 제약 조건에 입력 필요가 표시됩니다. 무엇이 빠졌습니까?
- 값으로 TBD를 쓰는 대신
#TBD나@TBD { … }로 미정 값을 표시하는 이유는 무엇입니까? - 분석 케이스는 계산에 무엇을 더합니까?
답 보기
constraint def와calc def의 차이는 무엇입니까?제약 조건 정의는
mass <= limit처럼 파라미터에 대해 성립하거나 성립하지 않는 조건을 기술합니다. 계산 정의는return ratio = power / mass;처럼 값을 계산하여 반환합니다.파라메트릭 뷰의 제약 조건에 입력 필요가 표시됩니다. 무엇이 빠졌습니까?
파라미터에 아직 값이 없습니다. 예를 들어
in mass = fleet.sedan.curbMass;처럼 모든 파라미터를 값에 바인딩하십시오.값으로 TBD를 쓰는 대신
#TBD나@TBD { … }로 미정 값을 표시하는 이유는 무엇입니까?값 자리에 쓴
TBD는 유효한 SysML이 아닙니다. Holarch의HolarchMetadata패키지에 있는 메타데이터는 텍스트를 유효하게 유지합니다. TBD와 TBR은 표준StatusInfo메타데이터를 특수화하므로, 다른 SysML v2 도구는 이를 상태 주석으로 읽습니다.분석 케이스는 계산에 무엇을 더합니까?
계산을 세단 같은 주체에 적용하고 결과를 반환하며, Holarch가 다른 제약 조건처럼 평가하는 require 제약 조건이 있는 목표를 갖습니다.
더 읽어 보기
대본
대본 보기 (내레이션과 화면 내용)
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.