Christopher2222

MaplePrimes Activity


These are answers submitted by Christopher2222

It is an identity.  That is odd though that simplify wouldn't use a trig identity on that, a couple lines of code otta fix that up.  I would believe the programmers have some reason.  Probably has something to do with the way the simplify routine works.  Mathematica keeps getting larger by adding more and more programming code directly into the central kernel.  Maple isn't really programmed that way.  The kernel in Maple stays relatively untouched ... I think which could be part of the reason.

Doesn't seem to be a simple task.  I'm guessing you want to shade the area underneath the top 5% of the frequencyplot.

I've quickly put this together and it's not complete nor do I believe it's a good way about doing it but what I was attempting to do was first convert A to a list and use the points in a similar plot using the plot command and then shade from there, but I haven't got that far yet. 

a:=convert(A,list):
b:=1:
for i from -2.8 to 3 by 0.2 do   # FrequencyPlot seemed to have points at intervals of 0.2 so this is why I decided on a 0.2 step value
  c[b]:=Count(SelectInRange(A,i-0.2..i)):
  d[b]:=i:
  b:=b+1:
end do:
e:=convert(c,list):
f:=convert(d,list):
for i from 1 to nops(e) do
  g[i]:=[f[i],e[i]]
end do:

h:=convert(g,list)

plot(h)  #  This will give an estimated plot of the FrequencyPlot.

Unfortunately the plot is not as close to the FrequencyPlot as I would like it, and I haven't had a bit of time to figure it out yet.  But after that then we could just select the range that was in the top 5% and use the plot filled=true option for that and display both plots to some satisfaction. 

Hopefully someone else has some better ideas.

 

Use allvalues to pull out the answers. 

RootOf is a simplified form of all real and complex solutions. 

It works in the classic version of Maple.  Doesn't work in GUI so it must be a typesetting issue. 

Not a complaint, well I suppose I was fussing about it.  More of an aesthetics issue. 

You're right 1^i to 1 is never invalid anyways so I suppose there's no real point of showing 1^i in the general case in Maple's output.

Oddly enough

Both 

Sum(0^i,i=0..4)     and     Sum(1^i,i=0..4)

both leave out the i as the exponent for the general case.  Simply because 1^i=1 for all values of i and 0^i = 0 for i<>0 doesn't mean Maple should leave off the exponent. 

so should maple make an exception rule in it's calculations?

sum( `0`^i,i=0..4)

            1 + 0 + 02 + 03 + 04

 

You could try, although I haven't really put them in an array, someone else will have a better way.  I changed your range because maple returned the fsolve statement for .86 and 1.74 to 2.00.  So I just took them out.  It's a start at least.

with(plots):
j:=1:
for i from .87 by .01 to 1.73 do
  a||j:=fsolve({{x1+x2 = i, -3*x1+4*x1^3-3*x2+4*x2^3 = 0}, {x1 = 0 .. 1, x2 = 0 .. 1}):
  j:=j+1:
end do:
d:=[seq(rhs(op(1,a||k)),k=1..j-1)]:
e:=[seq(rhs(op(2,a||k)),k=1..j-1)]:
f:=listplot(d):
g:=listplot(e):
display(f,g)
 

**edit ** oops sorry .. I didn't put i on the x-axis.  Someone will straighten it out.

You are right!  I scanned the directory too quick. 

Maple should append the file to a txt format if it isn't specified.

I agree about specifying your own folder to write to however ...

Maple says that if I don't specifically specify the type of file, it's automatically written as a txt file. 

So when I write writedata(data,[[1,2,3],[1,2,3]]) it should write to the currentdir() no problems as a data.txt file.  But as Scott said I am writing to the Maple folder with a folder already named data except that it's not a file, it's a folder name, and Maple doesn't agree with that.  As a test I did writedata(test,[[1,2,3],[1,2,3]]) and it wrote to the directory test.txt no problem.

If I change the name so that the writedata FileID name does not equal any of the names in the Maple currentdir() wether they be folders or files then it will work. 

writedata(data,[[1,2,3],[1,2,3]]) - won't work if any folder or file is named data.

In case of a folder name conflicting with the name you thought Maple would take as a .txt file you need to specifically tell maple what type of file it will be in quotes

writedata("data.txt",[[1,2,3],[1,2,3]]) - the working method not explicitly described in the help pages.

 

My currentdir() is "C:\Program Files\Maple 12" so it should write to the folder if I don't specify a location, shouldn't it? 

I have unchecked the Read only under properties for the c:\Program Files\Maple 12 folder and applied it to that folder only.  However I still get the error, (in fopen) permission denied when I do ...

writedata(data, [[1,2,3],[1,2,3]])

Am I missing something?  Is it a bug?  Do I need to uncheck Read only for Maple 12's complete directory structure?  Is there a setting in Maple somewhere I should be aware of?

 

writedata(data,[[1,2,3],[1,2,3]])

gives me the permission denied error.  Why?

however if I specify the location it's okay
writedata("c:/Program Files/test.txt",[[1,2,3],[1,2,3]])

So where is Maple in the first line here trying to put that FileID named, data, that gives me the permission denied error?

Using the picture roman_pearce gave us, I broke it up into 3 parts and saved them as a 320x500 pixel jpg image and had maple read in the images.  I couldn't get my loop to work so I'll show the long form

with(ImageTools):
with(plots):
a1:=Read("f:/1.jpg"):
a2:=Read("f:/2.jpg"):
a3:=Read("f:/3.jpg"):
b1:=ToGrayscale(a1):
b2:=ToGrayscale(a2):
b3:=ToGrayscale(a3):
c1:=convert(b1,Matrix):
c2:=convert(b2,Matrix):
c3:=convert(b3,Matrix):
d1:=Scale(c1,1/8):  #Need to scale for listdensityplot otherwise will recieve error for length exceeds 1000000
d2:=Scale(c2,1/8):
d3:=Scale(c3,1/8):
e1:=listdensityplot(d1):
e2:=listdensityplot(d2):
e3:=listdensityplot(d3):
to3d1:=plottools:-transform((x,y)->[x,y,0]):
to3d2:=plottools:-transform((x,y)->[x,y,1]):
to3d3:=plottools:-transform((x,y)->[x,y,2]):

display(to3d1(e1),to3d2(e2),to3d3(e3),transparency=0.1)

display(to3d1(e1),to3d2(e2),to3d3(e3),transparency=0.1,axes=boxed,style=PATCHNOGRID)

 

No that doesn't work. 

Notice when axes=normal there are only 3 axes.  What I was wondering is if there is an option for axes=boxed to keep three of axes with ticks stationary as the you rotate the model.  Every the model is unclicked after rotating the axes lines shift to a new edge. 

Wait ... actually this is a better explanation for what I mean.  I was trying to achieve axes=normal with a box wire frame, that option doesn't seem to be allowed without some trickery programming.

I tried axes=normal, axes=boxed in the same command but the most recent command overrides the previous one.  I thought it might integrate into something I was trying to get. 

I've created a procedure that puts a random set of values into a cubic matrix (or array as they seem to be referred to when they exceed 2 dimensions) and displays them in a plot.

restart;
gc();

View3dMatrix:=proc(n,ri,rf)    #n is the number of elements, ri and rf are initial and final range of random numbers
  local a,i,k,e,g,h,m;
  a:=trunc(sqrt(n)+1):
  for i from 1 to a do
    b||i:=[seq(rand(ri..rf)(i),i=1..n)]:
    c||i:=Matrix(a,a,b||i):
  end do:
  for k from 1 to a do
    d||k:=seq(seq([i,a+1-j,k,c||k[j,i]],i=1..a),j=1..a)
  end do:
  e:=plots[textplot3d]([seq(d||i,i=1..a)],axes=boxed,tickmarks=[0,0,0],color=green, font=[TIMES, ROMAN, 8]):
  g:=plot3d([[x,y,0.95],[x,y,-a*0.10]],x=1..a,y=1..a,color=brown,style=surface,lightmodel=light2):
  h:=plot3d([[x,1,z],[x,a,z]],x=1..a,z=0.95..-a*0.10,color=brown,style=surface):
  m:=plot3d([[1,y,z],[a,y,z]],y=q..a,z=0.95..-a*0.10,color=brown,style=surface):
  plots[display](e,g,h,m)
end proc:

View3dMatrix(50,1,100)

 

First 38 39 40 41 42 43 44 Last Page 40 of 48