Maple 2016 Questions and Posts

These are Posts and Questions associated with the product, Maple 2016

I have a problem with writing this equation in maple.

the equation is: 

I want to write this equation in maple, so I write it in this way:

for k from 1 to 7 do tau[k] := add*(d(k, j)*(diff(theta[j](t), t, t)), j = 1 .. 7)+add(add(c[i, j, k]*(diff(theta[i](t), t))*(diff(theta[j](t), t)), j = 1 .. 7), i = 1 .. 7)+phi[k] end do:

but I see this error: Error, index out of bounds 

I appriciate if you help me find the problem.

Good day. Please can someone kindly help to reduce the result of this code. Thank you and kind regards

restart:
s:=(sum(a[j]*x^j,j=0..3)+sum(a[j]*exp(-(j-3)*x),j=4..7)):
F:=diff(s,x):
p1:=simplify(eval(s,x=q))=y[n]:
p2:=simplify(eval(F,x=q))=f[n]:
p3:=simplify(eval(F,x=q+h/3))=f[n+1/3]:
p4:=simplify(eval(F,x=q+h))=f[n+1]:
p5:=simplify(eval(F,x=q+5*h/3))=f[n+5/3]:
p6:=simplify(eval(F,x=q+2*h))=f[n+2]:
p7:=simplify(eval(F,x=q+7*h/3))=f[n+7/3]:
p8:=simplify(eval(F,x=q+3*h))=f[n+3]:


vars:= seq(a[i],i=0..7):
Cc:=eval(<vars>, solve({p||(1..8)}, {vars})):
for i from 1 to 8 do
	a[i-1]:=Cc[i]:
end do:
Cf:=s:
L:=collect(simplify(simplify(expand(eval(Cf,x=q+3*h)),size)), [y[n],f[n],f[n+1/3],f[n+1],f[n+5/3],f[n+2],f[n+7/3],f[n+3]], factor):
length(L);
H := ee -> collect(numer(ee),[exp],h->simplify(simplify(h),size))/collect(denom(ee),[exp],h->simplify(simplify(h),size)):
M:=y[n+3]=(H@expand)(L);
length(M);

 

> S:=-1/2*((-30*sqrt(3)+81*I)^(2/3)+21+2*sqrt(3)*(-30*sqrt(3)+81*I)^(1/3)-6*(-30*sqrt(3)+81*I)^(1/3)+I*sqrt(3)*(-30*sqrt(3)+81*I)^(2/3)-21*I*sqrt(3))/(-30*sqrt(3)+81*I)^(1/3);

When I enter

simplify(S);

a not much simpler expression involving arctan is output
but when I enter

factor(S);

the expected simplification to the number

3

is output.

This is not a but report, just a report of curious behavior.

I am using Maple 2016 on a Windows 10 PC.

 

             

Hi, I've been doing a few small explore plots where the ranges for the parameters are something like [-1,1], but 0 is a special value which will often need to be set.  The slider, gauge components, ... are a bit fiddly to set with exactly zero using a mouse to drag the value.  Thought about a few different ways to do this

* Right click and set value from the component properties option - a bit fiddly for the user and the graph doesn't immediately update when OK'ed.

* Extra control with a tick to set a zero value (fiddly programming and possible confusing interpretation)

* Slider component and snaptoticks=true

Last option seems to be the easiest all round, but I was wondering why it is only the slider component that has a snaptoticks property - none of the other components seem to support it and a gauge would probably be a more natural component to use.

Thanks in advance

Near the top of the large loop at the bottom of the uploaded worksheet IntSect is copied to IntSectRoll.

IntSectRoll is then modified several times within the loop. However IntSect also changes content even though there are no commands within the loop to cause this.

To avoid this is the reason IntSect is recreated from previous data each time before it is copied.

Is this a bug in my worksheet or in Maple 2016?

Constant_Diameter.mw

The theory behind the worksheet is described, without attribution, in the book The Penguin Dictionary of Curious and Interesting Geometry by David G. Wells.

Does this theory have a name and a discoverer?

I am puzzled by the strange behaviour of the following exampleSectionaken directly from the Programming Guide section 8.6. When I copy the example from the help to a worksheet as follows, I get an error stating that module m does not evaluate to a module in the use statement. 

> m := module() export a, b; a := 2; b := 3; end module:
use m in a + b end use;

Error: `m` does not evaluateto a module.

However, after a restart, when I execute the two statements as separate statements (separate prompts), the module does evaluate properly.

My question is, what is the safe workaround in coding to avoid this situation.

I have attached the worksheet.moduleeval.mw

In the following codes I am very sure exp(-3*q) is a factor both at numerator and denominator. However, I dont know how to annihilate this factor. Can someone kindly help to ensure it cancels out? Thanks and kind regards.

restart:
s:=(sum(a[j]*x^j,j=0..2)+sum(a[j]*exp(-(j-2)*x),j=3..4)):
F:=diff(s,x):
p1:=simplify(eval(s,x=q))=y[n]:
p2:=simplify(eval(F,x=q))=f[n]:
p3:=simplify(eval(F,x=q+h))=f[n+1]:
p4:=simplify(eval(F,x=q+3*h/2))=f[n+3/2]:
p5:=simplify(eval(F,x=q+2*h))=f[n+2]:

vars:= seq(a[i],i=0..4):
Cc:=eval(<vars>, solve({p||(1..5)}, {vars})):
for i from 1 to 5 do
	a[i-1]:=Cc[i]:
end do:
Cf:=s:
T:y[n+2]=collect(simplify(eval(Cf,x=q+2*h)), [y[n],f[n],f[n+1],f[n+3/2],f[n+2]], recursive);

 

hello,

this is my first post here so sorry if it's done wrong...

I'm having difficulties with the following command because maple only returns a solution if the first two boundary conditions of the "if" arguments are true. If the the first or the second condition is false then maple doesn't give a solution solution.

for i to n do if H[i] < 2.7 then if A[i, f] < 12 then if A[i, o] < 1.2 then Q[i, foo] := evalf(610*(A[i, o]*sqrt(H[i])*h[k]*A[i, T])^(1/2)) else Q[i, foo] := evalf(7.8*A[i, t]+378*A[i, o]*sqrt(H[i])) end if end if end if; print(Q[i, foo]); end do;

I've also tried with the elif command but it gives a similar problem

Anyone knows how to solve this?

I am trying to calculate a symbolic complex sequence given in the below picture: 

I have written the following code; however, it is not efficient at all and it takes a very long time to calculate even the first elements of the sequences. Can anyone please help me fix that or suggest an efficient way of doing such calculation in complex domain? Any help is appreciated. Thanks

##########################################################

d(0):=1+1I;

M(0):=1-2I;

for k from 0 to 3 do u(k):=-d(k)/M(k);p(k+1):=M__s*u(k)+d__s;d(k+1):=d(k)+gamma*p(k+1)/(nu+abs(u(k))^2);M(k+1):=M(k)+gamma*p(k+1)*conjugate(u(k))/(nu+abs(u(k))^2);od;

 

I'm trying to solve a system of nonlinear differential equations. As a minimal working example, Maple is able to solve this just fine:

restart:

pde_sys :={diff(A(t1),t1)*cos(B(t1)) = 0, diff(A(t1),t1)*sin(B(t1)) = 0}:
solving_vars := {A(t1), B(t1)}:

dsolve(pde_sys, solving_vars);

This returns [{A(t1) = _C1}, {B(t1) = B(t1)}], as expected.

However, when simply adding an arbitrary dependence on a second variable, no solution is generated

restart:

pde_sys :={diff(A(t1,t2),t1)*cos(B(t1,t2)) = 0, diff(A(t1,t2),t1)*sin(B(t1,t2)) = 0}:
solving_vars := {A(t1,t2), B(t1,t2)}:

dsolve(pde_sys, solving_vars);

Of course, this has a solution: [{A(t1,t2) = _F1(t2)}, {B(t1) = B(t1,t2)}].

Using printlevel to debug, it seems the behavior diverges when dsolve attempts to call type/ODEtools/F(x). The univariate case correctly determines that A(t1) is of the type F(x); then, these functions are correctly passed to PDEtools/assign and execution continues nominally.

For the multivariate case, A(t1,t2) is not recognized as type F(x), so no functions are passed to PDEtools/assign and execution is dominated by null sets.

Is there something I'm missing here? Or is there another way to approach this problem?

Thanks!

I'm attempting to solve the complex-valued differential equation

restart:
assume(t::real):

pde := diff(A(t),t) - I * conjugate(A(t))*A(t)^2 = 0:
dsolve(pde);

However, it seems Maple attempts to solve it using separation of variables and gives

t-Intat(-I/conjugate(_a)/_a^2,_a = A(t))+_C1 = 0

Unless I'm mistaken, a complex integral such as this isn't even defined without a contour.

Working the integral out by hand, I know the solution to be

_C1*exp(I*abs(_C1)*t)

Is there a trick I'm missing to get Maple to find this solution? Or is this outside the scope of what Maple can handle on it's own?

Thanks!

Please I am trying to get a compact result for this code in particular the lines assigne "a" and "b" respectively. I am sure the result shoud not be more than two lines. Can someone be of help? 

restart:
P:=a[0]+(a[1]*x)/(1+(a[2]*x)/(1+(a[3]*x))):
Q:=diff(P,x):
T:=diff(P,x,x):
e1:=simplify(eval(P, x=q))=y[n]:
e2:=simplify(eval(Q,x=q))=f[n]:
e3:=simplify(eval(Q,x=q+h))=f[n+1]:
e4:=simplify(eval(T,x=q+h))=g[n+1]:
var:=seq(a[i], i=0..3):
M:=e||(1..4):
Cc:=eval(<var>, solve(eval({M}),{var}) ):
for i from 1 to 4 do
	a[i-1]:=Cc[i]:
end do:
Cf:=P:
a:=y[n+1]=collect(simplify(eval(Cf, x=q+h)),[y[n], f[n], f[n+1],g[n+1]], recursive):
b:=map(eval@allvalues, [a]);

 

I'm receiving a very interesting error when attempting to solve a system of differntial equations:

{sqrt(2)*sqrt(F1(t))*diff(F2(t),t) = 0}:
% union {F3(t) = 0}:
pdsolve(%, {F1(t),F2(t),F3(t)});

When attempting to run this code, I get the following error:

Error, (in pdsolve/sys) invalid input: DifferentialAlgebra:-DifferentialRing expects value for keyword parameter blocks to be of type {undefined, Or(list({name, unknown, list({name,unknown})}),name,unknown)}, but received [F3, F2, _F1 = (NULL), F1 = [_F1, F1], _F2] 

Interestingly, removing the second line, or even the sqrt(2), allows the calculation to proceed correctly. It this a bug, or am I doing something wrong?

Thank you very much!

(I'm aware this would technically be a system of ODEs, not PDEs; my actual code includes additional partial derivatives. Additionally, dsolve appears to only generate a trivial solution in this case).

please how can I simplify the results of assigned K cum each of the coefficients further in the following code? the results are too large.

restart:
#k=2:
omega:=u/h:
psi:=v/h:
t:=(sum(a[j]*x^j,j=0..2)+a[3]*sin(omega*x)+a[4]*cos(omega*x)+a[5]*sin(psi*x)+a[6]*cos(psi*x)):
F:=diff(t,x):
G:=diff(t,x,x):
p1:=simplify(eval(t,x=q+h))=y[n+1]:
p2:=simplify(eval(F,x=q))=f[n]:
p3:=simplify(eval(F,x=q+h))=f[n+1]:
p4:=simplify(eval(F,x=q+2*h))=f[n+2]:
p5:=simplify(eval(G,x=q))=g[n]:
p6:=simplify(eval(G,x=q+h))=g[n+1]:
p7:=simplify(eval(G,x=q+2*h))=g[n+2]:
vars:= seq(a[i],i=0..6):
Cc:=eval(<vars>, solve({p||(1..7)}, {vars})):
for i from 1 to 7 do
	a[i-1]:=Cc[i]:
end do:
Cf:=t:

K:= collect(combine(simplify(eval(Cf,x=q+2*h),size),trig),{y[n+1],f[n],f[n+1],f[n+2],g[n],g[n+1],g[n+2]},factor):


alpha[1]=simplify(coeff(K,y[n+1]));
beta[0]=simplify(coeff(K,f[n]),size);
beta[1]=simplify(coeff(K,f[n+1]),size):
beta[2]=simplify(coeff(K,f[n+2]),size):
gamma[0]=simplify(coeff(K,g[n]),size):
gamma[1]=simplify(coeff(K,g[n+1]),size):
gamma[2]=simplify(coeff(K,g[n+2]),size):

 

For my own use, I am attempting to port Joe Riel’s glyph package for geometric algebra into a module more compatible with recent versions of Maple. To this end, I have been testing individual procedures extracted from the package into Maple 2016, both to understand the algorithms and to check for glitches caused by the code running in more current Maple 2016. The procedure for carrying out the exterior multiplication of blades does not seem to work reliably, and I haven’t the necessary knowledge of Maple language to determine whether this is due to an error on my part or a feature of Maple V that no longer works.  I have attached a worksheet,tablemultiplyexample.mw,  that includes the procedures necessary for the multiplication routine to work, but I can’t get any consistency in the results.  Can anyone advise me what is the problem?  

As I understand the routine, setup defines a anti-symmetric root blade table with an indexing function that precludes assignment to the table. Clifford blades are then represented as indexed variables using the root table. The process is as follows see worksheet for actual code):

initialize := proc ()
 global _e, tableroot;
tableroot := table(antisymmetric, blade);
tableroot[] := 1;
_e := tableroot;
end proc:
#The index function `blade` is as follows:

`index/blade` := proc (Indices, tableau)
 if nargs = 2 then if Indices = [] then 1
          else tableau[op(checkindices(Indices))] end if
elif Indices = [] then tableau[Indices[]] := 1
 else ERROR("cannot assign to a blade", Indices) end if
end proc;

#Exterior multiplication is performed by the following routine.
b_exteriorp := proc (u, v)
option remember;
 if  u = 1 or v = 1 then u*v
else _e[op(u), op(v)] end if
end proc:

As near as I understand, the procedure joins the lists representing the two input blade into a single list that is processed by the antisymmetric indexing function and outputs the indexes as the product blade. I don’t understand how the case of duplicate indexes (which should return 0) is supposed to be handled by the procedure.  What the procedure usually returns is simply the appended list of the two blades without modification by the indexing function.

Can anyone give me a hint about how to fix this procedure?

tablemultiplyexample.mw

First 15 16 17 18 19 20 21 Last Page 17 of 60