Hallo,
ich möchte für das folgende Problem ein Gitter
1. erzeugen und
2.plotten
Dies habe ich wie folgt erfolglos begonnen:
Code:
%fem program, which solves a linear problem on triangles
%3------6------9
%| 4 / | 8 / |
%| / 3 | / 7 |
%2------5------8
%| 2 / | 6/ |
%| / 1 | / 5 |
%1------4------7 % with following boundary conditions:
%----Dirichlet-----------------------
% u(x_1,x_2)=x_2 on the rightEdge % u(x_1,x_2)=0 on the lowerEdge
%----Neumann-------------------------
% du/dn=-x_2 on the leftEdge % du/dn=x_1 on the upperEdge
%************************************
%nNodes number of nodes, nNodes=9
%nElem number of finite elements, nElem=8
%nTria 3xn matrix of all triangles, if n number of triangles
%rightEdge nodes of the right edge
%leftEdge nodes of the right edge
%upperEdge nodes of the right edge
%lowerEdge nodes of the right edge
%nodesOnRiBound vector
%nodesOnLeBound vector
%nodesOnLoBound vector
%nodesOnUpBound vector
nNodes=9;
nTriag=[154;125;265;236;487;458; 598;569];
coordNodes=[00;01/2;01;1/20;1/21/2;1/21;10;11/2;11];
xcoord=coordNodes(:,end-1);
ycoord=coordNodes(:,end);
%[X,Y]=meshgrid(xcoord,ycoord);
%plot(X,Y)
%nTria=zeros(3,8);
rightEdge=[789];
leftEdge=[123];
upperEdge=[369];
lowerEdge=[147];
triplot hast du ja schon gefunden. Ich kannte den Befehl bisher nicht und könnte da auch nur die Dokumentation lesen und mich durch die Beispiele durcharbeiten.
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.