Skip to content

Commit 96f88bc

Browse files
committed
Add sweep of actuation mapping vs. bending strain for various segment radii
1 parent 4ec9302 commit 96f88bc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/simulate_pneumatic_planar_pcs.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,23 @@ def sweep_actuation_mapping():
123123
plt.tight_layout()
124124
plt.show()
125125

126+
# plot the actuation mapping of u1 vs. the bending strain for various segment radii
127+
r_pts = jnp.linspace(1e-2, 1e-1, 10)
128+
r_cham_out_pts = r_pts - 2e-3
129+
fig, ax = plt.subplots(num="pneumatic_planar_pcs_actuation_mapping_bending_torque_vs_bending_strain_4segment_radii")
130+
for r, r_cham_out in zip(r_pts, r_cham_out_pts):
131+
_params = params.copy()
132+
_params["r"] = r * jnp.ones((num_segments,))
133+
_params["r_cham_out"] = r_cham_out * jnp.ones((num_segments,))
134+
A_pts = vmap(actuation_mapping_fn, in_axes=(None, None, 0))(_params, B_xi, q_pts)
135+
ax.plot(kappa_be_pts, A_pts[:, 0, 0], label=r"$R = " + str(r) + "$")
136+
ax.set_xlabel(r"$\kappa_\mathrm{be}$ [rad/m]")
137+
ax.set_ylabel(r"$\frac{\partial \tau_\mathrm{be}}{\partial u_1}$")
138+
plt.legend()
139+
plt.grid(True)
140+
plt.tight_layout()
141+
plt.show()
142+
126143
# create grid for bending and axial strains
127144
kappa_be_grid, sigma_ax_grid = jnp.meshgrid(
128145
jnp.linspace(-jnp.pi, jnp.pi, 20),

0 commit comments

Comments
 (0)