Mac Dude

1596 Reputation

17 Badges

14 years, 325 days

MaplePrimes Activity


These are replies submitted by Mac Dude

I would use the Physics:-Vectors package to tackle this. See the docs on the physics package and its various subpackages (here esp. the Vectors subpackage). Once you spell "Nabla" correctly (with a "b" before the "l") it'll know what it means and knows how to do grad, div and curl.

Mac Dude

 

I don't think there is a built-in checkpointing procedure in Maple (checkpointing = writing state of a calculation to disk so you can resume from that point later). Assuming you have a kind of loop, you can save intermediate results; this thread may be helpful:

http://www.mapleprimes.com/questions/202512-How-To-Save-The-Session-Of-Maple-Worksheet#answer209792

You could e.g. wrap the save-state code into a proc & call that periodically.

If it is the intermediate state of one operation you want to save; I don't know how to do that.

M.D.

@rit With a shared kernel, ALL variables defined at the Maple prompt ARE global to both sheets (I just checked, as I do ot usually run in that mode).

Mac Dude

@Carl Love You are absolutely correct. Sockets are still outside of my Maple experience, but from a cursory look into the help it seems like that is what the OP may want to investigate.

Citation from the helpfiles:

The Sockets package is a suite of tools for network communication in Maple. The commands in this package enable you to connect to processes on remote hosts on a network (such as an Intranet or the Internet) and exchange data with these processes. In particular, it enables two independent Maple processes running on different machines on a network to communicate with one another.

Mac Dude

@Alejandro Jakubi This part of the op is (highly) suggestive that it is periodic:

"the value of the integrand at zero = the value of the integrand at 2*Pi."

In fact, I'd call that a sine function :-) maybe with an offset...

Seriously, though, it could be a number of things. We need more info.

M.D.

@georgepan Can you post the data file also? Copy-paste from your previous version (the Maple sheet with the data included) does not copy-paste correctly for me (no line endings) so I cannot use the data.

M.D.

@amrramadaneg Ok, I really do not see the joke part in my reply to your question. Please do not take it personal, but a post with misspellings, asking a question with no details given and therefore basically unanswerable => I do not expect a mature being behind this.

Seriously though, if you wrote the trapezoid routine yourself, then you'll have to either debug it yourself or post it here together with a test case exhibiting the problem.

If you used Student[Calculus1][ApproximateInt] (which per the docs is a trapezoidal-rule integrator), then be aware that Maple has a number of industrial-strength numeric integrators that you ought to be at least aware of and see whether they give you a better result. Look for int/numeric in the help facility. There are a number of integrators with different strengths and weaknesses, and for stiff or non-stiff problems. For each, there are a number of parameters that affect the outcome (like stepsize, convergence criterion etc.), and you probably have to explore different settings for these if your problem is ill-conditioned.

If you want help here I suggest strongly you create a test case displaying the problem and upload it. Yes, it may be a pain, but how do you expect people to help you otherwise? And, btw, you may want to do this for yourself to understand what is going on and how to fix it.

... this coming from someone who actually has used Maple's numeric integrators repeatedly for real-world problems, and at times struggled with them. While there are problems just too ill-conditioned to be solved in this way without being reformulated; I have found Maple's integrators on the whole to be quite powerful.

M.D.

Assuming this is a homework problem, show us what you did. Otherwise we just have to conclude that your integration routine has an error.

If you just need the answer, Robert showed you what to do. There are some subtleties with numeric integration; you may need to go through the docs to learn about the actual routines used, accuracy limits, no. of digits used and the like.

M.D.

@georgepan I had a look at the Maple sheet. I would save the Excel as a csv file (comma-separated values) and read that in with ImportMatrix. The you can substitute the v[i] and xi[i] with the columns of the read-in matrix.   

M.D.

@Mac Dude Hmm... reading your question again, did I misunderstand it? You state you want to "export" the constants and derived values; do you mean by "export" to save them somewhere (on disk) for use in a later run; or do you want to get at them in the worksheet calling your procedure, so you can use them for later calls, but in the same run? If the latter case you want to wrap the procedure you have in a module and then use the export declaration for those variable you need to get at. This is explained quite well in the Maple Programming Guide.

M.D.

@acer I certainly agree that my use of x for both the parameter of the function as well as the argument in the call is unclean & I should have used t or whatever else. My example presented the function to answer the specific question of the OP, who asked about plotting a function. I did not go into plotting the values of an expression.

Having said this, what is it you consider bad about your last example? On occasion I will use unapply just to recast an expression into a function when it seems more natural to the task at hand, e.g. to explicitly carry a parameter that has relevance to the problem. I agree that doing this just for plotting is unnecessary, but is it a capital sin?

M.D.

It appears you use commas as decimal points. I am not familiar enough with Maple's localizations, but when I load your sheet into my (Norh American) copy of Maple the commas create sequences and you do not get what you'd expect.

M.D.

I don't think the F-D distribution should reach 1.8 @ E=0 unless there is an overall multiplier. The function would make more sence if there were parentheses around exp()+1.

M.D.                                                           

@Voltageist Your definition of H is wrong.

In Maple, you write

H:=(x) -> G(G(x));

Didn't we just go through that a few days ago... maybe it was someone else. But this comes up all the time.

If you write H(x):=... then H(x) is treated like a name; so H(x) works, H(1) does not; H(y) does not either.

If you fix that the diff and eval work. My version of Maple (15 on this particular machine) is struggling with the simplification, though, so you may want to do the simplification in a separate step. Newer Maples and/or new computers may help.

M.D.

@Joe Riel Joe, you are correct (of course).

However, the OP may want to inspect the logic of what he is trying to do here. In both procedures he is using i,j,k and epsilon without assignment. So the result depends on on which namespace Maple decides these are in. Presumably that can change with Maple versions (even if that may be unlikely). So should these be globals? Then declare them as such. Should these be exports (meaning they are in the namespace of myQuaternions) then declare them as such. In the calling routine any use of the exports will default to myQuaternions:-epsilon etc., which is different from epsilon in the callers namespace (:-epsilon at Maple's command prompt).

Now, once these are protected, then you cannot assign anything to them. It is not entirely clear what the use is in that case.

Mac Dude

First 23 24 25 26 27 28 29 Last Page 25 of 43