How to set state.u state.t in PDE Toolbox's function assmbleFEMatrixes for a generic 2D problem?

4 views (last 30 days)
I am facing a 2D diffusion equation of a two-components vectorial field u=(u1,u2) with finite elements method. I need to extract the finite element matrixes by calling the function FEM = assembleFEMatrices(___,state) but to do it I need to set state.u and state.t. In all examples I saw that you can use a previus solution but in my case I can't use it because the solver does not converge ( this is why I am extracting these matrixes, my idea is to apply a custom solver to the ode system provided by FEM) so how can I set this two parameters?
%extracting FEM matrixes
state.u = ?
state.t = ?
FEM = assembleFEMatrices(model,state)

Answers (1)

Ravi Kumar
Ravi Kumar on 15 Nov 2023
https://www.mathworks.com/help/pde/ug/assemblefematrices.html#mw_c59ea87b-8f13-478a-b33d-351795b1572f
  2 Comments
Giacomo Marco La Montagna
Giacomo Marco La Montagna on 16 Nov 2023
I've already checked the documentation but I would set state.u and state.t having no access to previous solutions...
Giacomo Marco La Montagna
Giacomo Marco La Montagna on 16 Nov 2023
this is the error I get if I omit to specify the state
Error using pde.EquationModel/assembleFEMatricesInternal
For a nonlinear model, the last argument must be a structure array with the solution data as its 'u' field.
Error in assembleFEMatrices (line 115)
FEMatricesOut = assembleFEMatricesInternal(pdem,BCEnforcementOption,matrix,state);
Error in PDEexample2 (line 43)
FEM = assembleFEMatrices(model)

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!