Illegal if command

Hello

I used these commands, but I received an “illegal if command” error. what’s the mistake I made in my input file shown in the following:
if “{totalBrokenBonds}==0" && "{T1}>{T2}" then & "print 'the system is still stable because the broken bonds ={totalBrokenBonds}’” &
"variable T1 equal {stemp}" & "variable stemp equal {T1}+400 " &
elif “{totalBrokenBonds}==0" && "{T1}<{T2}" & "variable T1 equal {stemp}” &
“variable stemp equal ({T1}+{T2})/2” &
elif “{totalBrokenBonds}>6" & "variable T2 equal {stemp}” &
“variable stemp equal ({T1}+{T2})/2” &
elif “{totalBrokenBonds}>0" && {totalBrokenBonds}<6” &
“print ‘The critical Temperature is = ${stemp}’” &
“jump 2DDTube.in break”

DP_A_DNT_16_900C.in (3.1 KB)

The if command syntax is: if <boolean> then ... (see if command — LAMMPS documentation)
The boolean expression either must have no blanks or be enclosed in quotes.
But you have if <boolean> && <boolean> then .... Clearly that is not the correct syntax.

P.S. when quoting commands in the forum here, you have to enclose the block in “```” / “```” (like python docstrings) or individual pieces with “`” / “`”

Dear Alex

First of all, thank you for your support. It was really effective, helpful and the simulation worked. However, the results don’t make sense, my aims were not satisfied and I’m very hopeful that I can fix the issue with your help. In my input script, I want to determine the critical temperature at which the system becomes unstable. I measure the stablility of the system by determining the number of broken bonds. I wasn’t able to accomplish this using the “pair-style” command although I need its forces effect. Therefore, I included bonds in my data file and used “bond_style harmonic with K=0” and "special_bonds lj/coul 1.0 1.0 1.0 " in order to suppress its forces effects. I put the results of “fix bond/break” in a variable to count the broken bonds and make LAMMPS decide the next temperature accordingly. The result was the system started rapturing without detecting even one broken bond. is there any mistake I made in my script to have this result
DP_A_DNT_16.data (103.0 KB)
DP_A_DNT_16_1500C.in (2.1 KB)
?

This is a completely different question.
Please post this as a new topic with a corresponding meaningful subject line.
That way people that have similar questions and search the forum or the web can find the discussion more easily and can learn from it instead of having to post the same question(s) again.

Thanks in advance for your cooperation.