MaplePrimes Questions

Hello people in mapleprimes,

I am using maple 2016's standard UI.
And, I write save command in the ending place there.

And, while I write a code, whenever I think I had better put a name of an expression on a list in another .mpl file, to refer it later, I scroll down the cursor to the ending of the worksheet, and write the name of the expression, and again I bring the cursor back to the place where I wrote an expression whose name I wrote among the arguments of save.
  But, this is a little inconvenient. I have to find the original place where I had been before I moved to the end of the worksheet. But, on the other hand, using a bookmark seems complicated. Isn't there any better way to go to the place of the save command, which is the end of the worksheet, and to go back to the original place soon.

I hope you will give any hint to me. Thanks in advance.

 

When I do

seq(a||i,i=1..3); Maple returns   a1, a2, a3

But  seq(a__i,i=1..3);  returns a__i, a__i, a__i

Is there a way to make the second example also return  a__1,a__2,a__3 ?

http://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/documenting/2DMathShortcutKeys

thank you,
Maple 2016.2

 

I am not a math major, so may be I am missing something here. But for this ode:

(diff(y(x),x))^2=4 * y(x)

There ought to be (I think) 2 solutions (other than the singular one y(x)=0), due to the square root. i.e the ode becomes

   diff(y(x),x)= +-  2* sqrt(y(x))

So for the + case, there is one solution, and for the - case, there is another solution. But Maple dsolve only gives one solution (again, ignoring the singular solution for now):

eq:=(diff(y(x),x))^2=4 * y(x);
sol:=dsolve(eq,y(x));

     y(x) = _C1^2-2*_C1*x+x^2

In Mathematica, it gives both solutions

ode = (y'[x])^2 == 4 y[x];
DSolve[ode, y[x], x] // Simplify
    {  {y[x] -> (1/4)*(-2*x + C[1])^2},   {y[x] -> (1/4)*(2*x + C[1])^2}}

Both Maple and Mathematica solutions are correct ofcourse. But my question is why did not Maple give both (non-singular) solutions? and it only gave one?

Maple 2016.2

 

 

 

I'm seeing older posts bubling to the top without any apparent changes.  Perhaps spam is being added to the ends of them and then being deleted is the only thing I can think of.

I want to write a plane passing through a point (in list) and parallel to a plane.

L := [[-14, 2, 3], [-13, -3, 1], [-13, -3, 5], [-13, 0, -2]]:
 with(geom3d):
point(A, L[1]):
 plane(P, 2*x+3*y+z = 0, [x, y, z]):
 n := NormalVector(P):
Equation(plane(Q, [A, n], [x, y, z]));


I tried 
t[i] := ([seq])(point(M, pt[]), pt in L):
Equation( plane(Q,t[i],n],[x,y,z]),i=1..nops(L));

It is not true. How can I repair it?

Dear All, 

I am trying to use define_external to use a C dll from inside MAPLE. The C dll exports a function that has a argument of type function pointer which has a return type of pointer. The function itself returns pointers.  

Pointers are needed as return types as the C function needs to return arrays. 

When I try to pass the C function, as maple procedure as the argument, it errs saying "Error, (in rk4_vec) number expected for float[8] parameter, got proc () option remember; table( [( 1 ) = HFloat(1.0), ( 2 ) = HFloat(-0.0) ] ) 'procname(args)' end proc"

rk4_vec is as follows: 

rk4_vec := define_external("rk4vec", 't0' :: float[8], 'm' :: integer[4], 'u0' :: ARRAY(1..2,datatype=float[8]), 'dt' :: float[8], 'f' :: PROC('t' :: float[8], 'm' :: integer[4], 'u' :: ARRAY(1..2,datatype=float[8]), 'RETURN' :: REF(float[8])), 'RETURN' ::REF(float[8]), "WRAPPER", LIB="rk4.dll");

rk4vec in C looks like this: 

double *rk4vec ( double t0, int m, double u0[], double dt, 
  double *f ( double t, int m, double u[] ) )

I am passing as :

rk4vec_test_f := proc(t, n, u)
local uprime :: REF(float[8]);
#uprime := Array(n);
uprime(1) := u(2);
uprime(2) := -u(1);
return uprime;
end proc;

I have tried the RETURN type on the define_external call as : float[8], ARRAY(1..2, datatype=float[8]) , but that didnt work either. I got the idea of using REF from times2 example on this link.

Any guidance in this matter is highly appreciated. 

Attached are the C file, the dll, maple worksheet. Tested on Windows, with 64-bit, Maple 2016 standard. rk4.zip

 

Funny, I can't seem to find a list of all available units in the help file.

Is there not a listed table of units somewhere?

**edit add**  conversion of units I mean.  ie.  meters, miles, gallons, litres, Pa, etc...

I wish to solve for k interms of x, e is a constant in the equation k=x+e*sin(k). Using the solve function, i got 

RootOf(_Z-x-e*sin(_Z)) and using the function allvalues(RootOf(_Z-x-e*sin(_Z))) still gave the same expression in _Z. Please is there a way out because I need the value of  as a substitute to another equation. Any help will be highly appreciated.
 

Ì am trying to convert this [APOh.txt] originally coded for mathematica to maple. In mathematica i ran into severa problems in ploting the function etc.. Anyhow so far failed. The code calls inputs from the followin text document [APO-48-10.txt] I am new to maple and its still unfamiliar. Is this possible to convert to maple?

when test most simple case one to one, and many to one these two reasonable cases, it run a very long time without exit the program.

when i test with the example in book Neural Network Design, it can output correctly but only for book example.

restart:
with(ExcelTools):
with(ListTools):
with(plots):
with(LinearAlgebra):
zipplus := proc(mm, pp)
return zip((x,y) -> x+y, mm, pp)
end proc:
zipminus := proc(mm, pp)
return zip((x,y) -> x-y, mm, pp)
end proc:
zipstar := proc(mm, pp)
return zip((x,y) -> x*y, mm, pp)
end proc:

metara := proc(pp,meaght,bb,mapp,deep)
if deep > 0 then
 pp2 := metara([seq(pp[i], i = 1 .. nops(pp))],meaght,bb,mapp,deep-1):
 mp := zip((x,y) -> x*y,pp2,meaght):
 mpsam := sum(mp[m],m=1..nops(pp2)):
 mpb := [seq(0, i = 1 .. nops(pp2))]:
 for ii from 1 to nops(bb) do
  mpb[ii] := evalf(mpsam + bb[ii]);
 od:
 pa := [seq(0, i = 1 .. nops(pp2))]:
 for ii from 1 to nops(bb) do
  pa[ii] := evalf(mapp[deep](mpb[ii])):
 od:
 return pa:
else
 return pp:
end if:
end proc:

perceptronrule1 := proc(p, t1, meaght1, b1, checksum, mapp)
 meaght3 := meaght1:
 b3 := b1:
 checksum2 := checksum;
 print(p[1]):
 while sum(checksum2[jj], jj=1..nops(p)) <> nops(p) do
  #print("sum(checksum2[jj], jj=1..nops(p))");
  #print(sum(checksum2[jj], jj=1..nops(p)));
  for ii from 1 to nops(p) do
   #print("metara(p[ii],meaght3,b3,mapp,1)");
   #print("p[ii]");
   #print(p[ii]);
   #print("b3");
   #print(b3);
   #print("meaght3");
   #print(meaght3);
   #print(metara(p[ii],meaght3,b3,mapp,1));
   #print("t1[ii]");
   #print(t1[ii]);
   e := zipminus(t1[ii], metara(p[ii],meaght3,b3,mapp,1));
   #print("e");
   #print(e);
   meaght2 := meaght3 + zipstar(e,p[ii]);
   #print("meaght2");
   #print(meaght2);
   #print("meaght3");
   #print(meaght3);
   #print("b3");
   #print(b3);
   b2 := b3 + e;
   #print("b2");
   #print(b2);
   #print("b3");
   #print(b3);
   #print("checksum2");
   #print(checksum2);
   diff1 := zipminus(meaght2, meaght3):
   diff2 := zipminus(b2, b3):
   if sum(diff1[m],m=1..nops(diff1)) = 0 and sum(diff2[m],m=1..nops(diff2)) = 0 then
    checksum2[ii] := 1:
   else
    checksum2[ii] := 0:
    b3 := b2:
    meaght3 := meaght2:
   end if:
  od:
 od:
 return [meaght3, b3, checksum];
end proc:

#Example from book
ppp := [[2,2],[1,-2],[-2,2],[-1,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,0],[1,1],[0,0],[1,1]]:
mmmeaght1 := [seq(0,ii=1..nops(ppp[1]))]:
bbb1 := [seq(0,ii=1..nops(ppp[1]))]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
perceptronrule1(ppp,ttt1,mmmeaght1,bbb1,check1,emap);

#my testing for one to one
#after testing, it loop a very long time and not stop
ppp := [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]:
mmmeaght1 := [0,0,0,0]:
bbb1 := [0,0,0,0]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
perceptronrule1(ppp,ttt1,mmmeaght1,bbb1,check1,emap);

#my testing for many to one
#after testing, it loop a very long time and not stop
ppp := [[1,1,0,0],[0,1,1,0],[0,1,0,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[1,0,0,0],[0,1,0,0],[0,0,0,1]]:
mmmeaght1 := [0,0,0,0]:
bbb1 := [0,0,0,0]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
perceptronrule1(ppp,ttt1,mmmeaght1,bbb1,check1,emap);

#my testing for one to many
#after testing, it loop a very long time and not stop
ppp := [[1,0,0,0],[0,1,0,0],[0,0,0,1]]:
check1 := [seq(0,ii=1..nops(ppp))];
ttt1 := [[1,1,0,0],[0,1,1,0],[0,1,0,1]]:
mmmeaght1 := [0,0,0,0]:
bbb1 := [0,0,0,0]:
emap := [(x) -> if x < 0 then 0 else 1 end if, (x) -> evalf(1/(1+exp(x)))]:
#trace(perceptronrule1);
perceptronrule1(ppp,ttt1,mmmeaght1,bbb1,check1,emap);

Can somebody please expand the following double sum to produce a list of sequences?

(Sum(f[i], i = 0 .. 1))*(Sum(g[i, j, k], j = 0 .. 1)) for k = {1,2}

I need to make sure the operation order is correct, so I would like to verify my workings.

Thanks!

The maple I used at school is a much older version and when I do Definite Integrals there and copy it to Word as part of the project, it just copies perfectly.

Now I have Maple 16 at home and when I have a definite integral, I have to copy it using copy special and take it as an image to MS Word. That's not the problem. The problem is the limits sometimes seem to be cut off. The left hand-side image is the older version of Maple. Limits look perfect and even the integral sign is darker and so on. The right hand-side image is the Maple 2016. Can anyone help me change the style on Maple 2016 so it's like the old one so the integrals look better on my project. Thanks alot

 

Hello,

i need to represent a circle using the command [geometry] circle because i have a problem and i have to calculate an 

intersection between two circles whit command intersection() which is ruled by Package geometry.

For example, with the first circle  i did like the help page says

 But it's Error:

centre of circle(3300;2200)

radius=110

I don't understand the eror. Can you help me?
Thanks in advance.

Hello!

I have a question about densityplot.

I want to get this colormap:

As I understand, I should use plots:-densityplot(...) comand and "HSV" colorscheme, where H = [240..0], S=1, V=1.

But if i use zcoloring with this options, I will get wrong result.

My code:

restart;

a := 0; b := 1; #first and final point

plots:-densityplot(z, dummy = 0 .. 1, z = a .. b, grid = [2, 10], size = [90, 100], colorscheme = ["zcoloring", [proc (z) options operator, arrow; -240*(z-a)/(b-a)+240 end proc, proc (z) options operator, arrow; 1 end proc, proc (z) options operator, arrow; 1 end proc], colorspace = "HSV"], style = surface, axes = frame, labels = ["", ""], axis[1] = [tickmarks = []], title = "Test", titlefont = ["Calibri", "Bold", 16], axesfont = ["Arial", 14], size = [100, 500]); #densityplot with zcoloring option.

 

My result (zero must be equal to "Blue"):

I can't find mistake....

I am trying to model a disease. The equation is as follows:

S*X - f(X,S,Sp) = 100

I have data for S, I have data for X and I have data for f(X,S,Sp) however I want to find an equation for f(X,S,Sp) that has the best fit with the data because I need to use it later on in my calculation. If anyone is intrested S is the sensitivity of the blood test, Sp is the specificity of the blood test. This means that X*(1-Sp) is the number of false positives.

I currently dont have access to Maple hence I am doing all my modeling in excel 2016. So I am severly limited because excel is useless at algebra.

Maple.xlsx

First 1019 1020 1021 1022 1023 1024 1025 Last Page 1021 of 2428