# Stress vs time plot at Quadrature Points in FEniCS

**URL:** <https://fenicsproject.discourse.group/t/stress-vs-time-plot-at-quadrature-points-in-fenics/11224>\
**Category:** General\
**Created:** [May 20, 2023, 2:25pm UTC](https://fenicsproject.discourse.group/t/stress-vs-time-plot-at-quadrature-points-in-fenics/11224 "2023-05-20T14:25:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bamirian](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bamirian/32/909_2.png) [@bamirian](https://fenicsproject.discourse.group/u/bamirian)\
**Post date:** [May 20, 2023, 2:25pm UTC](https://fenicsproject.discourse.group/t/stress-vs-time-plot-at-quadrature-points-in-fenics/11224/1 "2023-05-20T14:25:28Z")

</div>

Hi Everyone,

I need to plot the stress values versus time at each Gauss quadrature point in FEniCS (Version 2019). I have given part of code below for your consideration:

```auto
stress_values = []
W = TensorFunctionSpace(mesh, "P", 1)

while t < tMax:
        print("time: ", t)
        BoundaryU.t = t
        solve(...)
        sigma = as_tensor((1./J)*F[j,k]*P[k,i], (j,i))
        sigma_project = project(sigma, W,...) 

        stress_tensor =
        sigma_project.compute_vertex_values(mesh)

        stress_values.append(stress_tensor)
        Uold.assign(dU)
        t += Dt
stress_values = np.array(stress_values)
time_values = np.linspace(0, tMax, len(stress_values))
plt.plot(time_values, stress_values[:, 0], label="Sigma_xx")
plt.plot(time_values, stress_values[:, 1], label="Sigma_yy")
plt.plot(time_values, stress_values[:, 2], label="Sigma_xy")

```

I also went through the problem solved for the von Mises stress in the “Numerical Tour…” by Jeremy; however, I still have some problems for implementation. Could you please direct me to the appropriate course of actions regarding this? I do appreciate your time and help.
