Skip to main content
added 191 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
Plot[Evaluate[Eigenvalues[M1]], {t, 0, 10}, PlotLegends -> "Expressions"]

enter image description here

sumofnegativeeigenvalues = Total @ - Ramp @ - Eigenvalues[M1]
-2 Ramp[30 - t] - 
 Ramp[1/2 (-1 - 7 t - Sqrt[1 - 6 t + 9 t^2 + 4 t^4])] - 
 Ramp[1/2 (-1 - 7 t + Sqrt[1 - 6 t + 9 t^2 + 4 t^4])]

Plot[sumofnegativeeigenvalues, {t, 0, 10}, AxesOrigin -> {0, 0}]

enter image description here

Alternatively,

ClearAll[sumNegEigenVals]
sumNegEigenVals = Eigenvalues /* Minus /* Ramp /* Minus /* Total;

sumNegEigenVals @ M1 == sumofnegativeeigenvalues
True
Plot[Evaluate[Eigenvalues[M1]], {t, 0, 10}, PlotLegends -> "Expressions"]

enter image description here

sumofnegativeeigenvalues = Total @ - Ramp @ - Eigenvalues[M1]
-2 Ramp[30 - t] - 
 Ramp[1/2 (-1 - 7 t - Sqrt[1 - 6 t + 9 t^2 + 4 t^4])] - 
 Ramp[1/2 (-1 - 7 t + Sqrt[1 - 6 t + 9 t^2 + 4 t^4])]

Plot[sumofnegativeeigenvalues, {t, 0, 10}, AxesOrigin -> {0, 0}]

enter image description here

Plot[Evaluate[Eigenvalues[M1]], {t, 0, 10}, PlotLegends -> "Expressions"]

enter image description here

sumofnegativeeigenvalues = Total @ - Ramp @ - Eigenvalues[M1]
-2 Ramp[30 - t] - 
 Ramp[1/2 (-1 - 7 t - Sqrt[1 - 6 t + 9 t^2 + 4 t^4])] - 
 Ramp[1/2 (-1 - 7 t + Sqrt[1 - 6 t + 9 t^2 + 4 t^4])]

Plot[sumofnegativeeigenvalues, {t, 0, 10}, AxesOrigin -> {0, 0}]

enter image description here

Alternatively,

ClearAll[sumNegEigenVals]
sumNegEigenVals = Eigenvalues /* Minus /* Ramp /* Minus /* Total;

sumNegEigenVals @ M1 == sumofnegativeeigenvalues
True
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

Plot[Evaluate[Eigenvalues[M1]], {t, 0, 10}, PlotLegends -> "Expressions"]

enter image description here

sumofnegativeeigenvalues = Total @ - Ramp @ - Eigenvalues[M1]
-2 Ramp[30 - t] - 
 Ramp[1/2 (-1 - 7 t - Sqrt[1 - 6 t + 9 t^2 + 4 t^4])] - 
 Ramp[1/2 (-1 - 7 t + Sqrt[1 - 6 t + 9 t^2 + 4 t^4])]

Plot[sumofnegativeeigenvalues, {t, 0, 10}, AxesOrigin -> {0, 0}]

enter image description here