dear colleague, I would like to create a matlab script that allows the calculation of matrices (finite elements) by varying the number of elements of the rectangular mesh. But I don't know how to proceed need help?
Thank you thank you dear Ecric, your instructions are very enriching. You have exactly hit the crux of the problem that worries me. indeed, I am blocked on the creation of the matrix A of the first member. I used the rectangular method in solving my equation, so I need to generate a script to finalize my calculations by hand and draw the curve.
Also I would like to know, when you say A=zeros(n,n) what does it mean exactly?
This code defines an array num_elements containing the number of elements to try, initializes an array results to store the results, and uses a for loop to iterate over the different values of num_elements. At each iteration, it calls the calculateMatrix function to calculate the matrix for the current number of elements and stores the result in the results array. Finally, it plots the results using the plot function.
You will need to define the calculateMatrix function yourself to perform the actual matrix calculation. This function should take a single input, the number of elements, and return the calculated matrix as the output.
the elements of my matrix diagonal , sub diagonal and sub diagonal, have different values. such as 1, 1,1,1,0,111,0... n . What syntax should I use on matlab???
you should define the rectangular mesh by setting its dimensions and number of elements, then divide the mesh into smaller elements, for example:
L = 1;
numberElementsX=8;
numberElementsY=8;
numberElements=numberElementsX*numberElementsY;
Calculate the stiffness matrix using numerical integration techniques and specify boundary conditions. Repeat the calculation for different number of elements by including a loop if needed.