## Importing matrix from excel and finding its invers...

Hi,

I want to find the inverse of a 11x11 matrix which I imported from excel using the import data tool. When I try to find the the inverse it gives me this error:

-----------------------------------------------------------------------

K:=ExcelTools:-Import("C:\\Assignment 2.xlsx", "Q2", "V7:AF17");

K := Vector(4, {(1) =  1..11 x 1..11 *Array, (2) = Data Type: *anything, (3) = Storage: *rectangular, (4) = Order: *Fortran_order})

with(LinearAlgebra):
kkk:=convert(K, matrix):
KK:=MatrixInverse(kkk);

Error, (in MatrixInverse) MatrixInverse expects its 1st argument, M, to be of type {Matrix, [Matrix(square)], [Vector, Matrix(square)], [Matrix(square), Matrix(square), Matrix(square)]} but received kkk

## Multiply each term from a polynom by a coefficient...

Hi there,

I have a big polynomial expression involving powers of x and y, that comes from expanding a function in powers of x and y in polynomial form (I use series(convert(series(a,x=0,10),polynom),y=0,10) ). I want to multiply each of the terms by the factorial of the power of x and y it has. How can I do this?
I tried using Physics[Coefficient](a,x) but I get the error: it cannot compute the degree of the expression.
I tried using a double for with a double coeff to get each of the coefficients and the maybe be able to multiply them but I get the error "unable to compute coeff".

Is it because as expanding the series I have the term +O(y^11) that it cannot compute it?

I managed to substitute the x terms using subs(x^3=3!*x^3,x^5=5!*x^5,a). Obviously this is not very efficient since I need to write the substitution for each term, and since the ploynom is grouped in powers of y, this does not work for y (neither does algusbs).

[Edit 2]:

an example of it would be:

with result

And I want the coefficients for each x and y power to be multiplied by the factorial of those powers.

Thank you!

## Normalize wavefunctions...

Hi,

Does anyone no how to normalize wavefunctions such that the plot on the right looks like the one on the left.

Here's my code:-

schro := {diff(psi(x), x, x)-(alpha*x^4+x^2-energy)*psi(x) = 0};

ic := {psi(3) = 0, (D(psi))(3) = 1};

Ic := [{psi(3) = 0, (D(psi))(3) = -1}, %\$2];

E := [1.06538, 3.306, 5.74796];

schro1 := [seq(subs(energy = e, alpha = .1, schro), e = E)];

soln1 := [seq(dsolve(schro1[i] union Ic[i], {psi(x)}, type = numeric), i = 1 .. nops(E))]; with(plots);

display(seq(odeplot(soln1[i], [x, psi(x)], -3 .. 3, color = [red, blue, green][i]), i = 1 .. nops(E)))

## How to substitute values from multiple lists into ...

Dear All

For six parameters, I have corresponding list of their values and there are eight values for every parameter. I need to put these values in a formula to obtain a list of output values. There are two formulas one for 'P' and next is for 'RL'. I have used value of 'P' to calculate value of 'RL'. There are some complex number too, for which I have used modulus and final value is calculated by using 'evalf', but this command is not returning proper values for list as required. But this command works fine when I use single value from every list to calculate RL.

The Maple sheet attached herewith.

List.mw

Regards

## issues with angular displacement in given inverse ...

Hi,

I was playing around with the example "Simple Inverse Kinematic Problem" and found somethings to be odd:

the angular motion seems to be calculated from between pi and negative pi and this has some effects when using position block to move a joint.

the original angular displacement is graph below

the angular displacement after ik calculations have been performed:

if you run the simulation it seems to copy and mirror the input pendulum, however if you disable one of the IK solutions you see that infact its motion isn't like the input.

this becomes more prevailant when you use a position block to force rotation on a joint instead of using the 'prescribed rotation' blocks that comes with the example.

My question then:
why does this happen?
how do I work around this?

the importance that the motion is follow precisely becomes more prevailent when we want to extract other values such as vel, accel, torque. they are incorrect and very jumpy. Also simply put the angular displacement is wrong, how do I fix it?

(side note: I'm thinking  it has to do with the way arctan is calculated in maple limits it to stay in range -pi to pi
"For real arguments x, y, the two-argument function arctan(y, x), computes the principal value of the argument of the complex number x+Iy, so −π < arctan(y,x) ≤ π." from https://www.maplesoft.com/support/help/Maple/view.aspx?path=invtrig)

pjf

## modification of an expression...

Hello people in mapleprimes,

I want to simplify the next expression which has 1/k as its exponent,

especially, I want to collect for T.　I hope you will teach me how to do it.

(F__X*(Omega+1)/(F__I*(beta-1)*T))^(1/k)*(T/phi)^(beta/k)

If I do as

simplify(%)assuming(symbolic);

the output is

F__X^(1/k)*(Omega+1)^(1/k)*F__I^(-1/k)*T^((beta-1)/k)*(1/(beta-1))^(1/k)*phi^(-beta/k)

But, as all variables has 1/k as its exponent, I want to collect it to (...)^(1/k).

Is this possible?

taro

## plot a 3 variable function...

i would like to plot a cube with the color given by a 3 variables functions (a way to plot in R^4)

in this way the cube is the domain of the functions, its color is the value of the function, i would like to put in evidence the max min of such function

but the command that i tried to use does not work:

plots[display](plotools([cuboid]([0,0,0],[1,1,1]),trasparency=.7,colorscheme["xyzcoloring",proc(x,y,z) option operator , arrow; x^2 + y^2 - z^2 end(proc)])

thanks for your help, anna rita

## Writing Series in maple...

f=sum((2*q*cos(2* i*x)*(-1)^(i)*(-1)^((2*i-1)))/(i*Pi),i=1.3.5...35)

I want to write this series but getting error

the result is

2*q*cos(2*x)/Pi-2*cos(6*x)*q/(3*Pi)+2*q*cos(10*x)/(5*Pi)-2*q*cos(14*x)/(7*Pi)+2*q*cos(18*x)/(9*Pi)-2*q*cos(22*x)/(11*Pi)+2*q*cos(26*x)/(13*Pi)-2*q*cos(30*x)/(15*Pi)+2*q*cos(34*x)/(17*Pi)-2*q*cos(38*x)/(19*Pi)+2*q*cos(42*x)/(21*Pi)-2*q*cos(46*x)/(23*Pi)+2*q*cos(50*x)/(25*Pi)-2*q*cos(54*x)/(27*Pi)+2*q*cos(58*x)/(29*Pi)-2*q*cos(62*x)/(31*Pi)+2*q*cos(66*x)/(33*Pi)-2*q*cos(70*x)/(35*Pi)

can anybody help

## solving a PDE system with constant parameters ...

Hi guys!

I have a PDE system. The mayority of the equations are equal to zero, but two of them are:

where a, b, c, d are CONSTANT parameters. I know that if a=b=d=c=1 the system is inconsistent. But I also know that if a=-1, b=d=0 and c=1 the system is consistent and exist the solution. I wanna know if there's a way to ask maple to find another selections of my parameter that make my PDE consistent and what it's the solution for that selection of a,b,c,d.

Here's my PDE system (sys2).

test.mw

thank you so much for your time!

## How can I display operators such as + and - and sq...

It is possible to display something like:

4 + 3 = x - 1

without Maple actually adding the 4 and 3 and putting that as a 7?

Same idea with sqrt. Is it possible to write sqrt(9) in a worksheet and actually seeing it as square root of 9 rather than a 3. Maple automatically simplifies everything so it's kinda hard to show a step by step process. Is there a way to solve this problem?

To be clear, I am talking about typing this into an active worsheet line. I know I can do a lot of this if I just do text becuase text lines obviously don't execute. They just display text. The reason I need to have this working is becuase sometimes I would have a command line where I want some of it to be excuted and some of it not so I can't just use text.

Thank you

## dsolve initial conditions...

Consider a simple differential equation:

f1 := t -> sin(t);
f2 := t -> cos(t);
dsys := {diff(x(t), t) = x(t)*f1(t)+f2(t), x(0) = 3};
solution_procedure := dsolve(dsys, type = numeric, output = listprocedure);

If initial condition is given like this: x(0)=3, then it compiles. But if I define x(0)=f1(3) then it gives an error:

Error, (in dsolve/numeric/process_input) invalid specification of initial conditions, got HFloat(3.0) = sin(3)

How can I handle this?

## beep after completing a task...

How can I ask Maple to wake me up after running the code?

It takes a long time to finish the job. So it would be helpful to play a beep or something to inform me the answer is ready.

## Error, (in dsolve/numeric/bvp/convertsys) too few ...

If i have boundary conditions with D(psi), i have no problem. But if i have condition with psi(infinity) (which i need), Maple says "too few boundary conditions". Maybe i make stupid mistakes, but i don't see.

restart;
assume(r, nonnegative);
ic_Re := &psi;Re(0) = 0, (D(&psi;Re))(0) = 0;
ic_Im := &psi;Im(0) = 0, (D(&psi;Im))(0) = 0;
V0 := 2.5; ERe := 1.5; EIm := 1.2; &hbar; := 6.582; mu := 938.27*(1/2); Q0 := 1.5; Rq := 4.5; Rv := 2.5;
Q := proc (r) options operator, arrow; -Q0*exp(-r/Rq) end proc;
V := proc (r) options operator, arrow; -V0*exp(-r/Rv) end proc;
Eqn_&psi;Re := -&hbar;^2*(diff(&psi;Re(r), r, r)+2*(diff(&psi;Re(r), r))/r)/(2*mu)-ERe*&psi;Re(r)+V(r)+EIm*&psi;Re(r) = Q(r);
Eqn_&psi;Im := -&hbar;^2*(diff(&psi;Im(r), r, r)+2*(diff(&psi;Im(r), r))/r)/(2*mu)-EIm*&psi;Re(r)-ERe*&psi;Im(r) = 0;
F := dsolve({ic_Im, ic_Re, Eqn_&psi;Im, Eqn_&psi;Re}, numeric);
plots[odeplot](F, [r, &psi;Re(r)], r = 0 .. 20, numpoints = 500);

plots[odeplot](F, [r, &psi;Re(r)], r = 0 .. 20, numpoints = 500);

restart;
assume(r, nonnegative);
ic_Re := &psi;Re(0) = 0, &psi;Re(infinity) = 0;
ic_Im := &psi;Im(0) = 0, &psi;Im(infinity) = 0;
V0 := 2.5; ERe := 1.5; EIm := 1.2; &hbar; := 6.582; mu := 938.27*(1/2); Q0 := 1.5; Rq := 4.5; Rv := 2.5;
Q := proc (r) options operator, arrow; -Q0*exp(-r/Rq) end proc;
V := proc (r) options operator, arrow; -V0*exp(-r/Rv) end proc;
Eqn_&psi;Re := -&hbar;^2*(diff(&psi;Re(r), r, r)+2*(diff(&psi;Re(r), r))/r)/(2*mu)-ERe*&psi;Re(r)+V(r)+EIm*&psi;Re(r) = Q(r);
Eqn_&psi;Im := -&hbar;^2*(diff(&psi;Im(r), r, r)+2*(diff(&psi;Im(r), r))/r)/(2*mu)-EIm*&psi;Re(r)-ERe*&psi;Im(r) = 0;
F := dsolve({ic_Im, ic_Re, Eqn_&psi;Im, Eqn_&psi;Re}, numeric);
Error, (in dsolve/numeric/bvp/convertsys) too few boundary conditions: expected 5, got 4

## Plotting wavefunctions...

Hi, I have been trying to solve the Schrodinger equation for harmonic oscillators using dsolve and plot the the wavefunctions for the different energy levels. However I am struggling to plot all the different wavefuntions on the same plot. I also want to normalize the wavefunctions to help compare their shapes and values. Here's my code:- schro := {diff(psi(x), x, x)-(alpha*x^4+x^2-energy)*psi(x) = 0}; // d / d \\ / 4 2 \ \ { |--- |--- psi(x)|| - \alpha x + x - energy/ psi(x) = 0 } \\ dx \ dx // / ic := {psi(3) = 0, (D(psi))(3) = 1}; {psi(3) = 0, D(psi)(3) = 1} schro1 := subs(energy = 3.30687, alpha = .1, schro); soln1 := dsolve(schro1 union ic, {psi(x)}, type = numeric); // d / d \\ / 4 2 \ \ { |--- |--- psi(x)|| - \0.1 x + x - 3.30687/ psi(x) = 0 } \\ dx \ dx // / proc(x_rkf45) ... end; with(plots); [animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot] odeplot(soln1, [x, psi(x)], -3 .. 3); Thank in advance