This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Real numbers as exponent in a form

0 votes

I'm trying to solve the equation
$$ \frac{d}{dt} f(y,t) + \frac{d}{dy} {J(y)(2-q)f(y,t)} + \frac{d^2}{{dy}^2} {D{f(y,t)}^{2-q}} $$
with Fenics. I discretised the time derivative as described in the heat equation tutorial and
arrived at this form:

F = (u-u_n)*v*dx + dt*pow(u, 1-q)*Dx(u,0)*Dx(v,0)*dx + dt*J*u*Dx(v,0)*dx

or alternatively instead of dt*pow(u, 1-q)*Dx(u,0)*Dx(v,0)*dx is also tried

dt*Dx(u**(2-q),0)*Dx(v,0)*dx

withouth applying the chain rule here. Unfortunately Fenics complains for the forms since
it won't accept real numbers for q. Is there any way around this?

asked Apr 26, 2017 by thecruuk FEniCS Novice (160 points)

Please post a minimal (non)working example. You should be able to use real numbers in exponents.

...