Page History
...
To set up Jupyter Notebook
...
In Jupyter Notebook, run the following command to install a Python package from the <
modeling_tool_installation_directory>install_root>\plugins\com.nomagic.magicdraw.simulation\pyST.zip file:
Code Block %pip install pyST.zip
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
server_host | path | required | The Teamwork Cloud server host name. |
server_port | path | required | The Teamwork Cloud server port. |
TWC_user_name | path | optional | The Teamwork Cloud user name. If you do not specify the user name in the request, an input field will be provided to specify it later. |
TWC_user_password | path | optional | The Teamwork Cloud password. If you do not specify the password in the request, an input field will be provided to specify it later. |
Tip |
---|
For instructions on how to run server-side simulation using SSL, refer to Running server-side simulation with SSL |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description | ||
---|---|---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. | ||
version | path | optional | The Teamwork Cloud project version. | ||
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. | ||
element_id | path | optional | The server ID of the Instance Specification to be executed. | ||
config | path | required | The Simulation Configuration name or server ID. | ||
auto_start | path | optional | Starts the simulation automatically after the initialization phase is completed. Available values are:
| ||
started_from | path | optional | Allows specifying the starting location of the simulation. The value of the started_from parameter is provided in the status endpoint response. | ||
commit_results | path | optional | Commits a new project version with the simulation results. Available values are True or False (default). | ||
verification | path | optional | Returns the selected verification results. Available values are:
| ||
data | path | optional | A set of output parameters, which will be obtained after the simulation is complete. |
Code Block | ||
---|---|---|
| ||
# SpaceCraftMassRollup sample parameters = { "inputs": { "telecom.antenna.me":10, "telecom.amplifier.me":20 }, "outputs": [ "me", "propulsion.me", "propulsion.tank.me", "propulsion.thruster.me", "telecom.me", "telecom.antenna.me", "telecom.amplifier.me" ] } client.run('SpacecraftMassRollup_SimWeb', config='spacecraft mass analysis', commit_results=False, data=json.dumps(parameters)) |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
Start simulation
Panel | ||||
---|---|---|---|---|
| ||||
client.start(<simulation_id>) |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
Start simulation and get results
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
element_id | path | optional | The server ID of the Instance Specification to be executed. |
config | path | required | The Simulation Configuration name or server ID. |
commit_results | path | optional | A new project version is committed with the simulation results. Available values are True or False (default). |
verification | path | optional | Returns the selected verification results. Available values are:
If the verification value is not specified, only the verification results with the fail status are returned when the get_results endpoint is called. |
data | path | optional | A set of output parameters, which will be obtained after the simulation is complete. |
Code Block | ||
---|---|---|
| ||
# SpaceCraftMassRollup sample parameters = { "inputs": { "telecom.antenna.me":10, "telecom.amplifier.me":20 }, "outputs": [ "me", "propulsion.me", "propulsion.tank.me", "propulsion.thruster.me", "telecom.me", "telecom.antenna.me", "telecom.amplifier.me" ] } client.simulate('SpacecraftMassRollup_SimWeb', config='spacecraft mass analysis', commit_results=False, data=json.dumps(parameters)) |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
Code Block | ||
---|---|---|
| ||
client.get_status('55089221-8673-4391-aa3e-a8e774ecfa48') {'state': 'RUNNING', 'simulationId': '55089221-8673-4391-aa3e-a8e774ecfa48', 'simulationTime': '0 ms', 'ui': '/simulation/api/ui/55089221-8673-4391-aa3e-a8e774ecfa48/CoffeeMachine.html', 'project': 'CoffeeMachine', 'config': 'Coffee Machine Web', 'elapsedTime': 6598} client.get_status('ce8c8215-0515-43fd-9d34-92d1d7a95d87') {'state': 'COMPLETED', 'simulationId': 'ce8c8215-0515-43fd-9d34-92d1d7a95d87', 'simulationTime': '3000 ms', 'project': 'SpacecraftMassRollup', 'config': 'spacecraft mass analysis', 'elapsedTime': 6598} client.get_status('b7bdf933-f58d-4e7e-b73b-8370c60485cd') {'state': 'QUEUED', 'queueNumber': 3, 'simulationId': 'b7bdf933-f58d-4e7e-b73b-8370c60485cd', 'simulationTime': '0 ms', 'project': 'CarBrakingAnalysis', 'elapsedTime': 52} |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
variables | path | optional | The set of simulation variables that should be obtained. If no variables are specified, the values of all simulation variables are returned. |
Set simulation variables
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
client.set_variables(<simulation_id>, variables=json.dumps(<parameters>)) |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
variables | path | required | The set of simulation variables with values that should be used during the current simulation. |
context | path | optional | The context ID. |
property_path | path | optional | The property path of the context specified using property names or IDs. |
Code Block | ||
---|---|---|
| ||
var = { "variables": { "position": 40 } } client.set_variables('23ceff24-28fa-47e4-b29f-b6b60b4b12e3', variables=json.dumps(var)) |
...
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
Resume simulation
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
client.resume(<simulation_id>) |
...
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
Get simulation results
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
client.get_result(<simulation_id>) |
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
Get the list of running simulations
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
Check for Simulation Configurations
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
Get Simulation Configurations
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
element_id | path | optional | The server ID of the Instance Specification to be executed. |
filter | path | optional | Returns Simulations Configurations with a specified UI tag for a particular project. The only possible value for the filter parameter is ui. Only Simulations Configurations having at least one of the following UI elements are returned:
|
Get Simulation Configuration descriptor
...
The following table describes the parameters used in the request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
config | path | required | The Simulation Configuration name or server ID. |
Code Block | ||
---|---|---|
| ||
client.get_descriptor('SpacecraftMassPollup_SimWeb', config='spacecraft mass analysis') {'config': 'spacecraft mass analysis', 'description': 'Simulation Config that is dedicated to run spacecraft mass rollup.', 'model': 'spacecraft', 'parameters': {'inputs': [{'parameter': 'telecom.amplifier.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'telecom.antenna.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.tank.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.thruster.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}], 'outputs': [{'parameter': 'telecom.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'me', 'value': 95.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}]}} client.get_descriptor('BouncingBall', config='Run BouncingBall') {'config': 'Run BouncingBall', 'description': 'Simulation Config dedicated to run simulation with bouncingBall.fmu.', 'model': 'bouncingBall', 'timeStep': '10 ms' } |
...