<div dir="ltr"><div>Another possibility is to use command "bc". The following example finds a and c for an hexagonal lattice, given the cell volume and the c/a ratio<br></div><div><br></div><div>#!/bin/bash</div><div><br></div><div># volume in A^3</div>for volume in 80 90 100 110 120 130<br><div>do</div><div> # csua = c/a<br></div> csua=1.10<br> a=`echo 'e(l('$volume'*2/sqrt(3)/'$csua')/3.0)'| bc -l`<br><div> c=`echo $a'*'$csua| bc -l`</div><div> ...</div><div>done<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 14, 2020 at 10:58 AM Lorenzo Paulatto <<a href="mailto:paulatz@gmail.com">paulatz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Yes it works! Thanks you very much.<br>
> <br>
Iif you need to multiply anything that is not integer, it will not work. <br>
In this case you can define a little function to do the math, like this:<br>
<br>
calc(){ eval awk \'BEGIN{printf \"%12.8f\\n\", $@}\'; }<br>
<br>
alat=10.2<br>
c_over_a=$(calc $alat/6.4)<br>
echo $c_over_a<br>
<br>
<br>
hth<br>
<br>
-- <br>
Lorenzo Paulatto - Paris<br>
_______________________________________________<br>
Quantum ESPRESSO is supported by MaX (<a href="http://www.max-centre.eu/quantum-espresso" rel="noreferrer" target="_blank">www.max-centre.eu/quantum-espresso</a>)<br>
users mailing list <a href="mailto:users@lists.quantum-espresso.org" target="_blank">users@lists.quantum-espresso.org</a><br>
<a href="https://lists.quantum-espresso.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.quantum-espresso.org/mailman/listinfo/users</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,<br>Univ. Udine, via delle Scienze 208, 33100 Udine, Italy<br>Phone +39-0432-558216, fax +39-0432-558222<br><br></div></div></div></div></div>