## Jacobian elliptic functions...

Please can someone help with maple comand to obtain Jacobian elliptic functions particularly in code editing region?

## Calculating Jacobian of a function...

Hi,

I want to calculate the Jacobian of my function in terms of x,y,z. It is a Gerstner function and I need to caculate the normal of the displaced point. This can be achieved by getting the Jacobian Matrix. However when using Maple it isn't caculating it. The way I'm calling it is below. I have a vector function for tx,ty,tz:

with(VectorCalculus);
Jacobian([tx, ty, tz], [x, y]);

I'm not well versed in Maple I was wondering if anyone can help me out on how to get the Jacobian Matrix for tx,ty,tz

Best Regards

Paul

## How to generate optimized Code for multiple Matric...

Hello,

i have a vector-valued function mapping from R^n  -> R^m
I  compute its Jacobian Matrix as well as the Hessian Matrix of each output with regard to the inputs, which works so far.
Now I would like to use the CodeGeneration package to generate optimized C Code to compute these matrices numerically. This is, where i encounter a Problem:

I would like to optimize Code for all matrixes at once, because they contain common subexpressions. However CodeGeneration::C tells me it is unable to optimize the given input and generates unoptimized code.

I appended an exemplary file to illustrate the problem: Jacobian_Hessian_codeGeneration_tryout.mw

short version:

```C(Jac, optimize = tryhard, resultname = JacobianMatrix);
C(H1, optimize = tryhard, resultname = Hessian1);
C(H2, optimize = tryhard, resultname = Hessian2);
C(H3, optimize = tryhard, resultname = Hessian3)```

works, but is suboptimal.

`C([JacobianMatrix = Jac, Hessian1 = H1, Hessian2 = H2, Hessian3 = H3], optimize)`

fails to optimize and

`C([Jac, H1, H2, H3], optimize)`

fails completely.

(With Jac beeing a m by n matrix and H1-3 beeing n by n matrices)

If anyone can tell me what I'm missing here I'd really appreciate the help.

## Can this Jacobi Differential equation be solved?...

I have been trying to find a solution for the equation below. Is there a non numerical explicit solution?

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

 (10)

 (11)

## Symbolic calculation of matrix rank...

Hello,

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the Rank function of the LinearAlgebra can be used for this purpose. However, when I use this function, the function doesn't allow to find the different singularities that can occur on my jacobian matrix.

Here a exemple of a jacobian matrix that I obtain on a slidercrank mechanism:

The rank of this jaobian (Phi) gives 2 whatever the values of theta(t) and beta(t). However, if the values of  theta(t) and beta(t) are :theta(t)=Pi/2,beta(t)=0. The rank shouldn't be 2 but 1.

Is a way to obtain the symbolic calculation of the rank of a jacobian matrix which can distinguish different cases following the values of the parameters ? In others words, my dream will be to have a Rank function (or another algorithm) which can gives :
the rank is 2 if theta(t) different of Pi/2 [Pi] and beta(t)=0 [Pi]
and otherwise 1 if ...
and perhaps 0 if ...

Thanks a lot for your help.

I let a piece of code with an example of calculation of the rank

RankMatrix.mw

## Equations of motions for Euclidean and Minkowski...

by: Maple 13

This procedure calculate the equations of motions for Euclidean space and Minkowski space  with help of the Jacobian matrix.

Procedures
Calculation the equation of motions for Euclidean space and Minkowski space

 Calling Sequence

Parameters

 parameterSequence - eq out equation of motion g out metric xup out velocitiy vector xa in position vector xu in vector of the independet coortinates eta in signature matrix for Minkowski space var in independet variable

 >

Procedur Code

 >
 >

Input

 >

 >

Output EOM

 >
 (5.1)

Output Line-Element

 >
 (6.1)

Output Metric

 >
 (7.1)
 >
 >

Procedures
Calculation the equation of motions for Euclidean space and Minkowski space

 Calling Sequence

Parameters

 parameterSequence - eq out equation of motion g out metric xup out velocitiy vector xa in position vector xu in vector of the independet coortinates eta in signature matrix for Minkowski space var in independet variable

 >

Procedur Code

 >
 >

Input

 >

 >

Output EOM

 >
 (5.1)

Output Line-Element

 >
 (6.1)

Output Metric

 >
 (7.1)
 >
 >

## Jacobian matrix from equations...

Hello,

I would like to determine the position jacobian matrix from a set of constraint equations.

Here my constraint equations :

eq1:=l1*cos(theta(t))+l2*sin(beta(t))-x(t)=0
eq2:=l1*sin(theta(t))-l2*cos(beta(t))=0

The jacobian matrix that I would like to determine is :

Can you help me to make a general procedure to calculate a jacobian position matrix from a set of constraint equations ?

## Lyapunov exponent of ODE system...

I'm trying to find lypunov exponent for this  system of ODEs. I know I need to take the Jacobian but not sure if it's possible the way it's currently defined. If anyone could provide insight it would be much appreciated.

Eqns:= diff(omega(t),t)=-(G*MSat*beta^(2)*(xH(t)*sin(theta(t))-yH(t)* cos(theta(t)))*(xH(t)*cos(theta(t))+yH(t)*sin(theta(t))))/((xH(t)^(2)+yH(t)^(2))^(2.5)),diff(theta(t),t)=omega(t), diff(xH(t),t)=vxH(t),diff(vxH(t),t)=-(G*M*xH(t))/((xH(t)^(2)+yH(t)^(2))^(1.5)),diff(yH(t),t)=vyH(t),diff(vyH(t),t)=-(G*M*yH(t))/((xH(t)^(2)+yH(t)^(2))^(1.5)): ;

ICs := omega(0) = omega0, theta(0) = theta0, xH(0) = a*(1+e), yH(0) = 0, vxH(0) = 0, vyH(0) = sqrt(G*M*(1-e)/(a*(1+e)));

I want the exponent for omega, I  procedure that takes some initial conditions, changing just w0, and computes the long term value of omega. This plots a sort of bifurcation diagram. I'd like an estimate of the exponent to compare what I see.

thanks for the help

ft

## How do I compute the Jacobian ...

in Maple of a function with respect to a vector that contains product of variables?

I appologize before hand from my abuse of notation.

Suppose I have a function

f:= x*y*z + 3*x^2*y*z;

and a vector defined as

v:= <x*z | x^2*z>; #Column vector

and I would like to comput df/dv

So that the result from the Jacobian would be

J=<y , 3*y>; #Row vector

This is a simple example that can be solved by looking, but I would like to know if there is a way in maple to solve something like this. Some of the problems that I find are
1) The variables x*y*z commute i.e. x*y*z=z*x*y=y*z*x=x*z*y
2) And if I apply partial derivatives like  df/(dx*dz) = y+6*x*y and df/(dx*dx*dz) = 6 which is not the result that I desire, because what I want is the partial derivatives with respect to the functions x*z and x^2*z not to the variables x and z.

My application is far bigger than this example that I am posting, this is why I would like to find a way to produce this type of Jacobian. Any suggestion will be highly appreciate it.

## How to solve a Jacobian in maple?...

For example, given a 3d point p(x,y,z), with (x,y,z) as its coordinates. Then it is transformed by rotation and translation, as

p'=R(p)*p+t(p), where R(p) is a 3x3 rotation matrix that is a matrix of functions of p, and t(p) is a 3x1 vector function of p.

My question is how to derive dp'/d(as a 3x3 matrix) using maple?

To make it clear,I want to do it in a way that dp'/dp = ∂p'/∂p + ∂p'/∂R*∂R/∂p +  ∂p'/∂t*∂t/∂p

And I'd like to know each intermediate quantity, such as p'/∂R, R/∂p.

Anyone can help?

Thanks a lot.

## Analyzing a differential equation system with vary...

Hi there,
I have a set of differential equations whose solution, Jacobian matrix and its eigenvalues, direction field, phase portrait and nullclines, need to be computed.

Each of the equations has a varying parameter.

I know how to get the above for a single parameter value, but when I set a range of values for the parameters, Maple is not able to handle all cases as I would expect: solving the differential equation system:

eq1 := x*(1.6*(1-(1/100)*x)-phi*y)
eq2 := (x/(15+x)-0.3e-1*x-.4)*y+.6+theta
desys := [eq1, eq2];
vars := [x, y];

Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {-600*y+(Array(1..2, {(1) = 8400, (2) = 15900})), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0})}

The equations are the following:
de1 := diff(x(t), t) = x(t)*(1.6*(1-(1/100)*x(t))-phi*y(t));
de2 := diff(y(t), t) = (x(t)/(15+x(t))-0.3e-1*x(t)-.4)*y(t)+.6+theta

the parameters being:
phi:=[0 0.5 1 1.5 2]
theta:=[5. 10.]

How can I handle the situation so that Maple computes each of the above for each combination of the parameters?

I would like to avoid using two for loops and having to store all results in increasingly bigger and complicated arrays.

The worksheet at issue is this: MaplePrimes_Tumour_model_phi_theta_variation.mw

Thanks,
jon

## Loop over a set of lists...

Hi there,

I would like to have the Jacobian matrix of an ODE system evaluated, and their eigenvalues computed, at the steady states of the system.

I know how to get the Jacobian matrix evaluated and the eigenvalues computed on an individual basis, setting manually each steady state as the argument of the matrix.

However, I would like to have it in a loop, so that the loop manages all steady states, that is:

steadyStates:= solve(mySystem); # would yield a set of pairs/lists

m:=Jacobian(steadyStateN); # evaluate the Jacobian matrix

ev:= eigenvals(m); # compute the eigenvalues and save them to another variable/array and print them

end for:

First, I am not to find a way to loop over my steadyStates.

Attached is an example where the Jacobian matrix and eigenvalues are computed individually, where the steady states have been hard-coded once they have been computed: MaplePrimes_Predator_prey_model_Jacobian.mw

Any ideas on how to do this?

Thanks,

jon

## Converting large symbolic Jacobian to LaTeX...

I have generated an 8x8 Jacobian, containing a few variables and several zeros as elements. I would like to translate this to LaTeX code. How can I first simplify what I have, to make it tractable?

Here is the Maple code:

eq_1 := Lambda-mu*S-(beta*(H+C+C1+C2)*S+tau*(T+C)*S)/(S+T+H+C+C1+C2+C1M+C2M);
eq_2 := (-beta*(H+C+C1+C2)*T+tau*(T+C)*S)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[T])*T;
eq_3 := (beta*(H+C+C1+C2)*S-tau*(T+C)*H)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[A])*H;
eq_4 := (beta*(H+C+C1+C2)*T+tau*(T+C)*H)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[T]+mu[A]+lambda[T])*C;
eq_5 := lambda[T]*C-(mu+mu[A]+rho[1]+eta[1])*C1;
eq_6 := rho[1]*C1-(mu+mu[A]+rho[2]+eta[2])*C2;
eq_7 := eta[1]*C1-(mu+rho[1]+gamma)*C1M;
eq_8 := eta[2]*C2+rho[1]*C1M-(mu+rho[2]+gamma*rho[1]/(rho[1]+rho[2]))*C2M;
J := VectorCalculus:-Jacobian([eq_1, eq_2, eq_3, eq_4, eq_5, eq_6, eq_7, eq_8], [S, T, H, C, C1, C2, C1M, C2M]);

JQDFE := eval(J, [S = Lambda/(beta-mu[A]), T = 0, H = Lambda*(beta/(mu+mu[A])-1)/(beta-mu[A]), C = 0, C1 = 0, C2 = 0, C1M = 0, C2M = 0]);

Thanks.

## how to jacobian this function which has max when m...

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)

## Jacobian of a system of ODEs...

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!!

 1 2 Page 1 of 2
﻿