Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I want to find an approximation for a 3-dim vector y(t)=(y1,y2,y3) at multiple times t, so as to get:

y(t1)=[b0,0,0](y1(t1))^0(y2(t1))^0(y3(t1))^0 + [b0,0,1](y1(t1))^0(y2(t1))^0(y3(t1))^1 + ... + [b3,0,0](y1(t1))^3(y2(t1))^0(y3(t1))^0

y(t2)=[b0,0,0](y1(t2))^0(y2(t2))^0(y3(t2))^0 + [b0,0,1](y1(t2))^0(y2(t2))^0(y3(t2))^1 + ... + [b3,0,0](y1(t2))^3(y2(t2))^0(y3(t2))^0

...

So I want 20 b coefficients with quaternary-base subscripts (I belive it is called) for multiple values of t.

I want to have enough approximations to solve for the the coefficients b and then perform a Least Squares method Calculation thereafter. 

Can anyone help me please?

Hello

I have an 8x8 sytem of equations where I can easily solve the first 2 equations by hand. If I solve the full system in Maple it gives me some ugly expressions and I would like to simplify it. I know that, at least some of it, can be simplified since I have solved two equations by hand. It is easy to show that N_M=(W_M/(B*K_A^(1-B)))^(1/(B-1)) and X_N=(W_M/(B*K_A^(1-B)))^(B/(B-1))*K_M^(1-B), but Maple gives me some result with logarithms.

Can anyone help me solve this system of equations and get some nice solutions, if at all possible?

Thank you!

Yoy can find my Maple file at: https://drive.google.com/open?id=0B5luBKCBLzmeM2MxNmFoQkdoRVk

With a member of the community I had some discussion about using Maple for limits of sequences.

The specific task was about F:=4*sqrt(n)*sin(Pi*sqrt(4*n^2+sqrt(n))) and limit F for n --> infinity for integers, which is asserted to be Pi, see https://math.stackexchange.com/questions/2493385/find-the-limits-lim-n4-sqrtn-sin-pi-sqrt4n2-sqrtn.

For moderate size of integers n it can be 'confirmed' by numerical evaluations. Formally it is not 'obvious' at all.

However Maple answers by

limit(F, n = infinity) assuming n::posint;

                              undefined

This is 'explained' by the help about assuming/details:

"The assuming command does not place assumptions on integration or summation dummy variables in definite integrals and sums, nor in limit or product dummy variables, because all these variables already have their domain restricted by the integration, summation or product range or by the method used to compute a limit. ..."
The help continues with suggestions how to treat the situation.

Which means that the limit is taken in the Reals, not in the discrete Naturals.

A more simple example may be limit(sin(n*Pi), n = infinity) assuming n::posint which returns "-1 .. 1".


But here we go:

MultiSeries:-asympt(F, n):
simplify(%) assuming n::posint: collect(%, n); #lprint(%);
limit(%, n=infinity);

   O(1/2048*Pi^3/n^(5/2)) + Pi -1/96*Pi^3/n - 1/16*Pi/n^(3/2) + 1/30720*Pi^5/n^2

                                  Pi

As desired.

As you know, the MapleCloud is a good way to share all sorts of interactive documents with others, in private groups or so they are accessible to everyone. We recently posted some new content that I thought people might be particularly interested in: a collection of Maple Assistants.

 

Up until now, Maple Assistants were only available from within Maple, but now you can take advantage of these powerful tools wherever you are, using your web browser.

 

Code Generation  - Translate Maple code to C, Java, Python, R, and more

Scientific Constants – Explore over 20000 values of physical constants and properties of chemical elements, including units and uncertainty values

Special Functions – Explore the properties of over 200 special functions, including the Hypergeometric, Bessel, Mathieu, Heun and Legendre families of functions.

Units Converter – Convert between over 500 units of measurement. (In addition to the standard stuff, you can find out how many fortnights old you are, or how long your commute is in furlongs!)

z=(-1/(4*(-u+L)))(4*p^2*b^2*d-3*g*c*p^2)

given fixed values of u, L, and c, I would like to Maximiz Z(p, b) by finding best p and b, subject to 1-(2* d)/(p*(sqrt(g)+1))<=b<=1 and 0<=d<=L and Min(c,L)<=p<=u and1<=g<=4 

When I put "print(A=B=C);" in Maple 13 I get the error:

Error, `=` unexpected

about the second equality sign. How do I remedy that?
Thanks!

mapleatha

 

I input print(lambda*I) and I get I*lambda (Greek lambda symbol); Why is the order reversed?
Maple 13 (GUI) is doing it.
Thanks!

mapleatha

 I have in my Maple documents many good quality plots resulting from simulations. I need to export (or paste) them to templates of transactions in Word without loosing quality, and beeing flexible to some degree to fit the dimension.

Until now when I paste such plots the quality is lost and especially on descripltion on axes (vertical).

What I have to do? Do I need to go throuhg pdf format ? 

Seems to be when shading=none in fieldplot3d the plot returned is empty.  Is that a bug?

I have just posted an article with this title at Maplesoft Application Center here.
It was motivated by a question posed by  Markiyan Hirnyk  here and a test problem proposed there by Kitonum.

Now I just want to give the promissed complete solution to Kitonum's test:

Compute the plane area of the region defined by the inequalities:

R := [ (x-4)^2+y^2 <= 25, x^2+(y-3)^2 >= 9, (x+sqrt(7))^2+y^2 >= 16 ];

plots:-inequal(R, x=-7..10, y=-6..6, scaling=constrained);

The used procedures (for details see the mentioned article):

ranges:=proc(simpledom::list(relation), X::list(name))
local rez:=NULL, r,z,k,r1,r2;
if nops(simpledom)<>2*nops(X) then error "Domain not simple!" fi;
for k to nops(X) do    r1,r2:=simpledom[2*k-1..2*k][]; z:=X[k];
  if   rhs(r1)=z and lhs(r2)=z then rez:=z=lhs(r1)..rhs(r2),rez; #a<z,z<b
  elif lhs(r1)=z and rhs(r2)=z then rez:=z=lhs(r2)..rhs(r1),rez  #z<b,a<z
  else error "Strange order in a simple domain" fi
od;
rez
end proc:

MultiIntPoly:=proc(f, rels::list(relation(ratpoly)), X::list(name))
local r,rez,sol,irr,wirr, rels1, w;
irr:=[indets(rels,{function,realcons^realcons})[]];
wirr:=[seq(w[i],i=1..nops(irr))];
rels1:=eval(rels, irr=~wirr);
sol:=SolveTools:-SemiAlgebraic(rels1,X,parameters=wirr):
sol:=remove(hastype, eval(sol,wirr=~irr), `=`); 
add(Int(f,ranges(r,X)),r=sol)
end proc:

MeasApp:=proc(rel::{set,list}(relation), Q::list(name='range'(realcons)), N::posint)
local r, n:=0, X, t, frel:=evalf(rel)[];
if indets(rel,name) <> indets(Q,name)  then error "Non matching variables" fi;
r:=[seq(rand(evalf(rhs(t))), t=Q)];
X:=[seq(lhs(t),t=Q)];
to N do
  if evalb(eval(`and`(frel), X=~r())) then n:=n+1 fi;
od;
evalf( n/N*mul((rhs-lhs)(rhs(t)),t=Q) );
end proc:

Problem's solution:

MultiIntPoly(1, R, [x,y]):  # Unfortunately it's slow; patience needed!
radnormal(simplify(value(%)));

evalf(%) = MeasApp(R, [x=-7..10,y=-6..6], 10000); # A rough numerical check
           61.16217534 = 59.91480000

 

Hi everybody,

I use the Grid[Launch] function  (Windows 7, Maple 2015) to distribute many similar computations over all the processors my machine has.
 

Question 1

My machine is a 4 processors one (not hyperthreaded).
When it was equiped with Windows XP and I was using, let's say 2 proc., the performance manager showed that two processors among 4 were charged up to 95%-100% while the others remained around 0 %.
In this case (my problem is perfecly scalable), the elapsed time was exactly half it was when I used only one proc (and twice as large as the time obtained with 4 proc).


Now I'm working with Windows 7.
This behaviour puzzles me : if I use 2 procs among four and look to the performance manager, all the 4 procs are partially charged. It looks like Window 7 was distributing itself the computations ?
As a result (?), running on 4 proc no longer takes 25% of the elapsed time on 1 proc, but "only" 40%.
Could it be that some inner "dispatching task within processors" Windows 7 could have, might interfere with the distribution of tasks  Grid[Launch] does ?

Does anyone of you already had a same experience ?
If Windows 7 really has some "task managing procces", is it possible to switch it off ?


 

Question 2

Same context as previously.
I run the same code (search of a local maximum of a function where some of its parameters are randomly valued ; the sample of these parameters hase size 10000) over 4 proc.
On order to save intermediate results I wrote a loop within it I send blocks of 500 computations at the same time over the 4 proc.
This loop is executed 5 times (5*500*4 = 10000)

I observe that after each step of the loop the memory used is increased by a rather constant amount. It looks like if a 4 proc computation of 500 optimizations was costing N Mega Bytes, and that the memory was increased by N MB each times the loop is executed.
At the very end the computational time can dramatically slow down because of the amount of the memory used.

More precisely my pseudo code looks like this :
for step 1 to 5 do 
   Grid[Launch](MyCode, numnodes=4, imports=[BlockOf2000data], ...):  
   
# MyCode uses only one quarter of this 2000 data block depending on the processor number it runs on
end do:

Does it exist a way to clean the memory just before the "end do" command in order to avoid it to grow continuously ?


Any contribution will be highly appreciated.

The expression exp(2*t) gives us the number e^(2t). Can we get rid of the parentheses around 2t?
Thank you!

mapleatha

 

Hello,

I hope my question is not to general. I have a polynomial of 8th order

expression:=a8(z) * x^8 + .... + a1(z) * x + a0(z) = 0

on which I am using solve/RootOf

sol:=[solve(expression,x)]

Now when I plot it against z the solution has a jump, why?

When deriving the polynomial I could as well have used another variable instead of x above, say y. These two are related by a function...Then when I write down the 8th order polynomial in y and use RootOf/solve, then no jump occurs.

Is there a way to handle this because left of the jump the solution is not correct while right of it, it is...

Hello,

I wann to send a file  with FTP. I need an example how to do this with URL post.

 

Thanks

I have 3 given square matrices A, B, C. I would like to print

A*B = C,

where A, B, C are replaced by their values, but the multiplication is not executed.
How do I do it?

Thank you!

mapleatha

First 892 893 894 895 896 897 898 Last Page 894 of 2215