Unable to resolve the name results.NodalSolution.

3 ビュー (過去 30 日間)
Shreya George
Shreya George 2021 年 1 月 25 日
コメント済み: Shreya George 2021 年 1 月 27 日
I am using R2020b. While solving a PDE with myufunction for updating the boundary condition at each iteration, I keep getting the error message 'Unable to resolve the name results.NodalSolution'. Any help is welcome.
  3 件のコメント
Shreya George
Shreya George 2021 年 1 月 26 日
model=createpde;
gm=importGeometry(model,'tankdimension3d.stl');
pdegplot(gm,'FaceLabels','on','FaceAlpha',0.5)
phi=zeros(25,205);
for i=1:25
applyBoundaryCondition(model,'dirichlet','Face',6,'u',phi(i,:));
applyBoundaryCondition(model,'dirichlet','Face',1,'u',0);
applyBoundaryCondition(model,'neumann','Face',2:5,'g',0.00484);
myufunction = @(location,state)phi(i,:);
applyBoundaryCondition(model,'dirichlet','Face',6,...
'u',myufunction,...
'Vectorized','on');
specifyCoefficients(model,'m',0,'d',0,'c',1,'a',0,'f',0);
generateMesh(model,'Hmax',1);
result= solvepde(model);
u=results.NodalSolution;
k1=0.2*0.01505;
phi(i+1)=phi(i)+k1;
end
pdeplot3D(model,'ColorMapData',u)
Shreya George
Shreya George 2021 年 1 月 26 日
This was the code for the stl file
x=[-5
5
5
-5
-5
5
5
-5];
y=[-2
-2
2
2
-2
-2
2
2];
z=[-5
-5
-5
-5
0
0
0
0];
v = [x(:) y(:) z(:)];
V=v*1000;
faces=zeros(12,3);
faces(1,:)=[1, 2, 3];
faces(2,:)=[1, 3, 4];
faces(3,:)=[1, 2, 6];
faces(4,:)=[1, 6 ,5];
faces(5,:)=[2, 3, 7];
faces(6,:)=[2, 7, 6];
faces(7,:)=[3, 4, 8];
faces(8,:)=[3, 8, 7];
faces(9,:)=[4, 5, 8];
faces(10,:)=[4, 1, 5];
faces(11,:)=[5, 6 7];
faces(12,:)=[5, 7, 8];
T=[1 2 3
1 3 4
1 2 6
1 6 5
2 3 7
2 7 6
3 4 8
3 8 7
4 5 8
4 1 5
5 6 7
5 7 8];
TR=triangulation(T,v);
a = 1;
shp = alphaShape(x,y,z,a)
[faces, v] = boundaryFacets(shp);
fv.faces = faces;
fv.vertices = v;
trisurf(T,x,y,z);
stlwrite(TR,'tankdimension3d.stl')

サインインしてコメントする。

採用された回答

Ravi Kumar
Ravi Kumar 2021 年 1 月 26 日
You have a typo. It should be u=result.NodalSolution; not u=results.NodalSolution;
Regards,
Ravi
  1 件のコメント
Shreya George
Shreya George 2021 年 1 月 27 日
Thank you for the help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral PDEs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by