File:Method of lines.gif
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this preview: 798 × 599 pixels. Other resolutions: 320 × 240 pixels | 639 × 480 pixels | 840 × 631 pixels.
Original file (840 × 631 pixels, file size: 818 KB, MIME type: image/gif, looped, 100 frames, 5.0 s)
File information
Structured data
Captions
Summary[edit]
DescriptionMethod of lines.gif |
English: Method of lines - the example, which shows the origin of the name of method.
Solid line represents an analytical solution, and lines show evolution in time of numerical solution by means of method of lines. For details see: Schiesser, W. E. (1991) The Numerical Method of Lines, Academic Press ISBN: 0-12-624130-9. Click full resolution to see an animation. The source code: function mol
u = @(t,x)0.5./sqrt(4*t+1)*(exp(3*(2*x+1)/(4*t+1))+2).*exp(-(x+2).^2/(4*t+1));
M = 40;
N = 100;
x = linspace(-5,5,M+1);
y0 = 0.5*exp(-(x-1).^2)+exp(-(x+2).^2);
[t,y] = ode45(@dmol,linspace(0,0.5,N),y0(2:end));
y = [zeros(N,1) y];
hold on
for tt=1:numel(t)
cla
stem(x,y(tt,:),'k')
plot(x,u(t(tt),x),'k')
text(0.8,0.8,['t = ' num2str(t(tt)) 's']);
ylim([0 1])
xlabel('x')
ylabel('u(x,t)')
drawnow
end
function dy=dmol(~,y)
dx = 10/M;
y0 = 0;
for m=M:-1:1
if m==1
dy(m,1) = (y(m+1)-2*y(m)+y0)/(dx^2);
elseif m==M
dy(m,1) = 0;
else
dy(m,1) = (y(m+1)-2*y(m)+y(m-1))/(dx^2);
end
end
end %dmol function
end %mol function
Polski: Metoda linii - przykład, który przedstawia pochodzenie nazwy metody. Kliknij Pełna rozdzielczość żeby zobaczyć animację. |
Date | |
Source | Own work |
Author | Grzegorz Knor |
Licensing[edit]
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 10:50, 23 July 2013 | 840 × 631 (818 KB) | Gknor (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on pl.wikipedia.org