Dear Stephen,<br>
<br>
thanks a lot for your support. I was considering if doing it this way it
would work, now I got my confirmation. Thanks a lot again.<br>
<br>
Best regards,<br>
Bernardo<br><br><br><div class="gmail_quote">2011/2/11 Stephen Montgomery-Smith <span dir="ltr"><<a href="mailto:stephen@missouri.edu" target="_blank">stephen@missouri.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>Bernardo Rocha wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi everyone,<br>
<br>
I've recently discovered GiNaC and I'm really excited about its<br>
capabilities. There is one thing that I would like to know if it is able<br>
to do that I haven't found in the tutorial.pdf or in any other place<br>
that I've searched.<br>
<br>
I would like to know if, given a function \Psi=\Psi(E), like the strain<br>
energy function for the St. Venant-Kirchhoff material<br>
<br>
\Psi(E) = 0.5 * \lambda * (tr E)^2 + \mu E:E<br>
<br>
is it possible to differentiate it with respect to E, that is i would<br>
like to compute \frac{\partial \Psi}{\partial E}. If this is possible,<br>
could someone please send some examples or maybe point to which classes<br>
should I use to do that?<br>
<br>
That's all for now. Many thanks in advance.<br>
<br>
Best regards,<br>
Bernardo M. R.<br>
<br>
<br>
</blockquote>
<br></div></div>
Couldn't you do it this way? Write \Psi(E) as an expression involving the variables e11,e12,e13,...,e33 which are the entries of E. Then compute the partial derivatives \frac{\partial \Psi}{\partial eij} for 1<=i,j<=3. (Presumably you suppose that E is symmetric so only six partial derivatives need to be computed, but even if it is not necessarily symmetric you still only need 9 partial derivatives.) Just store this as something like:<br>
<br>
expr dPsi_dE[3][3]<br>
<br>
or<br>
<br>
vector<expr> dPsi_dE<br>
<br>
or something similar.<br>
<br>
</blockquote></div><br>