MaplePrimes Questions

Hello again,   I'm trying to write a procedure to multiply quaternions.   We know that they can be represented as a vector of length 4.   See Wikipedia.   My try  -

qaa=[8,4,6,2] and qab =[2,,4,6,8]
mult:=proc(a,b)

end proc;

maybe needs some looping or data from a table.  

Regards,

Matt

Hello All, is there a command/instruction that can tell me the phase margin, gain margin automatically after I have a bode plot, please?

Units are a neverending story, here's a variant of a problem raised before.

How can i get the minimum of 2 values with Units[Standard] loaded, when one of them could be zero (this loosing its units)?

See also 

  • https://www.mapleprimes.com/questions/229640-Units-Disappearing
  • https://www.mapleprimes.com/questions/230165-Error-in-UnitsTestDimensions-Invalid
  • https://www.mapleprimes.com/questions/230064-Compare-Similar-Units

with(Units[Standard])

a := 15*Unit('m')

15*Units:-Unit(m)

(1)

b := 13000*Unit('mm')

13000*Units:-Unit(mm)

(2)

min(a, b)

13*Units:-Unit(m)

(3)

c := 0*Unit('m')

0

(4)

min(a, c)

Error, (in Units:-Standard:-min) units with incompatible dimensions found: {1, length}

 

``


 

Download UnitsStandardCompare.mw


 

restart;

M__h := 0.352e-1;

0.352e-1

 

0.34e-1

 

0.8354e-1

 

0.96e-2

 

.123

 

0.7258e-1

 

0.214e-1

 

0.219e-1

 

.123

 

.7902

 

.11

 

0.136e-3

 

0.5e-1

 

0.8910e-1

 

0.45e-1

 

.7

 

.7214

 

1.354

 

0.235e-1

(1)

pdes := [diff(B(t, x), t) = M__h-beta__1*B(t, x)*G(t, x)/N__h+beta__2*B(t, x)*G(t, x)/N__h-mu__h*B(t, x)+sigma__h*E(t, x)*(diff(B(t, x), x, x)), diff(C(t, x), t) = beta__1*B(t, x)*G(t, x)/N__h-u[1]*C(t, x)/(1+C(t, x))-mu__h*C(t, x)*(diff(C(t, x), x, x)), diff(DD(t, x), t) = beta__2*DD(t, x)*G(t, x)/N__h-u[1]*DD(t, x)/(1+DD(t, x))-mu__h*DD(t, x)-delta__1*DD(t, x)*(diff(DD(t, x), x, x)), diff(E(t, x), t) = u[1]*C(t, x)/(1+C(t, x))+u[1]*DD(t, x)/(1+DD(t, x))-(mu__h+sigma__h)*E(t, x)*(diff(E(t, x), x, x)), diff(F(t, x), t) = M__b-beta__3*F(t, x)*C(t, x)/N__b+beta__4*F(t, x)*DD(t, x)/N__b-mu__b*F(t, x)*(diff(F(t, x), x, x)), diff(G(t, x), t) = beta__3*F(t, x)*C(t, x)/N__b+beta__4*F(t, x)*DD(t, x)/N__b-mu__b*G(t, x)*(diff(G(t, x), x, x))];

[diff(B(t, x), t) = 0.352e-1-0.891056911e-1*B(t, x)*G(t, x)-0.96e-2*B(t, x)+0.8910e-1*E(t, x)*(diff(diff(B(t, x), x), x)), diff(C(t, x), t) = .6791869919*B(t, x)*G(t, x)-0.45e-1*C(t, x)/(1+C(t, x))-0.96e-2*C(t, x)*(diff(diff(C(t, x), x), x)), diff(DD(t, x), t) = .5900813008*DD(t, x)*G(t, x)-0.45e-1*DD(t, x)/(1+DD(t, x))-0.96e-2*DD(t, x)-0.235e-1*DD(t, x)*(diff(diff(DD(t, x), x), x)), diff(E(t, x), t) = 0.45e-1*C(t, x)/(1+C(t, x))+0.45e-1*DD(t, x)/(1+DD(t, x))-0.9870e-1*E(t, x)*(diff(diff(E(t, x), x), x)), diff(F(t, x), t) = .7214-.1739837398*F(t, x)*C(t, x)+.1780487805*F(t, x)*DD(t, x)-1.354*F(t, x)*(diff(diff(F(t, x), x), x)), diff(G(t, x), t) = .1739837398*F(t, x)*C(t, x)+.1780487805*F(t, x)*DD(t, x)-1.354*G(t, x)*(diff(diff(G(t, x), x), x))]

(2)

bcs := [(D[2](B))(t, 0) = 0, (D[2](B))(t, 1) = 0, (D[2](C))(t, 0) = 0, (D[2](C))(t, 1) = 0, (D[2](DD))(t, 0) = 0, (D[2](DD))(t, 1) = 0, (D[2](E))(t, 0) = 0, (D[2](E))(t, 1) = 0, (D[2](F))(t, 0) = 0, (D[2](F))(t, 1) = 0, (D[2](G))(t, 0) = 0, (D[2](G))(t, 1) = 0, B(0, x) = 100, C(0, x) = 70, DD(0, x) = 50, E(0, x) = 70, F(0, x) = 100, G(0, x) = 70]

[(D[2](B))(t, 0) = 0, (D[2](B))(t, 1) = 0, (D[2](C))(t, 0) = 0, (D[2](C))(t, 1) = 0, (D[2](DD))(t, 0) = 0, (D[2](DD))(t, 1) = 0, (D[2](E))(t, 0) = 0, (D[2](E))(t, 1) = 0, (D[2](F))(t, 0) = 0, (D[2](F))(t, 1) = 0, (D[2](G))(t, 0) = 0, (D[2](G))(t, 1) = 0, B(0, x) = .100, C(0, x) = .70, DD(0, x) = .50, E(0, x) = .70, F(0, x) = .100, G(0, x) = .70]

(3)

sol := pdsolve(pdes, bcs, numeric);

module () local INFO; export plot, plot3d, animate, value, settings; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; end module

(4)

sol:-plot3d([B(t, x), C(t, x)], t = 0 .. 20, x = 0 .. 20)

Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.25):
Newton iteration is not converging

 

``


 

Download spatial_1.mw

I want to vary t from -15 to -7 and from 7 to 15 how to write the Explore command?
example : Explore(Fig(t), t=-15..-7 and t=7..15); which does't work.  Thank you.

The center of mass for the density function p(r,θ,φ) = ln(r^2 + θ^2 + φ^2 +1) over the solid sphere radius 2.

I'm not sure how to do this on Maple.  

Many thanks!

Hi friends!

I have the following problem.

I'm trying to generate a matrix given a certain lenght n and a polynomial g(x) of degree r as follows:

If n=10, g(x)=x^4+3x^3+x^2+2x+1 and r=degree(g(x))=4, then the resulting matrix will be

 

 

 

 

 

i.e. a matrix with 10 columns, n-r=6 lines, and whose inputs are the coefficients of the polynomial, as follows:

Any help will be very appreciated.

Thank you!

I'm doing som XML readin, and need a bit help in using the HasChild function properly.

The attachment shows that using HasChild on a xmltree works fine, but I can't get i working when using it on a xmldocument. The latter is usually the case when you get when you read in from a file.

HasChild.mw

Hello there, 

Would you please tell me how to re-write the 'PMSM_v_eq' as 'PMSM_flux_eq_desired'? My simple attempt was using the 'solve()' command, but it failed. 

Here is the worksheet:


 

restart;

PMSM_v_eq := V__alphabeta(t) = R__s * i__alphabeta(t) + L__s*diff(i__alphabeta(t), t) + diff(lambda__alphabeta(t), t);

V__alphabeta(t) = R__s*i__alphabeta(t)+L__s*(diff(i__alphabeta(t), t))+diff(lambda__alphabeta(t), t)

(1)

 

PMSM_flux_eq := solve(PMSM_v_eq, lambda__alphabeta(t));

Error, (in solve) cannot solve expressions with diff(lambda__alphabeta(t), t) for lambda__alphabeta(t)

 

PMSM_flux_eq_desired := lambda__alphabeta(t) =  int(V__alphabeta(t) - R__s * i__alphabeta(t), t) - L__s*i__alphabeta(t);

lambda__alphabeta(t) = int(V__alphabeta(t)-R__s*i__alphabeta(t), t)-L__s*i__alphabeta(t)

(2)

 


Thank you!

Download PMSM_eq.mw

Hello

I have no choice but use Grid:-Map and Grid:-Seq in my calculations due to the size of them.  Here is a very small example that is puzzling me (Perhaps I did something really silly and did not realize). 

ansa:=CodeTools:-Usage(Grid:-Map(w->CondswithOnesolutionTest(w,eqns,vars,newvars,tlim),conds5s)):

with the following result:

ansa:=set([{alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}, {}, {}, {}, {}, {}], [{}, {}, {}, {}, {}, {alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}], [{alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}, {}, {}, {}, {}, {}], [{}, {}, {}, {}, {}, {alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}])

The same thing but now using only map

ansb:=CodeTools:-Usage(map(w->CondswithOnesolutionTest(w,eqns,vars,newvars,tlim),conds5s)):
ansb:={[{}, {}, {}, {}, {}, {alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}], [{}, {}, {}, {}, {}, {alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}], [{alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 2] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}, {}, {}, {}, {}, {}], [{alpha[1, 1] = 0, alpha[1, 2] = 0, alpha[1, 3] = 0, alpha[1, 4] = 0, alpha[1, 5] = 0, alpha[1, 6] = 0, alpha[1, 8] = 0, alpha[1, 9] = 0, alpha[2, 0] = 0, alpha[2, 1] = 0, alpha[2, 2] = 0, alpha[2, 4] = 0, alpha[2, 5] = 0, alpha[2, 7] = 0, alpha[2, 8] = 0, alpha[2, 9] = 0, alpha[3, 0] = 0, alpha[3, 1] = 0, alpha[3, 3] = 0, alpha[3, 4] = 0, alpha[3, 5] = 0, alpha[3, 6] = 0, alpha[3, 7] = 0, alpha[3, 8] = 0, alpha[3, 9] = 0}, {}, {}, {}, {}, {}]}

(This is what I expected as the result).

 

Why did Grid:-Map add set to the answer?  What am I missing?  

 

Many thanks

 

mwe.mw

I have a system of ODEs, and I am using the DifferentialAlgebra Package. I am getting this error message: Error, (in DifferentialAlgebra:-RosenfeldGroebner) unexpected occurrence of the non-rational constants {-I, I, 2*I} in the given input. What should I do?

Here is the problem. I start Maple 2020 on windows 10. Run a script which takes 1-2 days to complete. 

During this time, I can't use that Maple at all, since it is busy. 

I could start Maple 2019, and that runs as completely separate process. But I want to use Maple 2020 since some things in my scripts do not work on Maple 2019 that work on Maple 2020.

If I start a new instance of Maple 2020, by doing Start->Maple 2020. it does seem to start it OK, but I noticed it seems to be somehow still connected to the one running somehow.  May be they are sharing the same interface?

I can use the new instance now and open new worksheet and use it. But it seems to become very slow, as if it is sharing something with the other Maple 2020 running the long script which uses lots of resources. It is not RAM issue, I have 64 GB RAM, and there is plenty of free RAM left. 

When I close the new Maple 2020 workseet I started, I get a message asking if I want to save the worksheet that I have open from the earlier instance which is still running ! 

I say no ofcourse, as I do not want to terminate that instance, I want to keep it running until the script is completed.

My question is: Could someone may be explain exactly what happens when one starts new Maple 2020, while one is allready running? Why it seems they are sharing either the interface or something else.  How to start completely separate Maple 2020 instance on same PC while one is allready running?

With Mathematica, this issue does not happen. I can start two instances of same version on same PC, and there is nothing shared between them at all.  This does not seem to be the case with Maple.

Maple 2020.1 on windows 10.

 

sometimes solve returns solution of the form

restart;

#eqs:=.....
#sol:=solve(eqs,{v[1],v[2],v[3]});

sol:={v[1]=t,v[2]=3/2*t,v[3]=v[3]};

And wanted to remove all those that represnt arbitrary solution, which is v[3]=v[3] above.

I could do this using

remove(x->lhs(x)=rhs(x),sol);

which gives

{v[1]=t,v[2]=3/2*t};

But as an excersise, I could not figure how to do the same using subsindent (where I wanted to replace v[3]=v[3] with {} or NULL,. and also using applyrule.

Is it possible to do the same as above but using subsindent and applyrule (which is similar to patmatch)? 

I noticed the other day that the magnitude ||v|| for vector v gives different results based on the library loaded. I have not heard of any reason in my studies for there to be a magnitude calculation that is different from the

m = sqrt(`x__1`^(2)+`x__2`^(2)+...+`x__n`^(2))

Which I've come to understand as the calculation for the length of a vector of size N.
Why does the VectorCalculus library calculate the correct ||v|| whereas LinearAlgebra seemingly returns the largest element?

Sorry I can't make it very easy to understand in the title, this is what I want:

In the forms of Method of Underdetermined Coefficient a*y''+b*y'+c*y=F(x), I want the maple to assume b^2 < 4ac so the homogenous will contain sin and cos. Is there any quick command to do this or I have to develop on my own? 

I want this because I want to set the coefficient unknown and graph them, so if I do what Maple default does, when I plug the coefficients (which b^2<4ac) it returns imaginary numbers and I don't know how do deal with it.

Thank you for everyone helping.

First 442 443 444 445 446 447 448 Last Page 444 of 2385