Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 358 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Please re-enter the problem. The piecewise part makes no sense to me. I don't think that you've accurately transcribed what your professor wrote.

@glcrawfo See the Answer that I just posted below.

I deleted the Question where you asked essentially the same question as this but tried to put the whole problem in the title box. Please keep titles somewhat general and word-based and put specifics like actual equations in the main body box.

I am not familiar with the term "component graph". Can you define it? I can certainly show you how to plot x(t) over 0 <= t <= 5, or any other interval.

@mmcdara Yes, the error you got is a version issue. You'll need to change TRX1 from

(n::posint)-> add(GG(TRS(X), TRS(Y)), 1..n)

to

proc(n::posint) local k; add(GG(TRS(X), TRS(Y)), k= 1..n) end proc

@mmcdara The binary-infix-operator precedence of = is higher than that of ->, so 

':-Mean'= ()-> 1/Pi 

is equivalent to

(':-Mean'= ())-> 1/Pi,

which is nonsense. Hence, Acer's parentheses. See ?operators,precedence.

@syhue Ah, you're using Maple's 2-D Input (which is total garbage, for reasons such as you're about to see). In that case, use

C &\^ d mod n

The backslash will not appear as you type it. It's an escape character that tells it that the ^ is attached to the & and it's not meant to perform its usual 2-D Input function, which is superscripting. If you switch to 1-D input (aka Maple Input), which is what I always use, then just enter what I said before

C &^ d mod n

In other words, don't use backslash in this context in 1-D input.

To avoid the risk of numeric overflow, you should do this for all modular exponentiation (unless the exponent is -1). So, do

C:= M &^ e mod n

also, even though e is fairly small in this case.

@acer Is it possible to use Statistics:-Specialize to achieve the goal that I stated in the first paragraph of my Reply above? That is, the creation of custom parametrized Distributions that can be used exactly like the stock parametrized distributions? If so, then that's the way to do it.

I converted your Post to a Question.

It's extremely difficult to for us to re-execute your code in its current format. It's also difficult to follow references to equation numbers, such as the all-important equation 19. Please upload the worksheet using the green up arrow on the toolbar.

There's a mysterious symbol uminus0 or `&uminus0;` that begins to appear in your output as of MatrixInverse(XprimedX). I think that this has something to do with your trouble. Symbols with names like that are special mathematical symbols that come from the palettes and are often inadvertently pasted into code. There's no way to tell whether this is actually the cause of your trouble without close inspection of the actual worksheet.

Great Question; vote up. I don't have an Answer, but this is something that I've thought about before: How can I create my own parametrized custom distribution MyDist such that it can be invoked MyDist(a,b) in any situation where one could invoke, say, Normal(mu, sigma)? That is your goal, correct? If so, I think that you're well on your way to a method. I think that the key is constructing the module that is the 3rd attribute (see setattribute at ?attributes).

Here are five very small steps to help you on your way:

1. I see that you're using with, apparently simply to list the exports of the 3rd attribute. It seems to work, but I think that it's risky because with modifies the global state. You could replace with(A) with exports(A).

2. In all cases where you've defined a PDF, you've used both z and t, but you need to reduce that to a single name.

3. You've used ParentNames where you should've used ParentName.

4. No doubt you've read the examples at ?Statistics,Distribution, but they're worth re-reading carefully a few more times.

5. Avoid compound conditions in piecewise whenever possible: piecewise(a <= t and t < b, 1/(b-a), 0) can be and should be replaced by piecewise(t < a, 0, t < b, 1/(b-a), 0). I find that the latter form causes less problems, for example with symbolic integration. The only benefit that I know of the former form is that its prettyprinted display is more akin to standard mathematical typesetting. Maple's definition of piecewise guarantees that the leftmost condition that evaluates to true is the one that's used, which is what makes the two forms mathematically equivalent (for all real t). There's no need to construct a piecewise such that only one condition can be true because it's only the leftmost one that's true that matters.

@Christian Wolinski You're right: My g doesn't even do what intended, which was that the output be (a,b)-> x-> a*x+b, with the internal ab, and x being parameters, not globals. My testing was inadequate, and globals got through unnoticed.

You got a notice because you wrote an Answer (which used 'unapply' inside unapply), and I wrote a Reply to that Answer. At the very moment that I pressed Submit on that Reply, you deleted your Answer, but the notification had already been sent. The Reply itself was not posted because there was no longer any Answer to attach it to.

@tomleslie It's unfortunate that you suppressed the output of your most-important line. Had you not, it would've been obvious that your g re-executes unapply and eval on every invocation, which is undesirable.

@Christian Wolinski Although your command does ultimately produce a correct result (i.e., g(2,3)(4) yields 11), I don't think that it's what the OP really had in mind because the internal unapply is re-executed for every invocation of g.  

@ecterrab Thank you for pointing me to PDEtools:-dpolyform. It's an extremely powerful command. It's quite a shame that its help page---although extensive---doesn't show a single example where the command's input is anything other than algebraic---rather than differential---equations. Nonetheless, I was sucessful in applying it to all the ODEs in the OP's test suite.

However, dpolyform cannot be used to substantially reduce the complexity of my procedure ODEdegree (above) because, as you said, it returns an equation "that is polynomial in the unknown and its derivatives" [emphasis added] whereas the OP requires that only the derivatives, not the unknown, be put into polynomial form. Thus, usage of frontend is still needed to ignore the unknown but not its derivatives.

While I do not have expertise in the symbolic solution of differential equations, I fail to see the usefulness of the OP's concept of the "degree" of a differential equation. It does however seem to be a standard definition. My procedure implements that definition as per the OP's request.

 

@syhue Your "following steps" do not appear in your message. Either enter them into your message as plaintext or use the green up arrow on the toolbar to upload a worksheet.

If I may hazard a guess as to what you're working on: If you want to compute the remainder of (a^b)/p where ab, and are integers and itself is very large, then do

a &^ b mod p

@666 jvbasha The command print can be used anywhere, in or out of a loop or procedure, to display output, including any type of plot.

First 259 260 261 262 263 264 265 Last Page 261 of 709