# calculate the maximum shear stress

Hi everyone,

I want to calculate the maximum shear stress and find that there is some wrong with the angle θ in the formula as it need to calculate the acos(x),like this command,

variable O atom “acos(v_R/sqrt(-1*v_Q)^3)”

the result said that

ERROR: Invalid syntax in variable formula (…/variable.cpp:3139)

I tried to change the denominator to forbid the v_O overflows from -1 to 1, but it still doesn’t matter. How do you resolve this problem or is there any other solution to calculate the maximum shear stress.

Best wishes!

Hi everyone,

I want to calculate the maximum shear stress and find that there is some
wrong with the angle θ in the formula as it need to calculate the
acos(x),like this command,

variable O atom "acos(v_R/sqrt(-1*v_Q)^3)"

the result said that

ERROR: Invalid syntax in variable formula (../variable.cpp:3139)

​i cannot reproduce this error from the formula above. the error message
indicates that you may have mismatched parenthesis.​ please carefully
check, that your input is using the exact same formula and that all symbols
and characters are ASCII.

axel.

Hi Axel,

Thank you for your suggestion and I have solved this problem successfully, but I met another problem, I need to choose the maximum principle stress and the minimum principle stress use the command

variable st1 atom max(v_R1,v_R2,v_R3)

variable st2 atom min(v_R1,v_R2,v_R3)

while the output error detail is

ERROR: Invalid special function in variable formula (…/variable.cpp:3903)

I think that maybe the reason the max() function output the scalar not the vector leading to which cant dump it, so what can I do to make it

Best wishes!

Hi Axel,

Thank you for your suggestion and I have solved this problem successfully,
but I met another problem, I need to choose the maximum principle stress
and the minimum principle stress use the command

variable st1 atom max(v_R1,v_R2,v_R3)

variable st2 atom min(v_R1,v_R2,v_R3)
while the output error detail is

ERROR: Invalid special function in variable formula (../variable.cpp:3903)

http://lammps.sandia.gov/doc/variable.html