Vektorfeld < Maple < Mathe-Software < Mathe < Vorhilfe
|
| Status: |
(Frage) beantwortet | | Datum: | 11:52 Di 02.11.2010 | | Autor: | inceddy |
Hi,
ich hab folgendes Problem mit der Plot-Funktion fieldplot.
Wenn ich ein Vektorfeld definiere als
f(x,y):=[x,y];
und das plotte mit
fieldplot(f(x,y), x=-10..10, y=-10..10);
klappt das wunderbar.
wenn ich f aber definiere als
f(x,y):=x* [x,y];
bekomme ich die Fehlermeldung:
Error, (in plots/fieldplot) invalid 1st argument (the function) x*[x, y]
Wieso? Muss man für die skalare Multiplikation mit Vektoren einen anderen Operator als * nehmen?
Danke schonmal
Ich habe diese Frage in keinem Forum auf anderen Internetseiten gestellt.
|
|
| |
|
Hallo,
da gibt es meines Wissens die folgenden beiden Möglichkeiten (beides umständlich; vieleicht weiß es jemand anders besser):
| 1: | > f := unapply(evalm(x*[x, y]), [x, y]);
| | 2: | f := proc (x, y) options operator, arrow; 'table( [( 1 ) = \'*\'(\'^\'(x, 2)), ( 2 ) = \'*\'(x, \'*\'(y)) ] )' end proc
| | 3: | > with(plots);
| | 4: | > fieldplot(f(x, y), x = -10 .. 10, y = -10 .. 10);
| | 5: | > with(LinearAlgebra);
| | 6: | > f2 := unapply(ScalarMultiply(Vector([x, y]), x), [x, y]);
| | 7: | / / 2 \
| | 8: | (x, y) -> rtable|1 .. 2, { 1 = x , 2 = x y },
| | 9: | \ \ /
| | 10: |
| | 11: | datatype = anything, subtype = Vector[column],
| | 12: |
| | 13: | \
| | 14: | storage = rectangular, order = Fortran_order|
| | 15: | /
| | 16: | > fieldplot(f2(x, y), x = -10 .. 10, y = -10 .. 10);
|
Gruß,
Peter
|
|
|
|