TheArchitect71 / y-and-p-versus-position

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graph Plotting: Displacement vs. Position and Pressure Fluctuation vs. Position

Overview

This document explains how to plot a graph of displacement y versus position x, and a graph of pressure fluctuation p versus position x at time t = 0, using Python.

Concept

  • The displacement y(x) is modeled as a sine wave: y(x) = A * sin(kx).
  • The pressure fluctuation p(x) is modeled as a cosine wave: p(x) = B * cos(kx).
  • A and B represent the amplitudes, and k is the wave number.

Python Code for Plotting

The following Python script uses Matplotlib to plot these functions

About