/Scalar-and-Vector-Field-Visualization-with-Julia

Repository contains code and visualizations that demonstrate concepts of scalar and vector fields using the Julia programming language. Explore 3D surface plots and 2D contour plots showcasing scalar fields, and delve into vector field properties like divergence and curl.

Primary LanguageJupyter Notebook

Scalar-and-Vector-Field-Visualization-with-Julia

Repository contains code and visualizations that demonstrate concepts of scalar and vector fields using the Julia programming language. Explore 3D surface plots and 2D contour plots showcasing scalar fields, and delve into vector field properties like divergence and curl. The repository includes examples of automatic differentiation and manual calculations, utilizing Julia packages like Plots.jl and CalculusWithJulia.jl. Ideal for learning and practicing field visualization techniques in a real-world context. Perfect for students, researchers, or anyone interested in computational physics or applied mathematics.

Question 1 - Scalar Field and Gradient:

  1. Scalar Field: A scalar field assigns a scalar value to each point in space. In this question, the scalar field is defined by the function h(x, y) = 200 - x^2 - 2y^2, representing the height of a hill.

  2. Visualization: You're asked to visualize the scalar field using both a 3D surface plot and a 2D contour plot. This helps you see how the height changes across the domain.

  3. Gradient: The gradient of a scalar field is a vector that points in the direction of the steepest increase of the field and has a magnitude proportional to the rate of change. You can calculate the gradient using automatic differentiation tools or manually calculate it.

  4. Visualization of Gradient: You're asked to visualize the gradient vector field using plots. This helps you understand how the slope changes at different points on the hill.

Question 2 - Vector Field, Divergence, and Curl:

  1. Vector Field: A vector field assigns a vector to each point in space. The given vector field f = (ex * y^2, (x + 2y)e2) represents the velocity of water particles in a pond.

  2. Visualization: You're asked to visualize the vector field using plots. This helps you see the flow patterns of the water particles in the pond.

  3. Divergence: Divergence measures how much a vector field flows outward or inward from a point. You can calculate divergence using automatic tools or manually calculate it.

  4. Visualization of Divergence: You're asked to visualize the divergence of the vector field and compare it with the manually calculated divergence. This helps you understand how the water is diverging or converging at different points.

  5. Curl: Curl measures the rotation or circulation of a vector field around a point. Similar to divergence, you can calculate curl using automatic tools or manual calculations.

  6. Visualization of Curl: You're asked to visualize the curl of the vector field and compare it with the manually calculated curl. This helps you understand how the water particles are rotating at different points.