Modes
axis_tilde(tensor)
¤
Apply tilde0010 to a tensor
The input tesor is iterated through axis 2 first, and axis 1 subsequently; tilde0010 is applied to axis 0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
ndarray
|
3xN1xN2 tensor |
required |
Returns:
Type | Description |
---|---|
ndarray
|
6x6xN1xN2 tensor |
Source code in feniax/intrinsic/modes.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
contraction(moments, loadpaths, precision)
¤
Sums the moments from the nodal forces along the corresponding load path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
moments |
ndarray
|
num_modes x 6 x num_nodes(index) x num_nodes(moment at the previous index due to forces at this node) |
required |
loadpaths |
ndarray
|
num_node x num_node such that [ni, nj] is 1 or 0 depending on whether ni is a node in the loadpath of nj respectively |
required |
Returns:
Type | Description |
---|---|
ndarray
|
num_modes x 6 x num_nodes(index) as the sum of moments due to forces at each node |
Source code in feniax/intrinsic/modes.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
|
coordinates_difftensor(X, Xm, precision)
¤
Computes coordinates
The tensor represents the following: Coordinates, middle point of each element, minus the position of each node in the structure
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
ndarray
|
Grid coordinates |
required |
Mavg |
ndarray
|
Matrix to calculate the averege point between nodes |
required |
num_nodes |
int
|
Number of nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
X3 |
jnp.ndarray: (3xNnxNn)
|
Tensor, Xm1 -(X1)' : [Coordinates, Middle point of segment, Node] |
Source code in feniax/intrinsic/modes.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
|
eigh(a, b)
¤
Compute the solution to the symmetrized generalized eigenvalue problem.
a_s @ w = b_s @ w @ np.diag(v)
where a_s = (a + a.H) / 2, b_s = (b + b.H) / 2 are the symmetrized versions of the inputs and H is the Hermitian (conjugate transpose) operator.
For self-adjoint inputs the solution should be consistent with scipy.linalg.eigh
i.e.
v, w = eigh(a, b) v_sp, w_sp = scipy.linalg.eigh(a, b) np.testing.assert_allclose(v, v_sp) np.testing.assert_allclose(w, standardize_angle(w_sp))
Note this currently uses jax.linalg.eig(jax.linalg.solve(b, a))
, which will be
slow because there is no GPU implementation of eig
and it's just a generally
inefficient way of doing it. Future implementations should wrap cuda primitives.
This implementation is provided primarily as a means to test eigh_jvp_rule
.
Args: a: [n, n] float self-adjoint matrix (i.e. conj(transpose(a)) == a) b: [n, n] float self-adjoint matrix (i.e. conj(transpose(b)) == b)
Returns: v: eigenvalues of the generalized problem in ascending order. w: eigenvectors of the generalized problem, normalized such that w.H @ b @ w = I.
Source code in feniax/intrinsic/modes.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
eigh_jvp_rule(primals, tangents)
¤
Derivation based on Boedekker et al.
https://arxiv.org/pdf/1701.00392.pdf
Note diagonal entries of Winv dW/dt != 0 as they claim.
Source code in feniax/intrinsic/modes.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
make_C6(v1)
¤
Given a 3x3xNn tensor, make the diagonal 6x6xNn
It iterates over a third dimension in the input tensor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v1 |
ndarray
|
A tensor of the form (3x3xNn) |
required |
Source code in feniax/intrinsic/modes.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
|
moment_force(force, X3t, precision)
¤
Yields moments associated to each node due to the forces
Parameters:
Name | Type | Description | Default |
---|---|---|---|
force |
ndarray
|
Force tensor (Nmx6xNn) for which we want to obtain the resultant moments |
required |
X3t |
ndarray
|
Tilde positions tensor (6x6xNnxNn) |
required |
Returns:
Type | Description |
---|---|
jnp.ndarray: (Nmx6xNnxNn)
|
|
Source code in feniax/intrinsic/modes.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
|
reshape_modes(_phi, num_modes, num_nodes)
¤
Reshapes vectors in the input matrix to form a 3rd-order tensor
Each vector is made into a 6xNn matrix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_phi |
ndarray
|
Matrix as in the output of eigenvector analysis (6NnxNm) |
required |
num_modes |
int
|
Number of modes |
required |
num_nodes |
int
|
Number of nodes |
required |
Source code in feniax/intrinsic/modes.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
|
scale(phi1, psi1, phi2, phi1l, phi1ml, psi1l, phi2l, psi2l, omega, X_xdelta, C0ab, C06ab, *args, **kwargs)
¤
Sacales the intrinsic modes
The porpuse is that the integrals alpha1 and alpha2 are the identity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phi1 |
ndarray
|
|
required |
psi1 |
ndarray
|
|
required |
phi2 |
ndarray
|
|
required |
phi1l |
ndarray
|
|
required |
phi1ml |
ndarray
|
|
required |
psi1l |
ndarray
|
|
required |
phi2l |
ndarray
|
|
required |
psi2l |
ndarray
|
|
required |
omega |
ndarray
|
|
required |
X_xdelta |
ndarray
|
|
required |
C0ab |
ndarray
|
|
required |
C06ab |
ndarray
|
|
required |
*args |
|
()
|
|
**kwargs |
|
{}
|
Source code in feniax/intrinsic/modes.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
|
tilde0010(vector)
¤
Tilde matrix for cross product (moments due to forces)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector |
ndarray
|
A 3-element array |
required |
Returns:
Type | Description |
---|---|
ndarray
|
6x6 matrix with (3:6 x 0:3) tilde operator |
Source code in feniax/intrinsic/modes.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|