Hello,
could you pls help me with this code, i dont understand why i get the error.
---------------------------------------------------------------------------------------------
NewtonZweiVariablen := proc (funktion1, funktion2, startwertX, startwertY)
local Ableitung, StartwertNeuVektor, DurchgangsZaehler, Differenz, StartwertVektor, FunktionsVektor, Jacobi, g, h;
Jacobi := linalg:-inverse(Jacobian([funktion1, funktion2], [x, y]));
StartwertVektor := Matrix(2, 1, [startwertX, startwertY]);
DurchgangsZaehler := 0; Differenz := Matrix(2, 1, [1, 1]);
g := unapply*(funktion1, x, y);
h := unapply*(funktion2, x, y);
while 0.1e-3 < abs(evalf(Differenz[1, 1])) and 0.1e-3 < abs(evalf(Differenz[2, 1])) do
DurchgangsZaehler := DurchgangsZaehler+1;
StartwertNeuVektor := StartwertVektor;
FunktionsVektor := Matrix(2, 1, [h(StartwertNeuVektor[1, 1], StartwertNeuVektor[2, 1]), g(StartwertNeuVektor[1, 1], StartwertNeuVektor[1, 1])]);
StartwertNeuVektor := StartwertNeuVektor-linalg:-multiply(Jacobi, FunktionsVektor);
Differenz := StartwertVektor-StartwertNeuVektor
end do;
print(Durchgänge, DurchgangsZaehler);
print(Ergebnis, evalf(StartwertNeuVektor));
print(YWert, funktion(evalf(StartwertNeuVektor)))
end proc
-------------------------------------------------------------------------------------------------
NewtonZweiVariablen(x^2 -y, y^2-x, 1, 1);
Error, (in unapply) variables must be unique and of type name.
The problem is that i need the procedure parameters in form of a term to calculate the Jacobian Matrix and then i need the parameters as a function to calculate the values.
Thank you.