Changeset 1170
- Timestamp:
- 09/29/08 06:54:05 (2 months ago)
- Location:
- Modelica/trunk/Modelica
- Files:
-
- 2 modified
-
Mechanics/MultiBody/Sensors.mo (modified) (26 diffs)
-
package.mo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Modelica/Mechanics/MultiBody/Sensors.mo
r1091 r1170 1 within Modelica.Mechanics.MultiBody; 1 within Modelica.Mechanics.MultiBody; 2 2 package Sensors "Sensors to measure variables" 3 extends Modelica.Icons.Library; 4 3 5 model AbsoluteSensor 4 6 "Measure absolute kinematic quantities of frame connector" … … 52 54 extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialAbsoluteSensor; 53 55 54 Interfaces.Frame_resolve frame_resolve if 55 resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 56 Interfaces.Frame_resolve frame_resolve if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 56 57 "If resolveInFrame = Types.ResolveInFrameA.frame_resolve, the output signals are resolved in this frame" 57 58 annotation (Placement(transformation( … … 62 63 "= true, if animation shall be enabled (show arrow)"; 63 64 parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA resolveInFrame 64 = 65 Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 66 "Frame in which vectors are resolved before differentiation (1: world, 2: frame_a, 3: frame_resolve)"; 65 = Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 66 "Frame in which vectors are resolved (1: world, 2: frame_a, 3: frame_resolve)"; 67 67 parameter Boolean get_r=false 68 68 "= true, to measure the absolute position vector of the origin of frame_a" … … 102 102 annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 103 103 104 parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA 105 resolveInFrameAfterDifferentiation = resolveInFrame 106 "Frame in which vectors are resolved after differentiation (1: world, 2: frame_a, 3: frame_resolve)" 107 annotation(Dialog(tab="Advanced", group="if get_v or get_a or get_z", enable=get_v or get_a or get_z)); 108 109 annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 110 -100},{100,100}}, 111 grid={1,1}), graphics), 112 Icon(coordinateSystem(preserveAspectRatio=true, 113 extent={{-100,-100},{100,100}}, 114 grid={1,1}), graphics={ 104 annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 105 -100},{100,100}}), graphics), 106 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, 107 -100},{100,100}}), graphics={ 115 108 Line( 116 109 visible=get_r, … … 207 200 <p> 208 201 Via parameter <b>resolveInFrame</b> it is defined, in which frame 209 a vector is resolved (before differentiation):202 a vector is resolved: 210 203 </p> 211 204 … … 239 232 240 233 <p> 241 Note, derivatives 242 of absolute kinematic quantities are always performed with 243 respect to the frame, in which the vector to be differentiated 244 is resolved. After differentiation, it is possible via parameter 245 <b>resolveInFrameAfterDifferentiation</b> (in the \"Advanced\" menu) 246 to resolve the differentiated 247 vector in another frame. 234 Velocity, acceleration, angular velocity and angular acceleration are 235 determined by differentiating them in the world frame and then transforming 236 them in to the frame defined by <b>resolveInFrame</b>. 248 237 </p> 249 238 <p> … … 251 240 </p> 252 241 <pre> 253 r = resolve2(frame_a.R,frame_a.r0);254 v = <b>der</b>(r);242 v0 = <b>der</b>(frame_a.r0); 243 v = resolve2(frame_a.R, v0); 255 244 </pre> 256 is returned, i.e., he derivative of the absolute distance from the 257 world frame to the origin of frame_a, resolved in frame_a. If 258 <b>resolveInFrameAfterDifferentiation</b> = Types.ResolveInFrameA.frame_resolve, then 259 v is additionally transformed to: 260 </p> 261 <pre> 262 v = resolveRelative(<b>der</b>(r),frame_a.R, frame_resolve.R); 263 </pre> 264 245 is returned, i.e., the derivative of the absolute distance from the 246 world frame to the origin of frame_a, resolved in frame_a. 247 </p> 265 248 266 249 <p> … … 305 288 306 289 protected 307 AbsolutePosition position(resolveInFrame=resolveInFrame) if 308 get_r or get_v or get_a 290 AbsolutePosition position(resolveInFrame=resolveInFrame) if get_r 309 291 annotation (Placement(transformation(extent={{10,10},{-10,30}}, 310 292 rotation=90, 311 origin={-40,0}))); 312 313 Blocks.Continuous.Der der1[3] if get_v or get_a annotation (Placement(transformation( 314 extent={{-10,-10},{0,0}}, 293 origin={-80,-60}))); 294 295 protected 296 AbsoluteVelocity velocity(resolveInFrame=resolveInFrame) if get_v 297 annotation ( 298 Placement(transformation( 299 extent={{10,-10},{-10,10}}, 300 rotation=90, 301 origin={-60,-60}))); 302 Modelica.Mechanics.MultiBody.Sensors.AbsoluteAngles absoluteAngles(sequence= 303 sequence, guessAngle1=guessAngle1) if get_angles 304 annotation (Placement(transformation(extent={{-10,10},{10,-10}}, 315 305 rotation=-90, 316 origin={-55,-30}))); 317 Blocks.Continuous.Der der2[3] if get_a annotation (Placement(transformation( 318 extent={{0,0},{10,10}}, 319 rotation=-90, 320 origin={-25,-40}))); 321 Modelica.Mechanics.MultiBody.Sensors.AbsoluteAngles absoluteAngles( 322 sequence=sequence, guessAngle1= 323 guessAngle1) if get_angles 324 annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 325 rotation=-90, 326 origin={20,-14}))); 327 AbsoluteAngularVelocity angularVelocity(resolveInFrame=resolveInFrame) if 328 get_w or get_z 306 origin={20,-60}))); 307 AbsoluteAngularVelocity angularVelocity(resolveInFrame=resolveInFrame) if get_w 329 308 annotation (Placement(transformation(extent={{-10,-10},{10,-30}}, 330 309 rotation=-90, 331 origin={80,-14}))); 332 333 Blocks.Continuous.Der der3[3] if get_z annotation (Placement(transformation( 334 extent={{-20,-20},{0,0}}, 310 origin={70,-60}))); 311 312 protected 313 Blocks.Continuous.Der der1[3] if get_a annotation (Placement( 314 transformation( 315 extent={{-6,-6},{6,6}}, 335 316 rotation=-90, 336 origin={110,-60}))); 337 Internal.ZeroForceAndTorque zeroForce1 338 annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); 339 Internal.ZeroForceAndTorque zeroForce2 if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 340 annotation (Placement(transformation(extent={{70,30},{50,50}}))); 341 317 origin={-20,-34}))); 318 protected 319 Blocks.Continuous.Der der2[3] if get_z annotation (Placement( 320 transformation( 321 extent={{-6,-6},{6,6}}, 322 rotation=-90, 323 origin={100,-46}))); 324 325 protected 342 326 Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 343 transformVector_v( frame_r_in=resolveInFrame, 344 frame_r_out=resolveInFrameAfterDifferentiation) if get_v 345 annotation (Placement(transformation(extent={{-70,-64},{-50,-44}}))); 327 transformVector_a( 328 frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 329 frame_r_out=resolveInFrame) if 330 get_a 331 annotation (Placement(transformation(extent={{-10,-70},{-30,-50}}))); 346 332 Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 347 transformVector_a( frame_r_in=resolveInFrame, 348 frame_r_out=resolveInFrameAfterDifferentiation) if get_a 349 annotation (Placement(transformation(extent={{-30,-80},{-10,-60}}))); 350 Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 351 transformVector_z( frame_r_in=resolveInFrame, 352 frame_r_out=resolveInFrameAfterDifferentiation) if 333 transformVector_z( 334 frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 335 frame_r_out=resolveInFrame) if 353 336 get_z 354 annotation (Placement(transformation(extent={{90,-95},{110,-75}}))); 355 337 annotation (Placement(transformation(extent={{90,-80},{110,-60}}))); 338 339 protected 356 340 outer Modelica.Mechanics.MultiBody.World world; 357 341 … … 362 346 specularCoefficient) if world.enableAnimation and animation; 363 347 348 protected 349 AbsoluteVelocity absoluteVelocity(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world) if get_a 350 annotation (Placement(transformation( 351 extent={{10,-10},{-10,10}}, 352 rotation=90, 353 origin={-20,-12}))); 354 AbsoluteAngularVelocity absoluteAngularVelocity(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world) if 355 get_z 356 annotation (Placement(transformation(extent={{40,-10},{60,10}}, 357 rotation=0))); 358 Internal.ZeroForceAndTorque zeroForce1 359 annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); 360 Internal.ZeroForceAndTorque zeroForce2 if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 361 annotation (Placement(transformation(extent={{80,20},{60,40}}))); 364 362 equation 365 363 connect(zeroForce1.frame_a, frame_a) 366 364 annotation (Line( 367 points={{-80,40},{-90,40},{-90,0},{-100,0}}, 368 color={95,95,95}, 369 thickness=0.5, 370 smooth=Smooth.None)); 371 connect(der2.u, der1.y) annotation (Line( 372 points={{-20,-39},{-20,-35},{-60,-35},{-60,-30.5}}, 373 color={0,0,127}, 365 points={{-60,30},{-80,30},{-80,0},{-100,0}}, 366 color={95,95,95}, 367 thickness=0.5, 374 368 smooth=Smooth.None)); 375 369 connect(absoluteAngles.angles, angles) annotation (Line( 376 points={{20,- 25},{20,-67.5},{20,-67.5},{20,-110}},370 points={{20,-71},{20,-90},{20,-90},{20,-110}}, 377 371 color={0,0,127}, 378 372 smooth=Smooth.None)); 379 373 connect(angularVelocity.frame_a, frame_a) annotation (Line( 380 points={{ 60,-4},{60,20},{-90,20},{-90,0},{-100,0}},374 points={{50,-50},{50,-40},{20,-40},{20,0},{-100,0}}, 381 375 color={95,95,95}, 382 376 thickness=0.5, 383 377 smooth=Smooth.None)); 384 378 connect(angularVelocity.w, w) annotation (Line( 385 points={{60,-25},{60,-110}}, 386 color={0,0,127}, 387 smooth=Smooth.None)); 388 connect(angularVelocity.w, der3.u) annotation (Line( 389 points={{60,-25},{60,-30},{100,-30},{100,-38}}, 390 color={0,0,127}, 391 smooth=Smooth.None)); 392 connect(der1.y, transformVector_v.r_in) 393 annotation (Line( 394 points={{-60,-30.5},{-60,-42}}, 395 color={0,0,127}, 396 smooth=Smooth.None)); 397 connect(transformVector_v.r_out, v) annotation (Line( 398 points={{-60,-65},{-60,-110}}, 399 color={0,0,127}, 400 smooth=Smooth.None)); 401 connect(transformVector_v.frame_a, frame_a) 402 annotation (Line( 403 points={{-70,-54},{-90,-54},{-90,0},{-100,0}}, 404 color={95,95,95}, 405 thickness=0.5, 406 smooth=Smooth.None)); 407 connect(transformVector_v.frame_resolve, frame_resolve) 408 annotation (Line( 409 points={{-50,-53.9},{-47,-53.9},{-47,-54},{-41,-54},{-41,0},{100,0}}, 379 points={{50,-71},{50,-94},{60,-94},{60,-110}}, 380 color={0,0,127}, 381 smooth=Smooth.None)); 382 connect(frame_resolve, position.frame_resolve) annotation (Line( 383 points={{100,0},{114,0},{114,-90},{-80,-90},{-80,-60},{-89.9,-60}}, 410 384 color={95,95,95}, 411 385 pattern=LinePattern.Dot, 412 386 smooth=Smooth.None)); 413 connect(frame_resolve, position.frame_resolve) annotation (Line(414 points={{100,0},{-50,0},{-50,-6.18447e-016},{-49.9,-6.18447e-016}},415 color={95,95,95},416 pattern=LinePattern.Dot,417 smooth=Smooth.None));418 387 connect(frame_resolve,zeroForce2. frame_a) annotation (Line( 419 points={{100,0},{ 80,0},{80,40},{70,40}},388 points={{100,0},{90,0},{90,30},{80,30}}, 420 389 color={95,95,95}, 421 390 pattern=LinePattern.Dot, … … 423 392 connect(angularVelocity.frame_resolve, frame_resolve) annotation ( 424 393 Line( 425 points={{ 70.1,-14},{80,-14},{80,0},{100,0}},394 points={{60.1,-60},{66,-60},{66,-90},{114,-90},{114,0},{100,0}}, 426 395 color={95,95,95}, 427 396 pattern=LinePattern.Dot, 428 397 smooth=Smooth.None)); 429 connect(der2.y, transformVector_a.r_in) annotation (Line( 430 points={{-20,-50.5},{-20,-58}}, 431 color={0,0,127}, 432 smooth=Smooth.None)); 433 connect(transformVector_a.frame_a, frame_a) annotation (Line( 434 points={{-30,-70},{-90,-70},{-90,0},{-100,0}}, 398 connect(transformVector_a.frame_a, frame_a) annotation (Line( 399 points={{-10,-60},{0,-60},{0,-40},{20,-40},{20,0},{-100,0}}, 435 400 color={95,95,95}, 436 401 thickness=0.5, 437 402 smooth=Smooth.None)); 438 403 connect(transformVector_a.frame_resolve, frame_resolve) annotation (Line( 439 points={{- 10,-69.9},{-10,-70},{-1,-70},{-1,0},{100,0}},404 points={{-30,-59.9},{-40,-59.9},{-40,-90},{114,-90},{114,0},{100,0}}, 440 405 color={95,95,95}, 441 406 pattern=LinePattern.Dot, 442 407 smooth=Smooth.None)); 443 408 connect(transformVector_a.r_out, a) annotation (Line( 444 points={{-20,- 81},{-20,-110}},445 color={0,0,127}, 446 smooth=Smooth.None)); 447 connect(der 3.y, transformVector_z.r_in) annotation (Line(448 points={{100,- 61},{100,-73}},409 points={{-20,-71},{-20,-110}}, 410 color={0,0,127}, 411 smooth=Smooth.None)); 412 connect(der2.y, transformVector_z.r_in) annotation (Line( 413 points={{100,-52.6},{100,-58}}, 449 414 color={0,0,127}, 450 415 smooth=Smooth.None)); 451 416 connect(transformVector_z.r_out, z) annotation (Line( 452 points={{100,- 96},{100,-110}},417 points={{100,-81},{100,-110}}, 453 418 color={0,0,127}, 454 419 smooth=Smooth.None)); 455 420 connect(transformVector_z.frame_a, frame_a) annotation (Line( 456 points={{90,- 85},{-90,-85},{-90,0},{-100,0}},421 points={{90,-70},{80,-70},{80,-40},{20,-40},{20,0},{-100,0}}, 457 422 color={95,95,95}, 458 423 thickness=0.5, 459 424 smooth=Smooth.None)); 460 425 connect(transformVector_z.frame_resolve, frame_resolve) annotation (Line( 461 points={{110,- 84.9},{120,-84.9},{120,0},{100,0}},426 points={{110,-69.9},{110,-70},{114,-70},{114,0},{100,0}}, 462 427 color={95,95,95}, 463 428 pattern=LinePattern.Dot, 464 429 smooth=Smooth.None)); 465 430 connect(frame_a, position.frame_a) annotation (Line( 466 points={{-100,0},{-90,0},{-90,20},{-60,20},{-60,10}}, 467 color={95,95,95}, 468 thickness=0.5, 469 smooth=Smooth.None)); 470 connect(position.r, der1.u) annotation (Line( 471 points={{-60,-11},{-60,-19}}, 472 color={0,0,127}, 431 points={{-100,0},{-80,0},{-80,-40},{-100,-40},{-100,-50}}, 432 color={95,95,95}, 433 thickness=0.5, 473 434 smooth=Smooth.None)); 474 435 connect(absoluteAngles.frame_a, frame_a) annotation (Line( 475 points={{20,- 4},{20,20},{-90,20},{-90,0},{-100,0}},436 points={{20,-50},{20,0},{-100,0}}, 476 437 color={95,95,95}, 477 438 thickness=0.5, 478 439 smooth=Smooth.None)); 479 440 connect(position.r, r) annotation (Line( 480 points={{-60,-11},{-60,-15},{-100,-15},{-100,-110}}, 441 points={{-100,-71},{-100,-110}}, 442 color={0,0,127}, 443 smooth=Smooth.None)); 444 connect(velocity.frame_a, frame_a) annotation (Line( 445 points={{-60,-50},{-60,-40},{-80,-40},{-80,0},{-100,0}}, 446 color={95,95,95}, 447 thickness=0.5, 448 smooth=Smooth.None)); 449 connect(velocity.frame_resolve, frame_resolve) annotation (Line( 450 points={{-50,-60},{-40,-60},{-40,-90},{114,-90},{114,0},{100,0}}, 451 color={95,95,95}, 452 pattern=LinePattern.Dot, 453 smooth=Smooth.None)); 454 connect(velocity.v, v) annotation (Line( 455 points={{-60,-71},{-60,-110}}, 456 color={0,0,127}, 457 smooth=Smooth.None)); 458 connect(der1.y, transformVector_a.r_in) annotation (Line( 459 points={{-20,-40.6},{-20,-48}}, 460 color={0,0,127}, 461 smooth=Smooth.None)); 462 connect(absoluteVelocity.v, der1.u) annotation (Line( 463 points={{-20,-23},{-20,-26.8}}, 464 color={0,0,127}, 465 smooth=Smooth.None)); 466 connect(absoluteVelocity.frame_a, frame_a) annotation (Line( 467 points={{-20,-2},{-20,0},{-100,0}}, 468 color={95,95,95}, 469 thickness=0.5, 470 smooth=Smooth.None)); 471 connect(absoluteAngularVelocity.frame_a, frame_a) annotation (Line( 472 points={{40,0},{-100,0}}, 473 color={95,95,95}, 474 thickness=0.5, 475 smooth=Smooth.None)); 476 connect(absoluteAngularVelocity.w, der2.u) annotation (Line( 477 points={{61,0},{80,0},{80,-30},{100,-30},{100,-38.8}}, 481 478 color={0,0,127}, 482 479 smooth=Smooth.None)); 483 480 end AbsoluteSensor; 484 485 extends Modelica.Icons.Library;486 481 487 482 model RelativeSensor … … 492 487 493 488 Interfaces.Frame_resolve frame_resolve if 494 resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve 489 resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve or 490 resolveInFrameAfterDifferentiation == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve 495 491 "If resolveInFrame = Types.ResolveInFrameAB.frame_resolve, the output signals are resolved in this frame" 496 492 annotation (Placement(transformation( … … 626 622 color={0,0,127}, 627 623 smooth=Smooth.None), 628 Line(629 points={{95,80},{50,80},{50,49}},630 color={0,0,0},631 pattern=LinePattern.Dot,632 smooth=Smooth.None),633 624 Text( 634 625 extent={{-132,90},{129,138}}, … … 792 783 annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); 793 784 785 protected 794 786 Blocks.Continuous.Der der1[3] if get_v_rel or get_a_rel annotation (Placement(transformation( 795 787 extent={{-10,-10},{0,0}}, … … 808 800 annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); 809 801 802 protected 810 803 Blocks.Continuous.Der der3[3] if get_z_rel annotation (Placement(transformation( 811 804 extent={{-10,-10},{0,0}}, … … 819 812 annotation (Placement(transformation(extent={{70,50},{50,70}}))); 820 813 814 protected 821 815 Modelica.Mechanics.MultiBody.Sensors.TansformRelativeVector 822 816 transformVector_v_rel( frame_r_in=resolveInFrame, … … 833 827 annotation (Placement(transformation(extent={{90,-95},{110,-75}}))); 834 828 829 protected 835 830 outer Modelica.Mechanics.MultiBody.World world; 836 831 … … 932 927 connect(transformVector_v_rel.frame_resolve, frame_resolve) 933 928 annotation (Line( 934 points={{-50,-45.9},{-47,-45.9},{-47,-4 6},{-42,-46},{-42,80},{100,80}},929 points={{-50,-45.9},{-47,-45.9},{-47,-47},{-42,-47},{-42,80},{100,80}}, 935 930 color={95,95,95}, 936 931 pattern=LinePattern.Dot, … … 1132 1127 origin={110,0}))); 1133 1128 1134 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve if resolveInFrame ==1135 Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve1129 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve if 1130 resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 1136 1131 "Coordinate system in which output vector v is optionally resolved" 1137 1132 annotation (Placement(transformation(extent={{-16,-16},{16,16}}, … … 1143 1138 1144 1139 parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA resolveInFrame 1145 = 1146 Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 1140 = Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 1147 1141 "Frame in which output vector v shall be resolved (1: world, 2: frame_a, 3: frame_resolve)"; 1148 1142 1149 protected1150 Internal.BasicAbsolutePosition position(resolveInFrame=resolveInFrame)1151 annotation (Placement(transformation(extent={{-10,-10},{10,10}})));1152 1153 1143 annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 1154 -100},{100,100}}, 1155 grid={1,1}), graphics), Icon(coordinateSystem( 1156 preserveAspectRatio=true, extent={{-100,-100},{100,100}}, 1157 grid={1,1}), graphics={ 1144 -100},{100,100}}), graphics), Icon(coordinateSystem( 1145 preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 1146 ={ 1158 1147 Line( 1159 1148 points={{70,0},{100,0}}, … … 1213 1202 1214 1203 <pre> 1215 r = MultiBody.Frames.resolve2(frame_a.R,frame_a.r_0);1216 v = der(r);1204 v0 = der(frame_a.r_0); 1205 v = MultiBody.Frames.resolve2(frame_a.R, v0); 1217 1206 </pre> 1218 1207 1219 1208 </html>")); 1220 Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition if 1221 not (resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve)1222 annotation (Placement(transformation(extent={{20,-50},{40,-30}})));1223 1209 1210 protected 1211 Internal.BasicAbsolutePosition position(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world) 1212 annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); 1224 1213 Blocks.Continuous.Der der1[3] annotation (Placement(transformation( 1225 1214 extent={{-20,-20},{0,0}}, 1226 1215 rotation=0, 1227 origin={60,10}))); 1216 origin={10,10}))); 1217 TansformAbsoluteVector tansformAbsoluteVector( 1218 frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 1219 frame_r_out=resolveInFrame) annotation (Placement(transformation( 1220 extent={{10,-10},{-10,10}}, 1221 rotation=90, 1222 origin={50,0}))); 1223 Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition 1224 annotation (Placement(transformation(extent={{-60,-60},{-80,-40}}))); 1225 Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition1 if 1226 not ( 1227 resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve) 1228 annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); 1228 1229 equation 1229 connect(position.frame_resolve, frame_resolve) annotation (Line( 1230 points={{0,-10},{0,-100}}, 1230 connect(position.r, der1.u) annotation (Line( 1231 points={{-39,0},{-12,0}}, 1232 color={0,0,127}, 1233 smooth=Smooth.None)); 1234 connect(position.frame_a, frame_a) annotation (Line( 1235 points={{-60,0},{-100,0}}, 1236 color={95,95,95}, 1237 thickness=0.5, 1238 smooth=Smooth.None)); 1239 connect(der1.y, tansformAbsoluteVector.r_in) annotation (Line( 1240 points={{11,0},{19.5,0},{19.5,7.34788e-016},{38,7.34788e-016}}, 1241 color={0,0,127}, 1242 smooth=Smooth.None)); 1243 connect(tansformAbsoluteVector.r_out, v) annotation (Line( 1244 points={{61,-6.73556e-016},{71.5,-6.73556e-016},{71.5,0},{110,0}}, 1245 color={0,0,127}, 1246 smooth=Smooth.None)); 1247 connect(zeroPosition.frame_resolve, position.frame_resolve) annotation (Line( 1248 points={{-60,-50},{-50,-50},{-50,-10}}, 1231 1249 color={95,95,95}, 1232 1250 pattern=LinePattern.Dot, 1233 1251 smooth=Smooth.None)); 1234 connect(zeroPosition.frame_resolve, position.frame_resolve) 1252 connect(tansformAbsoluteVector.frame_a, frame_a) annotation (Line( 1253 points={{50,10},{50,20},{-70,20},{-70,0},{-100,0}}, 1254 color={95,95,95}, 1255 thickness=0.5, 1256 smooth=Smooth.None)); 1257 connect(tansformAbsoluteVector.frame_resolve, zeroPosition1.frame_resolve) 1235 1258 annotation (Line( 1236 points={{ 20,-40},{0,-40},{0,-10}},1259 points={{49.9,-10},{50,-10},{50,-50},{60,-50}}, 1237 1260 color={95,95,95}, 1238 1261 pattern=LinePattern.Dot, 1239 1262 smooth=Smooth.None)); 1240 connect(der1.y, v) annotation (Line( 1241 points={{61,0},{110,0}}, 1242 color={0,0,127}, 1243 smooth=Smooth.None)); 1244 connect(position.r, der1.u) annotation (Line( 1245 points={{11,0},{38,0}}, 1246 color={0,0,127}, 1247 smooth=Smooth.None)); 1248 connect(position.frame_a, frame_a) annotation (Line( 1249 points={{-10,0},{-100,0}}, 1250 color={95,95,95}, 1251 thickness=0.5, 1263 connect(tansformAbsoluteVector.frame_resolve, frame_resolve) annotation (Line( 1264 points={{49.9,-10},{50,-10},{50,-50},{0,-50},{0,-100}}, 1265 color={95,95,95}, 1266 pattern=LinePattern.Dot, 1252 1267 smooth=Smooth.None)); 1253 1268 end AbsoluteVelocity; … … 1585 1600 "Measure relative velocity vector between the origins of two frame connectors" 1586 1601 extends Internal.PartialRelativeSensor; 1587 Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each1602 Modelica.Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each 1588 1603 final unit = "m/s") 1589 1604 "Relative velocity vector resolved in frame defined by resolveInFrame" … … 1603 1618 Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_a 1604 1619 "Frame in which output vector v_rel shall be resolved (1: world, 2: frame_a, 3: frame_b, 4: frame_resolve)"; 1605 1606 protected1607 Internal.BasicRelativePosition relativePosition(resolveInFrame=resolveInFrame)1608 annotation (Placement(transformation(extent={{-10,-10},{10,10}})));1609 1620 1610 1621 annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, … … 1624 1635 extent={{18,-80},{102,-110}}, 1625 1636 lineColor={0,0,0}, 1626 textString=" r_rel")}),1637 textString="v_rel")}), 1627 1638 Documentation(info="<html> 1628 1639 <p> 1629 1640 The relative velocity vector between the origins of frame_a and of frame_b are
