代写ME2623 Engineering Mathematics and Programming代做R编程

Module Code: ME2623

Module Title: Engineering Mathematics and Programming

Assessment Title: Solving the 2D Wave Equation Using the Finite Difference Method

Weighting: 40%

Main objectives of the assessment:

To develop and document a MATLAB program that solves the 2D wave equation using the finite difference method, demonstrating an understanding of numerical methods, code implementation, and validation techniques.

Brief Description of the assessment:

The student is required to develop a MATLAB program to solve the 2D wave equation using the finite difference method. Additionally, the student must provide a user guide explaining the functionality of the code, validate its results, and propose potential enhancements for future applications.

Learning outcomes for the assessment:

1.    Understanding of analytical methods that are

useful for Mechanical and Aerospace Engineering

2.    Understanding how to employ programming to solve basic engineering computational problems.

3.    Applying best-practice programming techniques to solve Mathematical models of Engineering

problems.

4.    Understanding the usefulness of programming techniques in the process of solving Engineering problems.

5.    Presenting computational results in a clear and concise manner including validation and

verification.

Assessment and marking criteria

This assignment will be assessed based on several criteria, each contributing to the final grade as

indicated by the percentage in brackets:

Explaining the interface (20%)

Providing a quickstart example (20%)

Code annotation (20%)

Verification and validation (20%)

Suggesting future extensions (10%)

Including an appendix with the code (10%)

Your submission will be assessed based on:

•     Accuracy   and    stability of the    numerical implementation.

•     Clarity    and    comprehensiveness    of your documentation.

•     Creativity     and     feasibility     of     proposed extensions.

Assessment method by which a student can demonstrate learning outcomes:

Completion of the assignment defined above, which must be submitted via WISEflow for marking.

Format for the assessment/coursework (Guidelines on the expected format and length of submission):

The university takes academic misconduct very seriously. Further information about this subject can be found here:

• Senate regulation 6: https://www.brunel.ac.uk/about/documents/pdf/Senate-Regulation-6-2020-07-01.pdf

• Library: https://www.brunel.ac.uk/life/library/SubjectSupport/Plagiarism

The university’s policy on using artificial intelligence in your studies can be found here:

https://students.brunel.ac.uk/study/using-artificial-intelligence-in-your-studies

Distribution date to students: 6th December 2024

Submission Deadline: 6th January 2025

Indicative Reading List:

Further information:

Assignments must be submitted to WISEflow in PDF format (unless stated otherwise), using Arial size

11 font and limited to no more than three pages. Students are strongly advised to submit their assignments well ahead of the deadline.

Late submissions are subject to penalties.

Assignment Brief

Solve the following free-vibration 2D hyperbolic equation using the finite difference method:


Initial condition:


Boundary condition:

u(0,y, t)=u(1,y, t)=u(x,0, t)=u(x,1, t)=0,    t>0

Stability condition:

It is suggested that Δx=ΔY. Ensure your numerical scheme satisfies the explicit stability condition:

Note: the stability condition of the explicit time scheme of the 2D wave equation

Using afunction with the following interface,

function u = solve_wave_eq(uinitial,c, Lx, Ly, Mx, My,maxIter,showplot)

Where:

Inputs

u_initial

Initial displacement field (size MX XMY) representing u(x,y,0) .

c

Wave speed (c= 1.5).

Lx,Ly

Length of the domain in the x andy directions

Mx,My

Number of cells in the andy directions (e.g., MX=20, MY=20).

dt

Time step size (must satisfy the stability condition)

maxIter

Maximum number of time steps to solve

showplot

Boolean flag to enable/disable plotting of the wave

Output

u

Final displacement field after solving the 2D wave equation for maxIter steps

Task

1. Explain the Interface

1.1  Describe what an interface is in computing and explain the scope of the function in terms of its inputs and outputs.

1.2  Detail the shapes of uinitial and the returned u.

2. Quickstart Example

2.1 Write a quickstart guide explaining how to use the function. Include at least one example test case

(e.g.,   u initial=s in(2mx).s in(4my),     L X=LY=1,    MX=MY= 20)

2.2  Include plots showing the wave propagation at various time steps, and explain the physical significance of these results.

2.3  If the code doesn’t work as expected, explain what behaviour you would anticipate.

3. Code Annotation

3.1 Choose two critical snippets of code and describe how they work:

3.1.1 Calculating u at the next time step using the finite difference method. 3.1.2 Implementing the boundary conditions.

4. Verification and Validation

4.1  Discuss how you verified and validated the code.

Verification: Ensuring the code is solving the equations correctly (e.g., stability tests).

Validation: Confirming the code produces realistic and accurate results (e.g., comparing to analytical solutions or expected behaviours).

4.2 Suggest  at  least  one  validation  case   (e.g., u(x,y,0)=s in(2mx).s in(4my)) and  comparing  with analytical solutions for specific times).

5. Future Extensions

5.1 Suggest  possible  extensions  to  the  code   (e.g.,  adding  absorbing   boundary  conditions,   modelling nonlinear waves, or introducing energy loss). Briefly explain how these could be implemented.

6. Appendix

6.1  Include the full MATLAB code as an appendix. Ensure the code is thoroughly commented to describe each step.

Example Test Case:

Run the following scenario to validate your code:

u initial(x, y)=s in(2nx).s in(4ny)

L X=LY=1

MX=MY=20

●    dt= 0.002 (ensuring stability condition is met)

max lter= 100

Visualize the results in several time steps (e.g., t=0,0.02,0.04) and describe the behaviour of the wave.

Code Requirements:

i.        Use the explicit finite difference method to solve the wave equation.

ii.        Implement fixed boundary conditions as specified.

iii.        Include input validation to check:

•     dt satisfies the stability condition.

u_initial matches the size Mx × My .

•     All inputs are numeric and have appropriate dimensions.

Suggestions:

i.        Format your submission to include the required sections: Interface explanation, quickstart example, annotated code, verification/validation, and future extensions.

ii.        Use plots and error analysis from the code to support your explanations.

iii.        Ensure the MATLAB code is included as an appendix with additional comments if necessary.

Notes:

i.        Refer to lecture slides, textbooks, or MATLAB documentation if needed.

ii.        Unit tests are encouraged to ensure correct implementation.

MATLAB Code

clc; clear all; close all;

%2D WAVE EQUATION utt = c^2(uxx+uyy)

%with initial condition  u(x,y,0) = sin(p*pi*x)*sin(q*pi*y), 0 0 % and boundary conditions u(0,y,t) = u(1,y,t)= u(x,0,t)= u(x,1,t) = 0 t>0 c = 1.5;

dx = 0.01; dy = dx;

sigma = 1/sqrt(2); gamma = 1/sqrt(2); %Courant-Friedrich Stability Condition dt = sigma*(dx/c);

t = 0:dt:1; x = 0:dx:1; y = 0:dy:1;

u = zeros(length(x),length(y),length(t)); p = 2; q = 4;

u(:,:,1) = transpose(sin(p.*pi.*x))*sin(q.*pi.*y); %u(x,y,0) = sin(p*pi*x)*sin(q*pi*y) %u(x,y,dt)

for i=2:length(x)-1

for j=2:length(y)-1

u(i,j,2)= (sigma^2)*(u(i+1,j,1)-2*u(i,j,1)+u(i-1,j,1))...

+(gamma^2)*(u(i,j+1,1)-2*u(i,j,1)+u(i,j-1,1))+2*u(i,j,1) - u(i,j,1);

end end

for n=2:length(t)-1

for i=2:length(x)-1

for j=2:length(y)-1

u(i,j,n+1)= (sigma^2)*(u(i+1,j,n)-2*u(i,j,n)+u(i-1,j,n))...

+(gamma^2)*(u(i,j+1,n)-2*u(i,j,n)+u(i,j-1,n)) + 2*u(i,j,n) - u(i,j,n-1);

end end

end

%Analytic solution

SOL = zeros(length(x),length(y),length(t)); S = transpose(sin(p.*pi.*x))*sin(q.*pi.*y); for i=1:length(t)

SOL(:,:,i) = S*cos(c.*pi.*(sqrt(p^2+q^2).*t(i)));

end

%Absolute error E = abs(SOL-u);

[X,Y] = meshgrid(x,y);

max_e = max(max(max(E))); for j=1:length(t)

subplot(2,1,1) colormap(cool);

p1 = surf(X,Y,u(:,:,j));

title(sprintf('2D wave equation at t = %1.2f, con sigma = %1.2fy gamma = %1.2f',t(j),sigma, gamma),'Fontsize',11); xlabel('x','Fontsize',11); ylabel('y','Fontsize',11);

zlabel(sprintf('u(x,y,t = %1.2f)',t(j)),'Fontsize',11); axis ([0 1 0 1 -1 1]);

subplot(2,1,2)

p2 = surf(X,Y,E(:,:,j));

title(sprintf('Absolute error at t = %1.2f',t(j)),'Fontsize',11); xlabel('x','Fontsize',11); ylabel('y','Fontsize',11);

zlabel(sprintf('E(x,y,t = %1.2f)',t(j)),'Fontsize',11); axis ([0 1 0 1 0 max_e]);

pause(0.001); hold on;

if(j~=length(t)) delete(p1);

delete(p2);

end end



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图