Modellierung und Simulation - Graphische Darstellung: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 3: | Zeile 3: | ||
| '''Autor:''' || [[Benutzer:Ulrich_Schneider| Prof. Dr.-Ing. Schneider]] | | '''Autor:''' || [[Benutzer:Ulrich_Schneider| Prof. Dr.-Ing. Schneider]] | ||
|} | |} | ||
= Aufgabe 3.1 - Plotten von | = Aufgabe 3.1 - Plotten von symbolischen Funktionen = | ||
# | # Recherchieren Sie, welche Befehle es in MATLAB<sup>®</sup> zur Darstellung von Funktionsgraphen gibt. | ||
# Zeichnen Sie folgenden symbolischen Funktionsgraphen <br> <math>y = \frac{x^2-4}{x^2+1}</math><br><math>y = \frac{x^3-5x^2+8x-4}{x^3-6x^2+12x-8}</math><br><math>y = 2\cdot \sin(3x-\frac{\pi}{6})</math> | |||
# | # Recherchieren Sie, welche Befehle es in MATLAB zur Darstellung von Funktionsgraphen von Funktionen zweier Veränderlicher gibt. | ||
# Zeichnen Sie folgenden symbolischen Funktionsgraphen <br> <math>f(x;y) = \frac{x^2-y^2}{x^2+y^2}</math><br><math>f(x;y) = -4x^3y^2+3xy^4-3x+2y+5</math> | |||
'''Nützliche Befehle:''' [https://de.mathworks.com/help/matlab/ref/figure.html <code>figure</code>], [https://de.mathworks.com/help/matlab/ref/subplot.html <code>subplot</code>], [https://de.mathworks.com/help/symbolic/sym.syms.html <code>syms</code>], [https://www.mathworks.com/help/matlab/ref/fplot.html <code>fplot</code>], [https://www.mathworks.com/help/matlab/ref/xlabel.html <code>xlabel</code>] | |||
# | |||
# | |||
'''Nützliche Befehle:''' [https://de.mathworks.com/help/matlab/ref/ | |||
{| role="presentation" class="wikitable mw-collapsible mw-collapsed" | {| role="presentation" class="wikitable mw-collapsible mw-collapsed" | ||
| <strong>Musterlösung | | <strong>Musterlösung 2.2.2 </strong> | ||
|- | |- | ||
| <source line lang="matlab" style="font-size:medium">x = ( | | <source line lang="matlab" style="font-size:medium"> | ||
close all | |||
syms x y1 y2 y3 | |||
y1 = (x.^2 - 4)./(x.^2 +1); | |||
y2 = (x.^3 - 5.*x.^2 + 8.*x - 4)./(x.^3 - 6.*x.^2 + 12.*x -8); | |||
y3 = 2.*sin(3.*x - (pi/6)); | |||
figure(1); | |||
subplot(1,3,1); | |||
fplot(y1); | |||
xlabel('$y = \frac{x^2-4}{x^2+1}$','Interpreter','latex') | |||
subplot(1,3,2); | |||
fplot(y2); | |||
xlabel('$y = \frac{x^3-5x^2+8x-4}{x^3-6x^2+12x-8}$','Interpreter','latex') | |||
subplot(1,3,3); | |||
fplot(y3); | |||
xlabel('$y = 2\cdot \sin(3x-\frac{\pi}{6})$','Interpreter','latex') | |||
</source> | </source> | ||
|} | |} | ||
{| role="presentation" class="wikitable mw-collapsible mw-collapsed" | {| role="presentation" class="wikitable mw-collapsible mw-collapsed" | ||
| <strong>Musterlösung 2 </strong> | | <strong>Musterlösung 2.2.4 </strong> | ||
|- | |- | ||
| <source line lang="matlab" style="font-size:medium">y = | | <source line lang="matlab" style="font-size:medium">syms x y z1 z2 | ||
z1 = (x.^2 - y.^2)./(x.^2 + y.^2); | |||
z2 = -4.*x.^3.*y.^2 + 3.*x.*y.^4 - 3.*x + 2.*y + 5; | |||
figure(2) | |||
subplot(1,2,1); | |||
%fsurf(z1); | |||
%fmesh(z1); | |||
%fimplicit3(z1); | |||
fcontour(z1); | |||
subplot(1,2,2); | |||
fsurf(z2); | |||
%fmesh(z2); | |||
%fimplicit3(z2); | |||
subplot( | %fcontour(z2); | ||
</source> | </source> | ||
|} | |} | ||
---- | ---- | ||
→ zurück zum Hauptartikel: [[BSE Modellierung und Simulation - SoSe26]] | → zurück zum Hauptartikel: [[BSE Modellierung und Simulation - SoSe26]] | ||
Aktuelle Version vom 17. April 2026, 09:02 Uhr
| Autor: | Prof. Dr.-Ing. Schneider |
Aufgabe 3.1 - Plotten von symbolischen Funktionen
- Recherchieren Sie, welche Befehle es in MATLAB® zur Darstellung von Funktionsgraphen gibt.
- Zeichnen Sie folgenden symbolischen Funktionsgraphen
- Recherchieren Sie, welche Befehle es in MATLAB zur Darstellung von Funktionsgraphen von Funktionen zweier Veränderlicher gibt.
- Zeichnen Sie folgenden symbolischen Funktionsgraphen
Nützliche Befehle: figure, subplot, syms, fplot, xlabel
| Musterlösung 2.2.2 |
close all
syms x y1 y2 y3
y1 = (x.^2 - 4)./(x.^2 +1);
y2 = (x.^3 - 5.*x.^2 + 8.*x - 4)./(x.^3 - 6.*x.^2 + 12.*x -8);
y3 = 2.*sin(3.*x - (pi/6));
figure(1);
subplot(1,3,1);
fplot(y1);
xlabel('$y = \frac{x^2-4}{x^2+1}$','Interpreter','latex')
subplot(1,3,2);
fplot(y2);
xlabel('$y = \frac{x^3-5x^2+8x-4}{x^3-6x^2+12x-8}$','Interpreter','latex')
subplot(1,3,3);
fplot(y3);
xlabel('$y = 2\cdot \sin(3x-\frac{\pi}{6})$','Interpreter','latex')
|
| Musterlösung 2.2.4 |
syms x y z1 z2
z1 = (x.^2 - y.^2)./(x.^2 + y.^2);
z2 = -4.*x.^3.*y.^2 + 3.*x.*y.^4 - 3.*x + 2.*y + 5;
figure(2)
subplot(1,2,1);
%fsurf(z1);
%fmesh(z1);
%fimplicit3(z1);
fcontour(z1);
subplot(1,2,2);
fsurf(z2);
%fmesh(z2);
%fimplicit3(z2);
%fcontour(z2);
|
→ zurück zum Hauptartikel: BSE Modellierung und Simulation - SoSe26