acer

32727 Reputation

29 Badges

20 years, 89 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Right. Of course. Thanks. So, charfcn[0] it is.

acer

> ztrans(charfcn[0](t),t,z);
                                       1


> ztrans(Heaviside(t),t,z);
                                       z
                                     -----
                                     z - 1

I'm not sure why it doesn't like Dirac(t).

That was all in Maple 6.

acer

Isn't the idea that it's better not to give full explicit answers to course work questions?

Anyway, the above is not correct. It is returning a[i] for the latest value of i. The result should be a[i+2] for the latest value of i, using the code given above.

acer

Isn't the idea that it's better not to give full explicit answers to course work questions?

Anyway, the above is not correct. It is returning a[i] for the latest value of i. The result should be a[i+2] for the latest value of i, using the code given above.

acer

This worked for me, using Maple 11.02.

> for i from 1 to 5 do
> plotsetup(ps, plotoutput="/tmp/test"||i||".eps",
>   plotoptions=`color,portrait,noborder,width=16cm,height=12cm`);
> plot(cos(i*x), x = -5..5);
> plotsetup(inline);
> end do;

I did it on Linux, and used /tmp/ as the base location. Modify the location for Windows accordingly. (Try backslash, perhaps?) The .eps files that came out were OK.

acer

This worked for me, using Maple 11.02.

> for i from 1 to 5 do
> plotsetup(ps, plotoutput="/tmp/test"||i||".eps",
>   plotoptions=`color,portrait,noborder,width=16cm,height=12cm`);
> plot(cos(i*x), x = -5..5);
> plotsetup(inline);
> end do;

I did it on Linux, and used /tmp/ as the base location. Modify the location for Windows accordingly. (Try backslash, perhaps?) The .eps files that came out were OK.

acer

"Substituting x=a^3, factoring, and then inverting that substitution on x."

It is similar to doing this,

> subs(a=x^(1/3), factor( subs(x=a^3,x-1) ) );
                        (1/3)        (2/3)    (1/3)
                      (x      - 1) (x      + x      + 1)

> subs(x=a^3,x-1);
                                     3
                                    a  - 1

> factor(%);
                                       2
                             (a - 1) (a  + a + 1)

> subs(a=x^(1/3),%);
                        (1/3)        (2/3)    (1/3)
                      (x      - 1) (x      + x      + 1)

See also the help-page ?@ for help on the composition operator.

acer

Someone suggested to me the following syntax and result,

   RootOf(sin(_Z), condition={cos(_Z)<0}) ,

   RootOf(sin(_Z)*_Z^2+sin(_Z)-2*_Z, condition={cos(_Z)>=0})

It uses a slightly different "fake syntax" from Doug's above. I like it because it looks even simpler as an encapsulation of the whole solution.

Checking the graphs is one way to see that both this and Doug's suggestion cover all the correct roots. Or do the algebra.

p1 := plot(signum(cos(x))-signum(x*sin(x)-1),x=-20..20,thickness=5,color=red):
p2 := plot(signum(cos(x)),x=-20..20,color=green):
g := sin(x)*x^2+sin(x)-2*x:
f := cos(x)-x*sin(x)+1:
pf := plot(f,x=-20..20,color=blue):
pg := plot(g,x=-20..20,color=black):
plots[display]([pf,pg,p1,p2]);

How can Maple have gotten by for so long without such a construct? Is there already some better formulation available?

acer

Sure, I did see where the other wrong answers were coming from. However, I was looking at (only) the sentence "Here, it appears that the only real problem is avoiding the zeroes where sin(x)=0, i.e. all multiples of Pi." I didn't see context to suggest that those other roots weren't covered by this. Sorry, if that was a misunderstanding.

How about RootOf(cos(_Z)-_Z*sin(_Z)+1) as a result? Isn't that at least better than RootOf(sin(_Z)*_Z^2+sin(_Z)-2*_Z)) being returned?

acer

Hi Doug,

There is a root of sin(x)*x^2+sin(x)-2*x near -2.3311223704. It is not a root of cos(x)-x*sin(x)+1 and it is not a root of sin(x).

Have I misunderstood you?

acer

I don't see the same error in Maple 11. Using Maple 11.02 on Linux I see the worse answer, sin( RootOf(sin(_Z)*_Z^2+sin(_Z)-2*_Z)) .

Now, how can Maple sensibly and usefully represent only those values of  RootOf(sin(_Z)*_Z^2+sin(_Z)-2*_Z) which satisfy f, so that the answer is both complete and correct when _EnvAllSolutions=true? I don't see that any current RootOf notation in Maple is going to cover this. Am I missing something?

acer

In addition to adding increased confidence and assurance in the product for the Maple user, a large published test suite would allow talented experts to produce patches for the Maple language library.

Without a comprehensive test suite, any patches  (fixes, or enhancements) would be insufficiently tested.

Now, look at the help-page ?UndocumentedNames and scan down to the one named TestTools.

> eval(TestTools);
module()
export Try, Trynocrash, i, _pexports, TestOptions, Info, ResetInfo,
SetRecord, PlotStructure, StatisticsTests, HadFailure, PrintOnFail,
calcver;
description "a package for test tools"
     ...
end module

Now examine the output of eval(TestTools:-Try) . This is for testing purposes. Has anyone here (eg. package authors) tried using it for that? Should it be documented?

acer

One can obtain the source, compile, run (and observe the coverage of) its official test suite, and replace the gmp library that comes with Maple. (Ok, it's probably easier on some platforms that on others.)

Doesn't that make it more thoroughly testable (by the end-user) than Maple's own kernel in several key ways?

acer

The returned result of RootOf(sin(_Z)*_Z^2+sin(_Z)-2*_Z) appears to be wrong, as a root of cos(x) - x sin(x) + 1.

Somehow, the command,

evalf({%})

got displayed in your post as the 2D Math,

evalf({true});

acer

The hard part for graphing this is not dealing with the rationals, it is dealing with the irrationals.

One difficulty is in making f plot as a function (1-to-1, not 1-to-many). Each irrational is only representable in fixed precision floating-point as a value which happens to also correspond (perfectly) to some rational. And that rational should here be plotted also as a rational (using the rule in f for rationals). But if the same point x gets plotted twice, by both schemes, then the plot doesn't really represent a function (because it's 1-to-2).

Also, how does one make the line along y=0 appear to be not merely solid and yet still be faithful to the spirit of the given definition? Omitting the line along y=0 altogether doesn't seem to encapsulate that important part of it all (to me).

acer

First 528 529 530 531 532 533 534 Last Page 530 of 599