28.10.2014 Views

15. Metoda končnih elementov in reševanje BDE in PDE v Matlabu

15. Metoda končnih elementov in reševanje BDE in PDE v Matlabu

15. Metoda končnih elementov in reševanje BDE in PDE v Matlabu

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Matlab implementacija za zgled 1<br />

function [c,f,s] = wavepde(x,t,u,ux)<br />

c = 1;<br />

f = ux;<br />

s = 0;<br />

function [pa,qa,pb,qb] = wavebc(xl,ul,xr,ur,t)<br />

pa = ul;<br />

qa = 0;<br />

pb = ur-1;<br />

qb = 0;<br />

function y = wave<strong>in</strong>i(x)<br />

y = 2*x/(1+x^2);<br />

m = 0;<br />

x = l<strong>in</strong>space(0,1,20);<br />

t = l<strong>in</strong>space(0,2,10);<br />

u = pdepe(m,@wavepde,@wave<strong>in</strong>i,@wavebc,x,t);<br />

surf(x,t,u);<br />

Bor Plestenjak - Numerična analiza 2005/06

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!