<jupyter_start><jupyter_text>Using superposition to add a vortex and a sink!<jupyter_code># define the source and sink
strength_sink = -1.0
x_sink, y_sink = 0.0, 0.0

# Create the functions for the source and sink
def get_velocity_sink(strength, xs, ys, X, Y):
    u=strength/(2*math.pi)*(X-xs)/((X-xs)**2+(Y-ys)**2)
    v=strength/(2*math.pi)*(Y-ys)/((X-xs)**2+(Y-ys)**2)
    return u, v

def get_stream_function_sink(strength, xs, ys, X, Y):
    psi = strength/(2*math.pi)*numpy.arctan2((Y-ys), (X-xs))
    return psi
# compute the velocity field on the mesh grid
u_sink, v_sink = get_velocity_sink(strength_sink, x_sink, y_sink, X, Y)

# compute the stream-function on the mesh grid
psi_sink = get_stream_function_sink(strength_sink, x_sink, y_sink, X, Y)
u=u_vortex+u_sink
v=v_vortex+v_sink
psi=psi_vortex+psi_sink

# plot the streamlines
width = 10
height = (y_end - y_start) / (x_end - x_start) * width
pyplot.figure(figsize=(width, height))
pyplot.xlabel('x', fontsize=16)
pyplot.ylabel('y', fontsize=16)
pyplot.xlim(x_start, x_end)
pyplot.ylim(y_start, y_end)
pyplot.streamplot(X, Y, u, v, density=2, linewidth=1, arrowsize=1, arrowstyle='->')
pyplot.scatter(x_vortex, y_vortex, color='#CD2305', s=80, marker='o');
from IPython.display import YouTubeVideo
from datetime import timedelta

start=int(timedelta(hours=0, minutes=4, seconds=25).total_seconds())

YouTubeVideo("loCLkcYEWD4", start=start)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15250696378830084, 'fraction_numerical': 0.023676880222841225, 'mean_word_length': 6.044117647058823, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '168574', 'license': 'MIT', 'n_tokens_mistral': 627, 'n_tokens_neox': 588, 'n_words': 128, 'path': 'MAE6226/Lesson_4.ipynb', 'repo_name': 'Zach-Switzer/AeroHydro', 'size': '1436'}