How to correctly implement a formula that describes the deformation of a plate
Show older comments
Hello,
I tried to implement the following formula into Matlab:

First I tried to do it with symbolic variables like this (obviously i put values on the parameters and declared the symbolic variables n, N, m, M, x, y and w):
w = ((16.*q)./(K.*pi.^6)).*symsum(subs(symsum(subs((1./(m.*n.*(((m.^2)./(a.^2)) + ((n.^2)./(b.^2))))).*sin(x.*sym(3.14159)./a).*sin(y.*n.*sym(3.14159)./b), n, 2.*N-1), N, 1, 10), m, 2.*M-1), M, 1, 10);
but when I tried to display w, it seemed that Matlab didn't calculate it all the way.
So i tried it the numerical way (again the parameters were declared before):
k = 41;
x1 = linspace(0, a, k);
x2 = linspace(0, b, k);
[X, Y] = meshgrid(x, y);
w = zeros(k,k);
for m=1:2:21
for n=1:2:21
w = w + 1./(m.*n.*(((m.^2)./(a.^2))+((n.^2)./(b.^2)))).*sin(X.*m.*pi./a).*sin(Y.*n.*pi./b) ;
end
end
w = ((16*q)/(K*pi^6))*w;
I get results that way but they vary when I change the value for k. But k should only help with the meshgrid and the size of the matrix of w. Why does it change the values for w at the same place (for example the center)? What have I done wrong?
1 Comment
Simson Hutagalung
on 24 Jun 2022
How to generate deformation colormap 2D in matlab with data from excel?
Accepted Answer
More Answers (1)
David Hill
on 1 Mar 2022
a=10;b=15;q=5;k=41;%do not know values
[m,n]=meshgrid(1:2:1000);
w=@(x,y)16*q/k/(pi^6)*sum(1./(m.*n.*(m.^2/a^2 + n.^2/b^2).^2).*sin(pi*m*x/a).*sin(pi*n*y/b),'all');
[X, Y] = meshgrid(linspace(0, a, k), linspace(0, b, k));
W=zeros(k);
for ii=1:numel(X)
W(ii)=w(X(ii),Y(ii));
end
Categories
Find more on Elementary Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!