Tim Van Dusen

378 Reputation

7 Badges

17 years, 69 days

MaplePrimes Activity

These are answers submitted by Tim Van Dusen

If working in Windows, and if you are able to create a DLL, you could make a DLL that will get user input and return it to your Maple worksheet. However, because you are unable to allocate dialog resources or console within the DLL, it's a bit difficult but doable - I think.
did you know you're reusing j? replacing j as index with something else like: for i from 0 to 1 do for n from i to 1 do Gij := diff(psi2, a[i], a[n]): .... worked for me.
To show the evaluation, can you just add a "print" in your loop like: print(lzr2); print(N[i,j]);
Rick, I usually keep my ti89 in radian mode - it keeps things easier if working between the ti89 and Maple. The ti89 has a degree key right on the front so it's very simple to use degrees in radian mode without changing settings. The ti89 is a wonderful calculator! Maple is incredible software!
pc := proc (x::float, b::float)::float; evalf(x^b) end proc; cp := Compiler:-Compile(pc); cp(1.1, 2/3); edited to add: c := proc (S::float, K::float, t::float, r::float, v::float, b::float)::float; S*(b+b*erf(b*((ln(S/K)+r*t)/(v*t^b)+b*v*t^b)*2^b))-K*exp(-r*t)*(b+b*erf(b*((ln(S/K)+r*t)/(v*t^b)-b*v*t^b)*2^b)) end proc; Compiler:-Compile(c); then use: c(1.1, 2.3, 5.5, 6.6, 7.7, evalf(1/2)) This seems like an okay way to go about it - no?
mySet := {2, 5, a, r, w}   for i to nops(mySet) do   if whattype(op(mySet[i])) = integer then   print(i); print(mySet[i]); break: end if end do but keep in mind the set is going to be ordered with the first integer, first in this case.
I just got back to this and found: tprime := proc (s) if isprime(s) then s else 0 end if end proc time(sum('tprime(n)', n = 1 .. 11112))       produces:   0.071 time(add(isprime(n), n = 1 .. 11112))       produces:   0.031 I also observed the following - but this is to be expected: time(sum('piecewise(isprime(n) <> false, n)', n = 1 .. 11112))       produces:   0.359
Thanks Doug for the general idea and thanks Jacques and Georgios for the refinement. This is pretty much what I was looking for - I really appreciate the help.
I also tried to upload the file and then run it in MapleNet and it doesn't work for me neither, and unfortunately I don't know how to delete it. I've tried that in the past without success, and It's kinda embarrasing when that happens which is the reason I don't usually upload here. There might be something special that needs to be done to the worksheets in order for them to work on MapleNet. I just download the file I just uploaded and loaded back into Maple 11 and it worked fine.
When I look at the spiral created by the calculations I was reminded of something. Did you know that Dr. Euler, although blinded by cataracts later in life was able to calculate the orbit of the moon as it was influenced by the sun and the earth. He was a great mathematician and perhaps had a better grasp on the meaning of "infinite" than anyone past or present. There have been many great mathematicians. If you get past this problem with the worksheet and want to treat yourself to some really good reading, have a look at:     "God Created the Integers" by Stephen Hawking A very good book! I'm not a mathematician, but I enjoy math very much.
I can't tell you how many times I've uttered those words - "This is too hard for me". Fortunately, I only believe it for a minute and then I dig my heels in and give it another tug. I wonder what you might be doing different than I. I left your code block at the top of my sample worksheet, so you won't be able to execute the entire worksheet unless you remove that. After removing that block, then choose Edit/Execute/Worksheet from the menu. If it executes okay then and you want to move the code into a new worksheet, you can use your mouse and keyboard to copy and paste each of the lines into a new worksheet. Something that you may already know, is that each line should end with either a colon or a semi-colon. If lines of code are grouped together between the "Greater-Than" prompts in worksheet mode then the line MUST end with either a colon or semi-colon, our you'll get an error. If in document mode the same applies if the lines are between two markers. You can show the markers in document mode by selecting the option from the "view" menu.
Did you try my worksheet right above your last comment - it's 2-D
Below is a link to load an HTML that shows what I got with your "4937_Page 87H.mw" version of the code with the change recommended by Joe in his comment above, along with a few other minor changes. I've included a link to the Maple 11 worksheet that I used as well. Fast Cat HTML  ( includes worksheet link ) Slow Cat HTML
A little weird, but how about foo := 2*Array(1 .. 10, proc (i) options operator, arrow; i end proc) bar := convert([seq(convert(select(proc (x) options operator, arrow; `mod`(x, 3) = 0 end proc, foo), set)[i], i = 1 .. nops(convert(select(proc (x) options operator, arrow; `mod`(x, 3) = 0 end proc, foo), set)))], Array) the code above isn't quite how it looked in Maple, and it won't work if you copy and paste it back into Maple so below is a screenshot
I'm relatively new to Maple, and it was suggested elsewhere, that maybe I should do a book, in the book section here in MaplePrimes concerning the way I learn from maple. I'm still working on that idea, but in the meantime, I'll jump in here with an idea for other new users. When I come across a bunch of good ideas like the ones here, I create a new maple worksheet with the examples, along with a link to this page at the top and a few comments about the original question and people who gave some good ideas. I then save the worksheet with an appropriate name in a folder that I use just for that sort of thing. I'm not sure if others have the same problem of forgetting things that I seem to have acquired in my latter years, but because of that, I try to record and categorize as much as I can so it's more easily obtainable when needed rather than end up becoming frustrated when I encounter a situation when I need what I read "somewhere" but can't remember what it was that I read or even where I read it.
1 2 3 4 Page 2 of 4