How to apply an equation to each element in the array?

3 views (last 30 days)
KarolN
KarolN on 27 Nov 2021
Commented: KarolN on 28 Nov 2021
I have an equation:
Which I need to apply to every element in a 10x10 matrix of u.
u - a node in numerical model of rock layer
j,n - indexes of movement
The matrix is supposed to have identical starting values of 80.

Accepted Answer

Matt J
Matt J on 27 Nov 2021
conv( u , [0 1 0]+alpha*[1 -2 1] )
  5 Comments
KarolN
KarolN on 28 Nov 2021
IT WORKS! Thank you very much for your valuable advice!

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 28 Nov 2021
Try conv2():
k = 10^-7 % filtration of soil
M = 19000
q = 80 % external force Q acting on soil
DeltaZ = 0.1 % depth of soil subsidization
GammaW = 10 % water weight [Kn/m^3]
Cv = k*M/GammaW % consolidation factor
DeltaT = DeltaZ^2/(2*Cv) % max iteration step
alpha = Cv*DeltaT/DeltaZ^2
% NUMERICAL PARAMETERS
u = q*ones(10:10) % matrix of u nodes
% SOLUTION
kernel = [0, 1, 0] + alpha * [1, -2, 1]
% Discrete form of the governing equation:
soilSub = conv2(u, kernel) % Use conv2(), not conv()
  4 Comments
KarolN
KarolN on 28 Nov 2021
And so additionally I learned about that vote feat :) Voted for both of you naturally. Thanks guys

Sign in to comment.

Categories

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!