Hi Justin,

I think the answer is no.

I see Expression as a means to execute a simple piece of C code to interpolate into a 'CG' or 'DG' field.  Certain variables are always available to you (the coordinate field x[0], x[1], x[2], and the value pi), along with functions from math.h, and you can pass in your own constants, e.g.

expr = Expression("cos(2.0*pi*(x[0] - t))", t=t)

What is the exact [mathematical] operation you are trying to do?  There might be an easy way to do what you want.

On 8 December 2015 at 22:39, Justin Chang <jychang48@gmail.com> wrote:
sorry, I meant alpha = Expression("exp(Beta*solution)",Beta=beta,solution=u)

On Tue, Dec 8, 2015 at 3:38 PM, Justin Chang <jychang48@gmail.com> wrote:
Hi all,

As the title states, can a Function solution be used in an Expression?

Say I have the following:

beta = 0.001
u = Function(Q)
alpha = Expression("exp(Beta*solution)",Beta=Betasolution=u)

When I try to run this, I get an error saying "ValueError: setting an array element with a sequence". Am I not doing something correctly or is it simply not possible to do include u into an Expression?

Thanks,
Justin