acer

32348 Reputation

29 Badges

19 years, 329 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@rlopez Yes, that's why I was asking whether the OP would be OK with just the D form working. It wasn't clear to me whether he really needed eval(diff(f(x),x),x=0) or its inert Eval form to also work, since both appeared in his worksheet.

But I suspect that you intended,
   D(f)(0)
instead of,
   D(f)(x)(0)
[edit] Those both prettyprint the same, in the form that was requested. But only the first of them makes proper sense in the context of the Question.

@DarkMath The solve command is a little quirky with regard to assumptions.

However,

solve({sin(x)},x,real,explicit,allsolutions,useassumptions)
  assuming -3/2*Pi<=x, x<=3/2*Pi;

                {x = -Pi}, {x = 0}, {x = Pi}

solve({sin(x)},x,real,explicit,allsolutions,useassumptions)
  assuming -5/2*Pi<=x, x<=5/2*Pi;

     {x = -2 Pi}, {x = -Pi}, {x = 0}, {x = Pi}, {x = 2 Pi}

Personally, I think that I'd first try using the restrictions as extra conditions in the first argument, over using them as assumptions.

It looks like you didn't notice the link from the solve Help page to the solve,details Help page. That has more information about some of those options. There is an example lower down that page which uses the explicit,allsolutions options on a trig expression and a domain restricted by two simple inequalities.

[edit] The functionality of the trig-solver was improved somewhat a few years ago, after which that option pair combination became more useful for such cases constrained by inequalities, and the example added to the Help page.) Prior to that the strongest univariate exact trig solver over a specified finite range was probably Student:-Calculus1:-Roots leveraging the internal `minimize/solve`, and which is still pretty good.

Now it gets trickier to explain. The real option is only documented as being relevant for parametric solving (of polynomial systems). But a few releases ago it started (sometimes) having an effect on other classes of problem. Sometimes it helps, and (much more rarely) it hinders. I try with and without, when pressed. I have previously submitted a bug report about lack of documentation on it. I believe that your sin(x) example works both with and without it. That is,

solve({sin(x),x>=-3*Pi/2,x<=3*Pi/2},x,explicit,allsolutions);

                {x = -Pi}, {x = 0}, {x = Pi}

solve({sin(x)},x,explicit,allsolutions,useassumptions)
  assuming x>=-3*Pi/2,x<=3*Pi/2;

                {x = -Pi}, {x = 0}, {x = Pi}

@NeillSmith I am asking whether it would be adequate or helpful if you could get (only) the D form to look like you want.

Would it serve if it was just for D form? 

For example, D(f)(x) and D(f)(3) rather than diff(f(x),x) and eval(diff(f(x),x),x=3) ?

How much direct manipulation do you need to do, where you might not conveniently be able to utilize convert(...,D) when needing to display?

In one of your Replies below you wrote, "How can I extract the numerical data of (x,U1) to use it in another software such as Origin?"

Does that simply mean that you want to export the numeric data that could be plotted (independent x values and corresponding dependent U1 values)?

Or do you want to be able to code-generate the piecewise polynomial interpolants that the numeric solver may have computed (in a a target language such as C, etc)? That would allow you to generate arbitrary [x,U1(x)] pairs of values, externally, or adaptively plot externally, etc.

@dharr I'll note that solve has been historically quirky wrt trig solving under bounds. For this example, Maple 2020 can do better but note 1) the calling sequence has to be of a particular kind, and 2) some aspect of that calling sequence are undocumented.

solve({sin(x),x>=-3*Pi/2,x<=3*Pi/2},x,real,explicit,allsolutions);

                   {x = -Pi}, {x = 0}, {x = Pi}

That functionality is leveraged in few places in the Library.

@emendes You've now described a scenario in which the entries are irrelevant to the job. It is very strange that the code you posted utilizes (and searches upon) the values of the entries. That is one of the primary causes of its slowness.

Does the command ListTools:-Slice in Maple 2020 provide anything like the functionality you want? (I'm not saying that its performance is optimal. i am curious about a functionality match.)

If you want to split according to number of entries (in the chunks) then why does ListTools:-LengthSplit not serve? if you want to split according to the number of chunks then why does ListTools:-Slice not serve? If neither of those provides the performance you require then, still, why omit that fact?

ps. It is unhelpful to not mention what kind of list size you have in mind, and target performance you desire.

What do you mean by "chunks of a certain size"?  Does that mean that the values of the entries come into it? (If not, then why examine them? If so, then how?)

Your code contains at least one instance of the misspelling nchunck and as posted doesn't work.

Upload and attach your document using the green up-arrow in the Mapleprimes editor.

You can upload and attach your worksheet, so that people don't have to re-type the expressions using just an image of your code.

(Also, I converted your Post into a Question.)

@Scot Gould I checked, by running the 2D Input case and its 2D parsing through the debugger (Typesetting, which can sometimes be tricky).

It parsed through this inert form (which I assigned to name foo),

foo := _Inert_FUNCTION(_Inert_TABLEREF(_Inert_NAME("evalf"),_Inert_EXPSEQ(_Inert_INTPOS(30))),_Inert_EXPSEQ(_Inert_FUNCTION(_Inert_NAME("^"),_Inert_EXPSEQ(_Inert_FLOAT(_Inert_INTPOS(30),_Inert_INTNEG(1)),_Inert_FLOAT(_Inert_INTPOS(12),_Inert_INTNEG(1))))));

And that turns into this,

lprint(FromInert(foo));

   evalf[30](`^`(3.0,1.2))

And that involves the prefix form for `^`, which as shown earlier does not involve the automatic simplification

@Lisa6 You have now posted eight (8) times in this thread, but you still have not stated explicitly what files you put where, and what you tried.

Notice that in my last Reply I stated where I put the files as well as what I executed in Maple, and I showed the output.

So, you executed these Maple commands?

libname := "/home/usr/maple2020/FGb/FGblib", libname;
with(FGb);

Show the output from both.

Where did you put the files FGblib.ind and FGblib.lib? What directory are they in? Where did you put the .so files? What directory are they in? What are their names?

What do you see if you execute in a Linux terminal,
    cd /home/usr/maple2020/FGb
    ls -l *

Which Maple interface did you launch, and how?

@Scot Gould That old Question and Answer you showed is unrelated to your primary query here, about evalf[30](3.0^(1.2)) producing only a 10-digit result under default Digits=10 when entered in 1D plaintext Maple Notation.

That old post relates to evalf's numeric model (atomic operations are supposed to attain accuracy with 0.6 ulps, but bets are off for compound operations which may incur additional roundoff error and loss of precision) and the special remeber table mechanisms with evalf that allow prior results to be re-used and rounded when requested under lower working precision. I don't see how any of that relates to your primary query here.

In case the original question is altered, here it is:

  1. a1 = x and for every n >= 1 ,   

write the Maple procedure that calculates the term a100 for x = 2.

 

In case the original question is altered, here it is (with followup comment):

 

Type the Maple command string that calculates this expression for the number of n arb
itrarily entered from the keyboard.Can you help me please ?

In the question, an arbitrary number of n will be entered on the keyboard. The first
a = x ^ n will be taken using the for loop. Then with i for a general repetition tota
l expression that will go from i = 2 to n, the desired total will be obtained.

 

First 168 169 170 171 172 173 174 Last Page 170 of 592