Hi, I have a problem with trying to get my variational problem to work correctly. I have
\partial_{L} P(L, \mathbf{x})=(\nabla \cdot \mathbf{a} \nabla+\mathbf{c} \cdot \nabla) P(L, \mathbf{x})
with
\mathbf{a}=\left[\begin{array}{ccc}\frac{A_{5}^{2} z^{2}}{2} & 0 & \frac{A_{5}^{2} x z}{2} \\ 0 & \frac{1}{2}\left(A_{1}^{2}+A_{2}^{2}+A_{3}^{2} \frac{z^{2}}{x^{2}}\right) & 0 \\ \frac{A_{3}^{2} x z}{2} & 0 & \frac{A_{2}^{2} x^{2}}{2}\end{array}\right], \quad \mathbf{c} = \begin{bmatrix}-A_4x \\ 0 \\ A_4z\end{bmatrix}.
My variational problem is then
\frac{P^{n+1}-P^{n}}{\Delta L} \approx(\nabla \cdot \mathbf{a} \nabla+\mathbf{c} \cdot \nabla) P^{n+1},
so
\int_{\Omega}\left(v(\mathrm{x}) P^{n+1}+\Delta L \mathrm{S}\right) d \mathrm{x}=\int_{\Omega} v(\mathrm{x}) P^{n} d \mathrm{x},
with
\mathrm{S}=\nabla v(\mathrm{x}) \cdot \mathrm{a} \nabla P^{n+1}-v(\mathrm{x}) \mathrm{c} \cdot \nabla P^{n+1}.
Furthermore
\begin{aligned} a(P, v) &=\int_{\Omega}(v(\mathbf{x}) P+\Delta L \mathbf{S}) d \mathbf{x} \\ L_{n+1}(v) &=\int_{\Omega} v(\mathbf{x}) P^{n} d \mathbf{x} \end{aligned}.
I try to formulate the problem in python as
a = np.array([[0.5*A_3**2*x[2]**2,0,0.5*A_3**2*x[0]*x[2]],[0,0.5*(A_1**2+A_2**2+A_3**2*(x[2]/x[0])**2),0],[0.5*A_3**2*x[0]*x[2],0,0.5*A_3**2*x[0]**2]])
cee = np.array([-0.5*A_3**2*x[0]+(A_3**2/2-A_4)*x[0], -A_5, -0.5*A_3**2*x[2]+(A_3**2/2+A_4)*x[2]])
a_grad_u = np.multiply(a,grad(u))
c_dot_grad_u = cee.dot(grad(u))
S = np.dot(grad(v),a_grad_u) - np.multiply(v,c_dot_grad_u)
a_form = (u*v + dl*(S))*dx
L_form = u_n*v*dx
Next I have
L = .2 #Final L
num_steps = 10 #Number of length steps
dl = L / num_steps #Length step size
then I solve
for n in range(num_steps):
#Update current lengthj
l += dl
#Solve
solve(a_form == L_form, u)
#Update previous solution
u_n.assign(u)
but I get the error
line 227, in solve
return dolfin.la.solver.solve(*args)
TypeError: solve() missing 1 required positional argument: ‘b’
Have I input my \mathbf{S} incorrectly? I feel like I’m making a really dumb mistake.