Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Christian Wolinski Your closed-form solution procedure can be simplified (by my hand, not by Maple) to

G:= n-> (3*I^n*<-3,1;5,0>.<I,-I;1,1>.<1,-1>^~n + <-2,2>)/2/n!;

And it can be used as 

G~([$0..10]);

How did you get your solution? I couldn't get it with rsolve.
 

@Kitonum Using Maple 2019, I copy and pasted your code without making any changes. The results of the solve and subs that I got are exactly as you show. However, my results for the seq are

[2, 1], [8, -14], [-2, 1/2], [-5/3, 8/3], [1/12, 1/24], [1/15, -7/60]

I also solved the problem by a different method and got those same values.

@pik1432 You seem to have a fundamental misunderstanding of the intended purpose of diffop2de. You need to use the differential operator that has been declared. In your example #1 above, you've declared Dt as the operator and t as its variable. But your equation doesn't contain Dt, so nothing special happens when you call diffop2de. In example #2, no differential operator has been declared, so you get an error. In #3, you've declared Dx and x but the equation doesn't have Dx; it doesn't even have x.

The command diffop2de does NOT take derivatives of overall expressions, so it won't turn constants to 0. Rather, it applies the special differential operators already present in the expression. It is possible to use D as the special differential operator if you declare it so, but I strongly advise you to not do this unless you have a complete understanding of what the command does.

@dharr I came up with a better solution to the is problem. I too am reluctant to use the "big gun" of highly symbolic is when it's not needed for most practical cases. The solution is to use `<=` as the default order evaluator and allow the user to pass in another if it's needed (just like one does with the sort command). 

unimodal:= proc(L::list, `&<`:= `<=`)
local n:= nops(L), k;
    for k to n-1 while L[k] &< L[k+1] do od;
    for k from k to n-1 while L[k+1] &< L[k] do od;
    evalb(k=n) #i.e., Did we get to the end?
end proc
:
unimodal([1,Pi,1]);
Error, (in unimodal) cannot determine if this expression is
true or false: 1 <= Pi

unimodal([1,Pi,1], is@`<=`);
                              true
unimodal([3,1,3], `>=`);
                              true

This change makes the procedure shorter, and now any list can be accepted.

@Scot Gould Yes, of course, a comment symbol is never "necessary" when there's no comment. It's traditional in many languages to make boxes and another visual delimiters with them. I was finishing the vertical line of semicolons.  

@dharr If the list contains symbolic constants, then a naked inequality will error:

type(Pi, realcons);
                             
true
while Pi < 1 do od;
Error, cannot determine if this expression is true or false: Pi < 1
while is(Pi < 1) do od;

If the procedure's input is restricted to list(numeric) instead of list(realcons), then you can safely remove the is.

@acer Aw, you gave away my solution. No worries. 

Specifically, I was trying to guide the OP to coming up with something akin to this (but without the fancy Maple-specific operators of course):

factor(x^2 + 598*x + 67497);
{p,q}=~ eval({op}(%), x= 10^50);
andmap(isprime@rhs, %);

I edited this Question's title because its original title "Maple RSA Problem" made it look like a duplicate of your other Question posted at roughly the same time.

If you haven't already, you should look at the help page for DifferentialGeometry:-JetCalculus:-TotalDiff. I think that will give you a start.

@danortega I need you to tell me any lower or upper bounds that you know of for *all* of the variables and constants:

phi__1, phi__2: (nonnegative?)
gamma: (in interval 0..1?)
pi__w, pi__a, pi__b: (in interval 0..1?)
w: (greater than 1?)
beta: (nonnegative?)

Are any of the abcnecessarily greater than 1?

In this case, you should post the original mathematical problem that you're trying to solve, rather than something (such as the code in your Question) that is at least 2 steps removed (i.e., levels of abstraction) from that original problem:

  • Level 1 abstraction: You're trying to apply some symbolic solution technique (i.e., algorithm) to the problem. I suspect that the problem is a differential equation, and you're trying to find a series solution. But what you've posted doesn't contain any differential equation, nor does it contain any series.
  • Level 2 abstraction: You've tried to encode Level 1 into Maple. Tom Leslie has interpreted your Question's code into working Maple code, and I would've interpreted it exactly as he did, but I doubt that it's relevant to your actual problem because it has a trivial and unique solution, given below.

The trivial solution: 

U[k](x) = 3^k/k! * exp(x)  #for all nonnegative integers k
             

Sum(U[k](x), k= 0..infinity) = exp(3+x)
              

@Carl Love 

I am surprised that dsolve does return a solution for cases (such as yours) where the delay itself depends on one of the functions being solved for; however, for the cases that I've tried, the solutions don't seem correct (using Maple 2019 at the moment). For example,

ode:= diff(y(x),x) = y(1-y(x)):
sol:= dsolve({ode, y(0)=1}, numeric, delaymax= 99, delaypts=10^5):
plots:-odeplot(sol);

 

A close inspection of that plot's data matrix shows that the plotted function is y = 1+x down to the last decimal place. Direct substitution of that into ode shows that that isn't correct.

So, is this a bug, or am I not using the delay DE solver correctly?

Here are some minor steps, mostly to simplify the presentation of the problem. I don't think that they'll have a major impact towards obtaining a symbolic solution (but every little bit helps): 

  1. Please get rid of the subscript t. It's just clutter that makes the problem harder to read.
  2. For the same reason, replace 1-gamma with some other variable, say g.
  3. Substitute 1 - phi__1 - phi__2 for phi__3 in the objective.
  4. Step 3 eliminates all decision variables from the fourth term, so that term can be removed entirely; it can't change the maximizing values of the decision variables.
  5. Replace a__1 + 1 by A__1, a__2 + 1 by A__2b__1 - 1 by B__1b__2 - 1 by B__2c__1 + 1 by C__1c__2 + 1 by C__2d__1 - 1 by D__1d__2 - 1 by D__2, and w+1 by W.

With these changes, the objective can be entered like this:

phi:= <phi1,phi2>: A:= <A1|A2>: B:= <B1|B2>: C:= <C1|C2>: E:= <D1|D2>:

One way:
Ob:= (pi__w*((W-<2|2>.phi)^g+beta*(pi__a*(A.phi-1)^g+(1-pi__a)*(C.phi-1)^g))
    +(1-pi__w)*beta*(pi__b*(B.phi+1)^g+(1-pi__b)*(E.phi+1)^g))/g;

Or, using more-Maple-specific operators:
Ob:= (<map(`.`, [-<2|2>, A, C, B, E], phi) + [W,-1,-1,1,1]>^%T)^~g
    . <pi__w*~(1,beta*~(pi__a,1-pi__a)),(1-pi__w)*beta*~(pi__b,1-pi__b)>/g; 

Now here's what may allow some major progress towards a symbolic solution: I suspect that there are some bounds for your variables and constants that you haven't stated. Which are necessarily nonnegative? Which are necessarily in the interval 0..1?

@rcorless In addition to the errors that you've correctly pointed out, the code also has both k and k[1] used as bound[*1] variables of summation. So k is being used four ways.

[*1] Bound here is the adjective, the opposite of free and the past participle of to bind. It's not meant in its noun sense related to the boundaries or limits of summation. 

@tomleslie Good Answer; voted up. It can be made a bit simpler because Unit is pre-defined as a top-level command. It does pass directly to Units:-Unit, but you don't need to explicitly invoke the Units package to use it.

First 93 94 95 96 97 98 99 Last Page 95 of 708