acer

32490 Reputation

29 Badges

20 years, 8 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

And, in case the OP was wondering,

restart;

eqn := 1/4*x*(3-2*x)^2/(1-x)^3
       = 18325.73901+exp(36.58420421-10902.09286/T):
ee := (lhs-rhs)(eqn):

A:=fsolve(eval(ee,T=300)):
B:=fsolve(eval(ee,T=800)):

P := plot(rhs(isolate(ee,T)), x=A..B):

plots:-display(
   plottools:-reflect(P, [[0,0],[1,1]]),
   labels=[T, x], size=[500, 400]);

@Ronan I have submitted such a Software Change Request (SCR). Part of it relates to convenience (eg. supplying the rotation Matrix), and part to efficiency (esp. of internal plot structures under rotation/transformation).

ps. I might reiterate that vv's suggestion also seemed nice and convenient (to me), though using angles rather than an explicit rotation Matrix.

I should probably mention that I don't know what causes the different behavior. It might well be that it's related to memory state, say (and if so then perhaps not caused by a special 2-D Input per se, except to the extent that it affects the state).

@Ronan Yes, thanks for the interesting details. I've reread the prior responses now -- sorry about the Body2 attribution.

Please note that that the variant you cite (just above) from my Answer sheet attachment is quite inefficient (much more so than plottools:-rotate itself, which can turn lean float[8] rtable data into cumbersome listlists). I was really just trying to illustrate some other kinds of syntax would work for you (and in particular which allowed for Matrix `Rot` to be pushed in by name, say).

And with yet another way (somewhat of a cross bewteen my original and Rouben's).

equilibrium_alt2.mw

@Christopher2222There are more ways to rebind the name `changecoords` than just by loading the `plots` package. So your response is not wholly correct.

Using colon-dash before the name gets the global name, regardless. Wrap it in uneval quotes if you want something that guards against collision-with-a-local *and* assignment to the global, etc. 

Your last comment goes against the main thrust of your initial question.


 

restart;

msg:="Picturesque meant - he decided after careful observation of the scenery that inspired Twoflower to use the word - that the landscape was horribly precipitous. Quaint, when used to describe the occasional village through which they passed, meant fever-ridden and tumbledown. Twoflower was a tourist, the first ever seen on the Discworld. Tourist, Rincewind had decided, meant 'idiot'.";

"Picturesque meant - he decided after careful observation of the scenery that inspired Twoflower to use the word - that the landscape was horribly precipitous. Quaint, when used to describe the occasional village through which they passed, meant fever-ridden and tumbledown. Twoflower was a tourist, the first ever seen on the Discworld. Tourist, Rincewind had decided, meant 'idiot'."

Elg_encrypt:=proc(s::string, r::posint,
                  p::posint, a::posint, b::posint)
  local hkt, L;
  if not r <= p-1 then
     error "r must be strictly less than p";
  end if;
  hkt := `mod`(a &^ r, p);
  L := convert(msg, bytes);
  return hkt, map( u->`mod`(u*b&^r, p), L );
end proc:

header,ciphertext:=Elg_encrypt(msg,20000000000,14654455471,
                               457454,13954306945):

Error, (in Elg_encrypt) r must be strictly less than p

header,ciphertext:=Elg_encrypt(msg,532123,14654455471,
                               457454,13954306945):

header;

9681348997

ciphertext;

[12432485341, 2579085006, 13736574369, 4105371047, 9573017222, 7824534168, 10017411248, 13292180343, 2356887993, 9573017222, 10017411248, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 11572790339, 13765667419, 11765894302, 10017411248, 13765667419, 4549765073, 10017411248, 13736574369, 2579085006, 4549765073, 10017411248, 4549765073, 13765667419, 2801282019, 830601952, 4105371047, 10017411248, 7824534168, 13765667419, 13736574369, 2801282019, 7824534168, 10017411248, 830601952, 9573017222, 4327568060, 13765667419, 6076051114, 8268928194, 13292180343, 10017411248, 7824534168, 386207926, 2801282019, 4105371047, 2579085006, 6076051114, 608404939, 13765667419, 6076051114, 830601952, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 13292180343, 13736574369, 10017411248, 608404939, 10017411248, 7824534168, 2134690980, 13765667419, 4105371047, 11765894302, 2801282019, 4105371047, 13765667419, 2579085006, 608404939, 13292180343, 11543697289, 2579085006, 7824534168, 10017411248, 4549765073, 13765667419, 4994159099, 5853854101, 6076051114, 830601952, 4327568060, 6076051114, 5853854101, 10017411248, 7824534168, 13765667419, 4105371047, 6076051114, 13765667419, 9573017222, 13292180343, 10017411248, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 5853854101, 6076051114, 7824534168, 4549765073, 13765667419, 11572790339, 13765667419, 4105371047, 11765894302, 2801282019, 4105371047, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 4327568060, 2801282019, 608404939, 4549765073, 13292180343, 13736574369, 2801282019, 11543697289, 10017411248, 13765667419, 5853854101, 2801282019, 13292180343, 13765667419, 11765894302, 6076051114, 7824534168, 7824534168, 2579085006, 8268928194, 4327568060, 2134690980, 13765667419, 11543697289, 7824534168, 10017411248, 13736574369, 2579085006, 11543697289, 2579085006, 4105371047, 6076051114, 9573017222, 13292180343, 2385981043, 13765667419, 3245676045, 9573017222, 2801282019, 2579085006, 608404939, 4105371047, 6105144164, 13765667419, 5853854101, 11765894302, 10017411248, 608404939, 13765667419, 9573017222, 13292180343, 10017411248, 4549765073, 13765667419, 4105371047, 6076051114, 13765667419, 4549765073, 10017411248, 13292180343, 13736574369, 7824534168, 2579085006, 8268928194, 10017411248, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 6076051114, 13736574369, 13736574369, 2801282019, 13292180343, 2579085006, 6076051114, 608404939, 2801282019, 4327568060, 13765667419, 386207926, 2579085006, 4327568060, 4327568060, 2801282019, 6298248127, 10017411248, 13765667419, 4105371047, 11765894302, 7824534168, 6076051114, 9573017222, 6298248127, 11765894302, 13765667419, 5853854101, 11765894302, 2579085006, 13736574369, 11765894302, 13765667419, 4105371047, 11765894302, 10017411248, 2134690980, 13765667419, 11543697289, 2801282019, 13292180343, 13292180343, 10017411248, 4549765073, 6105144164, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 830601952, 10017411248, 386207926, 10017411248, 7824534168, 11572790339, 7824534168, 2579085006, 4549765073, 4549765073, 10017411248, 608404939, 13765667419, 2801282019, 608404939, 4549765073, 13765667419, 4105371047, 9573017222, 9795214235, 8268928194, 4327568060, 10017411248, 4549765073, 6076051114, 5853854101, 608404939, 2385981043, 13765667419, 4994159099, 5853854101, 6076051114, 830601952, 4327568060, 6076051114, 5853854101, 10017411248, 7824534168, 13765667419, 5853854101, 2801282019, 13292180343, 13765667419, 2801282019, 13765667419, 4105371047, 6076051114, 9573017222, 7824534168, 2579085006, 13292180343, 4105371047, 6105144164, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 830601952, 2579085006, 7824534168, 13292180343, 4105371047, 13765667419, 10017411248, 386207926, 10017411248, 7824534168, 13765667419, 13292180343, 10017411248, 10017411248, 608404939, 13765667419, 6076051114, 608404939, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 5438553125, 2579085006, 13292180343, 13736574369, 5853854101, 6076051114, 7824534168, 4327568060, 4549765073, 2385981043, 13765667419, 4994159099, 6076051114, 9573017222, 7824534168, 2579085006, 13292180343, 4105371047, 6105144164, 13765667419, 8713322220, 2579085006, 608404939, 13736574369, 10017411248, 5853854101, 2579085006, 608404939, 4549765073, 13765667419, 11765894302, 2801282019, 4549765073, 13765667419, 4549765073, 10017411248, 13736574369, 2579085006, 4549765073, 10017411248, 4549765073, 6105144164, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 8075824231, 2579085006, 4549765073, 2579085006, 6076051114, 4105371047, 8075824231, 2385981043]

 


 

Download elg_encrypt.mw

@Gibberish123 

@Christopher2222 

foobar := eval(:-changecoords)

@nk2016 

plots:-display(Array( [ [ P1, P2 ], [ P3, P4 ] ] ) );

 

@Gibberish123 The procedure rsa you show expects its second argument to be a list. So why are you trying to call it like rsa(26271227347, 11393739244) where the second argument is a scalar?

The fact that your function call to rsa returned unevaluated indicates that you have not actually made the assignment of the procedure you show (in an image, sigh) to the name rsa I suggest that you switch from 2D Input to 1D Maple Notation input, and from Document to Worksheet. See the GUI Options/Preferences.

Your procedure uses the name message. Where would that be defined? Your procedure has a parameter msg. Is the former a typo?

Your keys are very small.

Why do you ignore my suggestion to use the efficient syntax modp(Power(num,e), n) instead of the inefficient num^e mod n syntax?

Your technique of repeated list augmentation is inefficient. You could just use seq (or map) to operate over the elements of list msg, and have it be both more efficient and terse and understandable.

@Gibberish123 I don't understand why you want to do have argument msg be a list. And isn't `message` a typo for `msg`.

You seem to be ignoring everything I wrote before, as well as using several anachronistic maple programming syntax elements. It is hard to help when you don't respond directly to questions or suggestions.

Please don't repost this as yet another duplicate question, just because nobody has answered here. 

@Ronan No, there is a bug in plottools:-line that it works with unassigned names in the data. It should throw an error line `point` does. That's my opinions, anyway. Better is to delay evaluation, as I showed.

How about checking that dy/dx = 1/(-tan(t*(n+1)/n)) and consider when the denominator of that tends to zero? How often can that occur, given the bounds on t?

@vv Yes, I agree. I do not know offhand whether the following discrepancy is by design or oversight.

plottools:-line([0, 0, 0],[a,b,c]);
                   CURVES([[0., 0., 0.], [a, b, c]])

plottools:-point([a,b,c]);          
Error, (in plottools:-point) incorrect arguments for creating
 points structure, try providing the dimension option

plottools:-point([a,b,c],dimension=3);
Error, (in Plot:-Structure:-Points) points cannot be converted
 to floating-point values

@vv I gave three ways of doing it: using either unevaluation quotes, or the animate syntax (which splits command and its args), or both. Each of the three pairs (for line and point) have both calls being similar. No special difference as far as one (of the pair) goes versus the other,

I did this to contrast with your suggestion to use POINTS instead of point, which of course is indeed a special difference.

I suggest, therefore, that preventing premature evaluation (here, at least) by using uneval-quotes can work with a more consistent methodology than does replacement of command-name or use of internal structures. It's not alays true, but it is here, and often is.

First 288 289 290 291 292 293 294 Last Page 290 of 594