{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


You only need to evaluate it in your mesh plot

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sh) % Plot solutions figure(1),clf subplot(1,2,1) mesh(x,t,u1),hold on xlabel('x','fontsize',12,'fontweight','bold') ylabel('t','fontsize',12,'fontweight','bold') zlabel('u(x,t)','fontsize',12,'fontweight','bold') title(['Numerical Solution '],'fontsize',12,'fontweight','bold') subplot(1,2,2) mesh(x,t,U) xlabel('x','fontsize',12,'fontweight','bold') ylabel('t','fontsize',12,'fontweight','bold') zlabel('u(x,t)','fontsize',12,'fontweight','bold') title(['Analytical Solution'],'fontsize',12,'fontweight','bold') function [U,t,x]=wave(a,f,u0,v0,g1,g2,L,T,nx,nt) % Define important parameters % Construct your mesh and matrix of solution points % Compute the solution at t=0 and all x-points % Compute the solution at t=dt and all x-points % Compute the solution at all other times...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online