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

조회 수: 5 (최근 30일)
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)

답변 (1개)

Ravi Kumar
Ravi Kumar 2023년 11월 15일
https://www.mathworks.com/help/pde/ug/assemblefematrices.html#mw_c59ea87b-8f13-478a-b33d-351795b1572f
  댓글 수: 2
Giacomo Marco La Montagna
Giacomo Marco La Montagna 2023년 11월 16일
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 2023년 11월 16일
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)

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by