Items tagged with jacobian jacobian Tagged Items Feed

got an error when try to jacobian this

with(VectorCalculus):
f1 := -2*x1-x2; f2 := -x1-4*x2; g1 := 2*x1+3*x2-6; g2 := -x1; g3 := -x2;
penalty := lambda1*max(f1-M,0) + lambda2*max(f2-M,0) + (M^2)*(max(g1,0) + max(g2,0) + max(g3,0)):
obj := eval(penalty,[lambda1=3,lambda2=0.645,M=1]);
Hf := Jacobian(Jacobian(obj, [x1, x2, x3]), [x1, x2, x3]);

Error, invalid input: VectorCalculus:-Jacobian expects its 1st argument, f,
to be of type {Vector(algebraic), list(algebraic)}, but received 3*max(0, -2*x1-x2-1)+.645*max(0, -x1-4*x2-1)+max(0, 2*x1+3*x2-6)+max(0, -x1)+max(0, -x2)

 

Greetings,

       I am new to Maple and this forum. I would like to obtain a Jacobian of a system of 12 ODEs. What have I done wrongly with my code?

eq_1 := -B*a+A-V*(c+d+t+s+h)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-W*(b+d)*a/(a+b+c+d+e+f+g+h+s+t+u+v);
eq_2 := W*(b+d)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-V*(c+d+t+s+h)*b/(a+b+c+d+e+f+g+h+s+t+u+v)-(F*G+B+D)*b;
eq_3 := V*(c+d+t+s+h)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-W*(b+d)*c/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+E+C)*c;
eq_4 := V*(c+d+t+s+h)*b/(a+b+c+d+e+f+g+h+s+t+u+v)+W*(b+d)*c/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+C+D+F)*d;
eq_5 := G*F*b-V*(c+d+t+s+h)*e/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+H)*e;
eq_6 := H*e-V*(c+d+t+s+h)*f/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+S)*f;
eq_7 := S*f-V*(c+d+t+s+h)*g/(a+b+c+d+e+f+g+h+s+t+u+v)-B*g;
eq_8 := V*(c+d+t+s+h)*g/(a+b+c+d+e+f+g+h+s+t+u+v)+S*s-(B+E+C)*h;
eq_9 := F*d+V*(c+d+t+s+h)*e/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+C+H+T)*t;
eq_10 := H*t+V*(c+d+t+s+h)*f/(a+b+c+d+e+f+g+h+s+t+u+v)-(U+B+C+S+S)*s;
eq_11 := T*t+W*(b+d)*x/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+H+Y)*u;
eq_12 := U*s-(B+S)*v+H*u-Y*H*v/(H+S);
with(linalg);
J := Jacobian([eq_1, eq_2, eq_3, eq_4, eq_5, eq_6, eq_7, eq_8, eq_9, eq_10, eq_11, eq_12], [a, b, c, d, e, f, g, h, s, t, u, v]);

I am getting the message: 

 Vector(4, {(1) = ` 12 x 12 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

Thanks!!

I have 2 problem with my jacobian matrix:

first: i can not evaluate 11*11 jacobian matrix. at last i can evaluate 10*10 matrix. can i solve this?
second: i want to export my matrix for matlab but i see this error : {export matrix"cannot convert matrix element to float[8] data type"}
so how i can use this matrix in my matlab code?
 my jacobian matrix:


with(VectorCalculus); Jacobian([VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(2.68, ex), VectorCalculus:-`-`(VectorCalculus:-`*`(2, vx))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(3.500000001, e^VectorCalculus:-`*`(1.666666667, sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))), VectorCalculus:-`+`(VectorCalculus:-`*`(rx, 1/sqrt(VectorCalculus:-`+`(rx^2, ry^2))), VectorCalculus:-`*`(1/2, VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(2, rx), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb(ex)))), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))))), ln(e)), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(50.00000000, e^VectorCalculus:-`-`(VectorCalculus:-`*`(5.000000000, sqrt(VectorCalculus:-`+`(Rx^2, Ry^2))))), Rx), ln(e)), 1/sqrt(VectorCalculus:-`+`(Rx^2, Ry^2)))), VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(2.68, ey), VectorCalculus:-`-`(VectorCalculus:-`*`(2, vy))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(3.500000001, e^VectorCalculus:-`*`(1.666666667, sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))), VectorCalculus:-`+`(VectorCalculus:-`*`(ry, 1/sqrt(VectorCalculus:-`+`(rx^2, ry^2))), VectorCalculus:-`*`(1/2, VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(2, ry), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb(ey)))), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))))), ln(e)), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(50.00000000, e^VectorCalculus:-`-`(VectorCalculus:-`*`(5.000000000, sqrt(VectorCalculus:-`+`(Rx^2, Ry^2))))), Ry), ln(e)), 1/sqrt(VectorCalculus:-`+`(Rx^2, Ry^2)))), 1, 1, 1, 1, 1, 1, 1, 1, 1], [vx, vy, ex, ey, rx, ry, Ex, Ey, vb, Rx, Ry])

Hi all,

For research purposes, I have symbolic matrices of dimentions up to 100 x 50 (and above) with certain number of parameters. Then giving random value to those paramters, I want the numerical rank of the matrices.

 

Maple 17 does not seem to work well with symbolic ranks, where expentials are involved.

And more to it, both

Student[MultivariateCalculus][Jacobian]

and

VectorCalculus[Jacobian]

does not seem to work. ...

MAPLE Users,

Suppose I have a set of points in some N-dimensional space.  I would like to obtain a simple polynomial that

best fits the data.  I do not know in advance the form of the function, but a simple function that does not overfit

the data would probably be OK.  By "simple" I mean the smallest degree with or without cross-terms that gives a

decent fit.  My data set will typically be an external comma or tab separated text file.

I have a 2D ode system. Let the interior equilibrium points be x1 & y1. It is easy to get the Jacobian matrix with the code

> with(linalg);
> with(DEtools);
> J := jacobian([H, K], [x, y]);
 
where H & K are the RHS of odes. But I need the higher order terms by transforming x=x1+u, 
y=y1+v in matrix notation. Please give me the code. 

restart:

with(LinearAlgebra):
with(ArrayTools):


k:=4;
pA:=<seq(p[a,i],i=2..(k+1))>;
pB:=<seq(p[b,i],i=2..(k+1))>;
pA+pB;

with(VectorCalculus):

pA:=<seq(p[a,i],i=2..(k+1))>;
pB:=<seq(p[b,i],i=2..(k+1))>;
pA+pB;

 

Hi all,

 

After I loaded the package with(VectorCalculus), the output of vectors changed to a different one.

Is there any real "difference" when...

Here is the Rossler system, one of the simplest examples of 3 dimensional deterministic chaos (under certain conditions according to "params"). Thanks to Doug and Joe for various assists. Comments and critiques most welcome !

restart;
interface(displayprecision=10):
ross_x:=diff(x(t),t)=-y(t)-z(t):
ross_y:=diff(y(t),t)=x(t)+a*y(t):
ross_z:=diff(z(t),t)=b+x(t)*z(t)-c*z(t):
rossler_sys:=ross_x,ross_y,ross_z;

#Find fixed points:
sol:=solve({rhs(ross_x...

Page 1 of 1