Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023
I am trying to compute partial derivatives of some complicated expression which include summations. First, I noticed that sum behaves differently if I use 1D vs. 2D math. Why?

Questions:
  1. Partial derivative of a summation: why is it not just 2*X[i]?
  2. Partial derivative of a double summation: how to define the nested structure of a double summation with j<>i?
  3. System of n+1 equations: how to define and solve for it?

For 3., each i equation is the partial derivative of my complicated expression with summations with respect to X[i], where i ranges from 1 to n. The last equation is the partial derivative with respect to X_r (a fixed variable).

Thanks.

restart

A := sum(X[i]^2, i = 1 .. n); eq[1] := diff(A, X[i]) = 0

sum(X[i]^2, i = 1 .. n)

 

sum(2*X[i], i = 1 .. n) = 0

(1)

B__wrong := sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n); B__correct := 'sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)'

n^2*X__r^2*w^2+sum(sum(X__r*w*X[j]+X[i]*X[j], j = 1 .. n)+n*X__r*w*X[i], i = 1 .. n)

 

sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)

(2)

eqs := seq(eq[i], i = 1 .. n); vars := seq(X[i], i = 1 .. n)

Error, range bounds in seq must be numeric or character

 

Error, range bounds in seq must be numeric or character

 
 

NULL

Download equations_with_summations.mw

I am studying linear operators that have vanishing Nijenhuis Torsion, that is a (1-1) tensor L whose corresponding (1-2) tensor N given by a tensor equation of L (see attached) is identically zero.

I am new to maple, i have used it to plot vector fields and solve systems of equations in the past but i am unfamiliar with the DifferentialGeometry and Physics packages.

Attached is my best effort at solving this problem directly for a simple 2d case without the use of any packages and i am wondering if it is possible to do it all in one line without having to define tensor components one by one.

nijenhuis_torsion.mw

Hi, I have a very concrete task, which is to find the singular vector associated with the largest singular matrix of the matrix M below. Here, a is an arbitrary complex number, l is of magnitude stritcly less than 1, and k>0. The command 'SingularValues' returns the 2 singular values of M. But when I search for the corresponding singular vectors, there is a bug. Those vectors are the eigenvectors of M*M. When I use the command Eigenvectors, the second argument returned is the 2 by 2 null matrix. And when I use the command eigenvects I have an error message (see below). Anyone could help me to fix this issue please?

Many thanks in advance. 

with(LinearAlgebra); assume(k > 0); assume(abs(l) < 1); M := Matrix(2, 2, {(1, 1) = l-(1-l*conjugate(l))*k, (1, 2) = -a*(1-l*conjugate(l))*k, (2, 1) = 0, (2, 2) = l+(1-l*conjugate(l))*k})

Matrix(%id = 36893488151898158132)

(1)

simplify(SingularValues(M)[1])

(1/2)*(2*(-abs(l)^2+1)*k*(k^2*(abs(l)-1)^2*(abs(l)+1)^2*abs(a)^4+(4*k^2*abs(l)^4+(-8*k^2+4)*abs(l)^2+4*k^2)*abs(a)^2+4*l^2+8*abs(l)^2+4*conjugate(l)^2)^(1/2)+2*k^2*(abs(a)^2+2)*abs(l)^4+4*(-abs(a)^2*k^2-2*k^2+1)*abs(l)^2+2*k^2*(abs(a)^2+2))^(1/2)

(2)

MatrixMatrixMultiply(HermitianTranspose(M), M)

Matrix(%id = 36893488151996380692)

(3)

Eigenvectors(MatrixMatrixMultiply(HermitianTranspose(M), M))

Vector[column](%id = 36893488151975984532), Matrix(%id = 36893488151975984652)

(4)

with(linalg)

eigenvectors(Matrix(2, 2, {(1, 1) = (l-(1-l*conjugate(l))*k)*conjugate(l-(1-l*conjugate(l))*k), (1, 2) = -conjugate(l-(1-l*conjugate(l))*k)*a*(1-l*conjugate(l))*k, (2, 1) = -k*conjugate(a*(1-l*conjugate(l)))*(l-(1-l*conjugate(l))*k), (2, 2) = a*(1-l*conjugate(l))*k^2*conjugate(a*(1-l*conjugate(l)))+(l+(1-l*conjugate(l))*k)*conjugate(l+(1-l*conjugate(l))*k)}))

Error, (in linalg:-eigenvectors) eigenvects only works for a matrix of rationals, rational functions, algebraic numbers, or algebraic functions at present

 
 

``

Download singular_vect_2_by_2_matrix.mwsingular_vect_2_by_2_matrix.mw

Recently a new configuration of a computer, with a better cpu - AMD Ryzen 7 8700G w/ Radeon 780M Graphics, but maple computation is particularly slow, cpu call special less computation is particularly slow, is there any way to improve?

I do not understandwhat this result from Maple means.

I don't know what it means when a result has "Root of", and in this case, there is also a big summation sign for which I can't tell if the variables underneath it are part of the summartion, or what.  I'd appreciate any guidance to make sense of what this means..

restart

with(inttrans)

assump := R1::real, R2::real, L1::real, C1::real, C2::real, L2::real, omega::real, M::real, R1 > 0, R2 > 0, L1 > 0, C1 > 0, L2 > 0, C2 > 0, omega > 0, M > 0

R1::real, R2::real, L1::real, C1::real, C2::real, L2::real, omega::real, M::real, 0 < R1, 0 < R2, 0 < L1, 0 < C1, 0 < L2, 0 < C2, 0 < omega, 0 < M

(1)

expr := Vin/(s*(R1+s*L1-1/(s*C1)+(omega*M)^2/(R2+s*L2-1/(s*C2))))

Vin/(s*(R1+s*L1-1/(s*C1)+omega^2*M^2/(R2+s*L2-1/(s*C2))))

(2)

invlaplace(expr, s, t)

Vin*C1*(sum(exp(_alpha*t)*(-1+C2*_alpha*(L2*_alpha+R2))/(4*C1*C2*L1*L2*_alpha^3+2*C1*C2*M^2*_alpha*omega^2+3*C1*C2*L1*R2*_alpha^2+3*C1*C2*L2*R1*_alpha^2+2*C1*C2*R1*R2*_alpha-2*C1*L1*_alpha-2*C2*L2*_alpha-C1*R1-C2*R2), _alpha = RootOf(1+C1*C2*L1*L2*_Z^4+(C1*C2*L1*R2+C1*C2*L2*R1)*_Z^3+(C1*C2*M^2*omega^2+C1*C2*R1*R2-C1*L1-C2*L2)*_Z^2+(-C1*R1-C2*R2)*_Z)))

(3)

NULL

Download for_help2.mw

How to use maple to compute the solution of two coupling equations that both have higher order derivatives? I used dsolve and couldn't solve it.

question928.mw

The result of the function was computed successfully using the proc function, but how to plot the computed image? Using the seq command but the step size can not get the desired, using the for loop is too cumbersome, what should be done?fuxian.mwfuxian.mw

Executing the code in ?InvertedPendulum produces an error when

sysLin := Linearize(convert(sysEqs, list), [u(t)], [x(t), theta(t)], lin_point)

is executed. The problem is the line where EQ4 is assigned a value.

Something is wrong with the line where EQ4 is assigned a value. It is not executed.
It is like the mode changes to text for that line????

I reduced the order of two nonlinear equations and solved them numerically in this way. Why are the two results obtained the same?
directdsolve919.mw

I have a differential equation which I am looking for a series solution in inverse powers of r. I am doing this by matching inverse powers between the RHS and LHS of the differential equation and then finding the coefficient in the series solution that would solve this. I have written a little procedure which returns the coefficients, I am just curious if there is a command that will do this for me or if i can improve on this technique? I tried the Solve command in PDETools but it just kept evaluating and did not return an answer. 

Thanks in advance. 

 

EDIT: More detail provided in the first reply. 

coefficient_question.mw

I'm sure this has been asked and answered, but I can't find the correct MaplePrimes page on it. How does one generate an array plot where the plots are centered within each box and not left justified? I need to make a PDF out of the document with an array plot of 1 column and 2 rows. (The following is just an example.) 

Why can't the variables in my procedure be called? Omega1, Omega2, Q1, Q2 are all expressed in the form of local variables in the loop, why can't we solve the equation because there are too many variables? At the same time, I would like to ask how to output the results of Q1 and Q2?

equation915.mw

can someone help me curve fitting these parameeters...i only got 1 for all of this 90As4.mw

restart

with(Statistics)with(plots)with(Optimization)with(LinearAlgebra)

E[1] := 126*10^9E[2] := 11*10^9G[12] := 6.6*10^9G_0__12 := 10.1*10^9nu[12] := .28E_0__2 := 15.5*10^9

true_strain := [0, .406915, .710106, .989362, 1.28457, 1.53989, 1.86702, 2.21011, 2.625, 2.99202]; true_stress := [0, 46.0227*10^6, 81.8182*10^6, 109.091*10^6, 138.068*10^6, 163.636*10^6, 194.318*10^6, 219.886*10^6, 248.864*10^6, 267.614*10^6]; epsilon_dot := 10^(-4)

sigma_t := map(proc (epsilon) options operator, arrow; E[instantaneous]*(1-lambda[90*deg]*epsilon*(sum(P[i], i = 1 .. 10)-(sum(P[i]*exp(lambda[i]*epsilon/epsilon_dot), i = 1 .. 10)))/epsilon_dot)*epsilon end proc, true_strain)

``

obj := sum((sigma_t[i]-true_stress[i])^2, i = 1 .. 10)

indets(obj, name)

{E[instantaneous], P[1], P[2], P[3], P[4], P[5], P[6], P[7], P[8], P[9], P[10], lambda[1], lambda[2], lambda[3], lambda[4], lambda[5], lambda[6], lambda[7], lambda[8], lambda[9], lambda[10], lambda[90*deg]}

(1)

Optimization[Interactive](obj)

The solution was obtained with the following warning:
  no iterations performed as initial point satisfies first-order conditions

 

[Float(infinity), [E[instantaneous] = HFloat(1.0), P[1] = HFloat(1.0), P[2] = HFloat(1.0), P[3] = HFloat(1.0), P[4] = HFloat(1.0), P[5] = HFloat(1.0), P[6] = HFloat(1.0), P[7] = HFloat(1.0), P[8] = HFloat(1.0), P[9] = HFloat(1.0), P[10] = HFloat(1.0), lambda[1] = HFloat(1.0), lambda[2] = HFloat(1.0), lambda[3] = HFloat(1.0), lambda[4] = HFloat(1.0), lambda[5] = HFloat(1.0), lambda[6] = HFloat(1.0), lambda[7] = HFloat(1.0), lambda[8] = HFloat(1.0), lambda[9] = HFloat(1.0), lambda[10] = HFloat(1.0), lambda[90*deg] = HFloat(1.0)]]

(2)
 

NULL

Download 90As4.mw

Change the length of the pendulum to achieve the analysis of the pendulum frequency change, but I scan the frequency of the two images do not correspond to each other, what is the problem?

sweep.mw

I am attempting to obtain an equation for battery discharge.

I have data from a battery that will supply 25 amps for 210 minutes. I want to fit this to an equation and then try to adjust the curve to match a battery that will supply 25 amps for 160 minutes.

Here is what I have:

restart; with(Statistics):

## Amps
A := Vector([444, 218, 74,312/10,209/10,119/10,625/100]):
## Time until battery discharges to 10.5 volts
T := Vector([5,15,60,3*60,5*60,10*60,20*60]):
f := x -> a*exp(1-x/b); f(x)
eqset := {seq(T[idx] - f(A[idx]), idx=1..7)}
sol := NonlinearFit(a*exp(1-x/b),A, T, x)
evalf(subs(x=A[6],sol))
P1 := plot(A,T): P2 := plot(sol,x=0..450): plots[display]({P1,P2})

I want the 'knee' of the fitted curve to more closely match the measured data.

How do I do this?

1 2 3 4 5 6 7 Last Page 1 of 30