|
Autor |
Octave: mesh Plot funktioniert nicht wie ich möchte |
|
Delastelle
Senior  Dabei seit: 17.11.2006 Mitteilungen: 2249
 | Themenstart: 2022-08-04
|
Hallo Leute!
Vielleicht sieht jemand meinen Fehler beim plot-Versuch:
\sourceon Octave
f = @(x,y) sin(5*x)*[cosh(5*y)-(cosh(5*pi)/sinh(5*pi))*sinh(5*y)]+sin(3*x)*sinh(3*y)/sinh(3*pi);
delta = 0.05;
x = 0:delta:pi;
y = 0:delta:pi;
[XX,YY] = meshgrid(x,y);
mesh(XX,YY,f(XX,YY));
view(35,35);
\sourceoff
Dies soll die Lösung für ein inneres Dirichlet Problem sein.
Am Rand sollen Sinus-Wellen sichtbar sein.
https://www.matheplanet.de/matheplanet/nuke/html/uploads/b/15578_Dirichlet_Plot2.png
(Bild 1 - nicht korrekt)
So funktioniert es, aber nicht so schön.
\sourceon Octave
tic
merk = zeros(10000,3);
az = 0;
delta = 0.05;
for x = 0:delta:pi
for y = 0:delta:pi
az = az + 1;
z = sin(5*x)*[cosh(5*y)-cosh(5*pi)/sinh(5*pi)*sinh(5*y)] + sin(3*x)*sinh(3*y)/sinh(3*pi);
merk(az,1) = x;
merk(az,2) = y;
merk(az,3) = z;
end
end
for i = 1:az
h = plot3(merk(i,1),merk(i,2),merk(i,3),'x');
hold on
end
grid on
toc
\sourceoff
https://www.matheplanet.de/matheplanet/nuke/html/uploads/b/15578_Ana3PN10.gif
(Bild 2 - korrekt aber nicht so schön)
Viele Grüße
Ronald
|
Profil
|
Delastelle
Senior  Dabei seit: 17.11.2006 Mitteilungen: 2249
 | Beitrag No.1, vom Themenstarter, eingetragen 2022-08-04
|
Ich habe den Fehler gefunden - es waren Rundungsfehler.
So gehts:
\sourceon Octave
% f = @(x,y) (sin(5*x)*[cosh(5*y)-(cosh(5*pi)/sinh(5*pi))*sinh(5*y)]+sin(3*x)*sinh(3*y)/sinh(3*pi));
f = @(x,y) ([cosh(5*y)-(cosh(5*pi)/sinh(5*pi))*sinh(5*y)]*sin(5*x)+sinh(3*y)/sinh(3*pi)*sin(3*x));
delta = 0.05;
delta = 0.05;
x = 0:delta:pi;
y = 0:delta:pi;
[XX,YY] = meshgrid(x,y);
mesh(XX,YY,f(XX,YY));
view(35,35);
\sourceoff
liefert:
https://www.matheplanet.de/matheplanet/nuke/html/uploads/b/15578_Dirichlet_Plot2besser.png
Wobei mir die jetzigen z-Werte etwas groß vorkommen... Mal sehen...
Viele Grüße
Ronald
|
Profil
|
Delastelle hat selbst das Ok-Häkchen gesetzt. |
|
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2001-2023 by Matroids Matheplanet
This web site was originally made with PHP-Nuke, a former web portal system written in PHP that seems no longer to be maintained nor supported. PHP-Nuke is Free Software released under the GNU/GPL license.
Ich distanziere mich von rechtswidrigen oder anstößigen Inhalten, die sich trotz aufmerksamer Prüfung hinter hier verwendeten Links verbergen mögen. Lesen Sie die
Nutzungsbedingungen,
die Distanzierung,
die Datenschutzerklärung und das Impressum.
[Seitenanfang]
|