|
68 | 68 | "execution_count": null, |
69 | 69 | "metadata": {}, |
70 | 70 | "outputs": [], |
71 | | - "source": [ |
72 | | - "time, signals = scp.read()\n", |
73 | | - "\n", |
74 | | - "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))\n", |
75 | | - "\n", |
76 | | - "# Outlet temperatures over time\n", |
77 | | - "ax1.plot(time, signals[0], label=\"Hot outlet\")\n", |
78 | | - "ax1.plot(time, signals[1], label=\"Cold outlet\")\n", |
79 | | - "ax1.axhline(370, color=\"gray\", ls=\"--\", alpha=0.4, label=\"Hot inlet\")\n", |
80 | | - "ax1.axhline(290, color=\"gray\", ls=\"-.\", alpha=0.4, label=\"Cold inlet\")\n", |
81 | | - "ax1.set_xlabel(\"Time [s]\")\n", |
82 | | - "ax1.set_ylabel(\"Temperature [K]\")\n", |
83 | | - "ax1.set_title(\"Outlet Temperatures\")\n", |
84 | | - "ax1.legend()\n", |
85 | | - "ax1.grid(True, alpha=0.3)\n", |
86 | | - "\n", |
87 | | - "# Steady-state temperature profile along the exchanger\n", |
88 | | - "state = hx.engine.x0\n", |
89 | | - "T_h_profile = state[0::2]\n", |
90 | | - "T_c_profile = state[1::2]\n", |
91 | | - "cells = np.arange(1, len(T_h_profile) + 1)\n", |
92 | | - "\n", |
93 | | - "ax2.plot(cells, T_h_profile, \"o-\", label=\"Hot stream\")\n", |
94 | | - "ax2.plot(cells, T_c_profile, \"s-\", label=\"Cold stream\")\n", |
95 | | - "ax2.set_xlabel(\"Cell number\")\n", |
96 | | - "ax2.set_ylabel(\"Temperature [K]\")\n", |
97 | | - "ax2.set_title(\"Temperature Profile (Steady State)\")\n", |
98 | | - "ax2.legend()\n", |
99 | | - "ax2.grid(True, alpha=0.3)\n", |
100 | | - "\n", |
101 | | - "plt.tight_layout()\n", |
102 | | - "plt.show()" |
103 | | - ] |
| 71 | + "source": "time, signals = scp.read()\n\nfig, ax = plt.subplots(figsize=(8, 5))\n\nax.plot(time, signals[0], label=\"Hot outlet\")\nax.plot(time, signals[1], label=\"Cold outlet\")\nax.axhline(370, color=\"gray\", ls=\"--\", alpha=0.4, label=\"Hot inlet\")\nax.axhline(290, color=\"gray\", ls=\"-.\", alpha=0.4, label=\"Cold inlet\")\nax.set_xlabel(\"Time [s]\")\nax.set_ylabel(\"Temperature [K]\")\nax.set_title(\"Heat Exchanger Outlet Temperatures\")\nax.legend()\nax.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()" |
104 | 72 | }, |
105 | 73 | { |
106 | 74 | "cell_type": "markdown", |
|
0 commit comments