MaplePrimes Questions

Why GenerateMatrix produces wrong results?

``

restart

N := 2:

a := 1:

with(ArrayTools):

``

Qa := [-0.5379667864e-1*(diff(tau[1, 1](t), t, t))+7.862351349*10^(-11)*tau[2, 1](t)-8.050993899*10^(-12)*(diff(tau[2, 1](t), t, t))+.1166068042*(diff(tau[1, 2](t), t))+2.181309895*10^(-11)*(diff(tau[2, 2](t), t))+.5309519363*tau[1, 1](t) = 0, -1.265965258*10^(-11)*(diff(tau[1, 1](t), t, t))+.4884414390*tau[2, 1](t)-0.4948946475e-1*(diff(tau[2, 1](t), t, t))+2.738892495*10^(-11)*(diff(tau[1, 2](t), t))+.1340883970*(diff(tau[2, 2](t), t))+1.246469610*10^(-10)*tau[1, 1](t) = 0, 3.649366137*10^(-10)*tau[2, 2](t)-9.135908950*10^(-12)*(diff(tau[2, 2](t), t, t))-5.160677740*10^(-11)*(diff(tau[2, 1](t), t))+1.953765755*tau[1, 2](t)-0.4948946473e-1*(diff(tau[1, 2](t), t, t))-.3476543209*(diff(tau[1, 1](t), t)) = 0, 2.246672656*tau[2, 2](t)-0.5690888318e-1*(diff(tau[2, 2](t), t, t))-.3198194887*(diff(tau[2, 1](t), t))+4.602903411*10^(-10)*tau[1, 2](t)-1.159417294*10^(-11)*(diff(tau[1, 2](t), t, t))-8.175817372*10^(-11)*(diff(tau[1, 1](t), t)) = 0]

Q1 := [seq(seq(diff(tau[i, j](t), t), i = 1 .. M), j = 1 .. N)]

[diff(tau[1, 1](t), t), diff(tau[2, 1](t), t), diff(tau[1, 2](t), t), diff(tau[2, 2](t), t)]

(1)

with(LinearAlgebra):

CR := GenerateMatrix(simplify(Qa), Q1)

CR := Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = .1166068042, (1, 4) = 0.2181309895e-10, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0.2738892495e-10, (2, 4) = .1340883970, (3, 1) = -.3476543209, (3, 2) = -0.5160677740e-10, (3, 3) = 0, (3, 4) = 0, (4, 1) = -0.8175817372e-10, (4, 2) = -.3198194887, (4, 3) = 0, (4, 4) = 0}), Vector(4, {(1) = 0.5379667864e-1*(diff(diff(tau[1, 1](t), t), t))-0.7862351349e-10*tau[2, 1](t)+0.8050993899e-11*(diff(diff(tau[2, 1](t), t), t))-.5309519363*tau[1, 1](t), (2) = 0.1265965258e-10*(diff(diff(tau[1, 1](t), t), t))-.4884414390*tau[2, 1](t)+0.4948946475e-1*(diff(diff(tau[2, 1](t), t), t))-0.1246469610e-9*tau[1, 1](t), (3) = -0.3649366137e-9*tau[2, 2](t)+0.9135908950e-11*(diff(diff(tau[2, 2](t), t), t))-1.953765755*tau[1, 2](t)+0.4948946473e-1*(diff(diff(tau[1, 2](t), t), t)), (4) = -2.246672656*tau[2, 2](t)+0.5690888318e-1*(diff(diff(tau[2, 2](t), t), t))-0.4602903411e-9*tau[1, 2](t)+0.1159417294e-10*(diff(diff(tau[1, 2](t), t), t))})

(2)

``

``

``

Download GenMatrix.mw

I use Maple 2020 on a Windows 10 PC.

The command ssystem("CMD") enables to launch any Windows command accessible from the shell.
But how to launch a PowerShell command?

For instance ssystem("get-process") returns -1 (not surprising in fact for get-process is not a shell process).
How can I tell Maple that this command is to be found in the PowerShell ?

And even, I this possible for, in the ssystem help page, it's said that not all the command can be launched by ssystem

TIA

I have quite a big code with lot of functions how to convert all together to python in one go 

Or any other way of advice 

As recoding is difficult. Can you help with a small sample program with 2 simple functions returning values

Graph theory and it's algorithms, linear algebra , have used in my program codings mainly 

In small function kind take to a create a small graph find allpairshortestpath 

It would help to understand how it converts

Please help sorry to disturb in your busy schedule

Hi,

I am just starting with Maple after using Mathcad for nearly 30 years. I want to recreate something I have used a lot in Mathcad: select certain rows in array based on a specified criterion. For example, I want to save just the rows that have a certain value in a certain column and save the new array for use later. I am slowly learning how to do it Maple--for instance, I learned that I need to change the variable printlevel if I want to get the output from nested loops. 

I currently have the following code:

k := 1;

rows := RowDimension(M);


for i to rows do

   if M[i, 3] = "A" then

      row(out, k) := row(M, i);

       k := k + 1;

   end if;

end do;
out;

 

This doesn't seem to work, though. When I try to display out, I just get the name out instead a matrix of values.

I would appreciate it if someone could give me some idea of what I am doing wrong (with Maple, that is).

Thanks,

John
 

Hello

I have the following summation to do, 

d(l,m')=\sum_{N=-l'}^{l'}d(l',N,m')=d^{l'}_{00}(\dfrac{\pi}{2})d^{l'}_{0m'}(\dfrac{\pi}{2})f_{m'0}+\sum_{N=1}^{l'}((-1)^{l'}+1)d^{l'}_{0N}(\dfrac{\pi}{2})d^{l'}_{Nm'}(\dfrac{\pi}{2})f_{m'N}

where  d^{l'}_{0N} are the rotation matrix functions and  f_{m'N} is a piecewise function which takes a certain value at N=0, another value for N even and it takes 0 as a value for N odd.

The prblem is that I don't know how to write a summation for N even only so that in that case i can replace f_{m'N} by its expression for N even. The other way is to write f_{m'N} as a piecewise function but in that case, i don't know how to do it (I tried to use assuming N even ..) but got wrong answer.

Thank you for helping me solving my proble.

Best regards.

Dear all, 

I'm trying to enter an equation (Navier-Stokes) in Maple using the Physics[Vectors] package. I am having trouble with the term 

$(u\cdot \nabla) u$

but Maple returns an error when entering the commands :

( u_(t,x,y,z) . %Nabla) u_(t,x,y,z)

I tried other combinations of this without success, like :

( u_(t,x,y,z) . %Nabla)(u_(t,x,y,z))

( u_(t,x,y,z) %. %Nabla) u_(t,x,y,z)

( u_(t,x,y,z) %. %Nabla) (u_(t,x,y,z))

Could you please give me some help with this? 

Hello,
I have a small problem with the display of fraction and x_dot at the same time. 

 

This the exemple :

with(Typesetting);
compactdisplay = flase;
Settings(typesetprime = false);
Settings(typesetdot = true);

diff(1/2*LongExpression*x(t), t);

The Results 

when I choose the typesetting level : Extended. I got this result :

And when I choose the typesetting level : Maple Standrad. I got this result 
        

What I  want to have is mix of both, it mean like this 

Hi please, how can I pair two lists and form another list? 

P := [.6286420119, -.6286420119, 0., 0., 0., 0., 0., 0., 0., 0., 0.]

Q = [2.106333379, 2.106333379, 4.654463885, 7.843624703, 10.99193295, 14.13546782, 17.27782732, 20.41978346, 23.56157073, 26.70327712, 29.84494078]

I want to pair them into something like this:

W := [ [.6286420119,2.106333379], [-.6286420119,  2.106333379] ... ]

Then use pointplot(W) and  display(seq(pointplot(W[j], j = 1 .. 20), insequence = true):

Hello Everyone.

Hope you are fine. I have two following queries

1. Are there any builtin commands in Maple, so that we can apply the finite difference method directly to the PDE's?

2. We all know about "BurdenFaires, and Burden's NUMERICAL ANALYSIS" book. The important Maple codes are discussed on this book. Is there any website where I can take these codes on Maple files?

I am waiting for kind response.

Thanks

I am trying to present a linear combination of vectors as such using mathML. In order to prevent automatic simplification I use InertForm package. The problem is, it also leaves me with unevaluated vector command, which is the only part of the expression I don't want to be inert.

Str :=  "1/3*Vector([3^(1/2), -3^(1/2), 3^(1/2), 0]) -1/3*Vector([3^(1/2), 3^(1/2), 3^(1/2), 0])+ Vector([2,1,1,0])":

Set := {op(InertForm:-Parse( Str ))};
Set := {-%*(%/(1, 3),

  %Vector([%^(3, %/(1, 2)), %^(3, %/(1, 2)), %^(3, %/(1, 2)), 0])),

  %*(%/(1, 3),

  %Vector([%^(3, %/(1, 2)), -%^(3, %/(1, 2)), %^(3, %/(1, 2)), 0])

  ), %Vector([2, 1, 1, 0])}

printf(InertForm:-ToMathML(`%+`(eval(op(Set)))))

Hence my question: Is there a way to only evaluate the vector command, while keeping the rest of the expression inert?

Hi,

How to animate my fractals procedures ? I managed to put them in the procedure, to explore them with the Explore command, but I can’t animate them, ( i want to export them in GIF format.) Thank you for your help

 

Fractalsanimate.mw

Hello,

I am a first time user of Maple. I have an (m x n) array called 'arr' with missing values. For all non NULL values within the array I'd like to apply a function, called 'EigenvalueEquation'. My Ansatz is as follows:

map(EigenvalueEquation, arr)

It produces an error since one cannot execute a function with a NULL value as an input. How can I skip those entries within my array? I'd like to avoid looping over the entire array.

Any help is greatly appreciated.

Patrick

Two of the three Watt's curves plotted in this worksheet display with gaps.

Why is this and how can these curves be displayed without gaps?

WattsCurve.mw

 Function given like this

J:=0

F:=proc(operation)

J:=0;

for i to n do
    for j from i + 1 to n do if A(i, j) = 1 then J := J + mod(X (operation) Y); end if; end do; end do;
end proc;

I have simply put the word operation their to explain

If call the fuction F by F("m")  m means multiple the I should get * operator should multiple and it should multiply

If I call function F by F("A") A means Addition then should get + operator should add and it should do +

If I call function F by F("S")  S means Subtraction then should get - operator should subtract and it should do -

mod means absolute value always

First 181 182 183 184 185 186 187 Last Page 183 of 2308