# Graphical Representation of Shape Functions for a Canonical Quadrilateral Element

20 visualizzazioni (ultimi 30 giorni)
Jose vieira de neto il 29 Mar 2020
Hi! I am a beginner user, I would like to plot a Quadrilateral shape function that I am studing. I know the theoretical functions and the graphical results (show bellow) but I am failing to plot the same graphics.
Just the first plot seems to be correct.
[s,t]=meshgrid(0:0.1:1,0:0.1:1)
N1=(1/4)*(t-1)*(s-1);
subplot(2,2,1)
surf(s,t,N1)
[s,t]=meshgrid(0:0.1:1,0:0.1:1)
N2=@(s,t)(1/4)*(t+1)*(s-1);
subplot(2,2,2)
surf(s,t,N2(s,t))
[s,t]=meshgrid(0:0.1:1,0:0.1:1)
N3=@(s,t)(1/4)*(t+1)*(s+1);
subplot(2,2,3)
surf(s,t,N3(s,t))
[s,t]=meshgrid(0:0.1:1,0:0.1:1)
N4=@(s,t)(-1/4)*(t-1)*(s+1);
subplot(2,2,4)
surf(s,t,N4(s,t)
Thank you.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Precise Simulation il 5 Mag 2020
Modificato: Precise Simulation il 5 Mag 2020
1. The local coordinates should go from -1..1 (not 0..1).
2. Switch order for the local coordinates 1+/-s/t (not s/t+/-1).
3. Use the elemetwise product operator ".*" between s/t (s and t are matrices and using "*" will result in matrix multiplication which is not correct).
[s,t] = meshgrid(-1:0.1:1,0:0.1:1);
N1 = 1/4*(1-t).*(1-s);
subplot(2,2,1)
surf(s,t,N1)
N2 = @(s,t)1/4*(1-t).*(1+s);
subplot(2,2,2)
surf(s,t,N2(s,t))
N3 = @(s,t)1/4*(1+t).*(1+s);
subplot(2,2,3)
surf(s,t,N3(s,t))
N4 = @(s,t)1/4*(1+t).*(1-s);
subplot(2,2,4)
surf(s,t,N4(s,t))
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Jose vieira de neto il 7 Mag 2020
Thanks Precise Simulation. It was I needed.

Accedi per commentare.

### Categorie

Scopri di più su Surface and Mesh Plots in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by