mmcdara

4842 Reputation

17 Badges

6 years, 357 days

MaplePrimes Activity


These are replies submitted by mmcdara


 

I guess you are aware that 

combine(convert(A1, trig), trig)
                            cos(theta) 
                         - ------------
                           2 sin(theta)

?

@shreen 

C1 is the output of 

C1 := C_Solution[1]:

Thus 

C2 := C_Solution[2]:

and so on.
Can't you do it yourself?

Have you seen the size of the expression which represents C1???
What do you think that tits display will reveal to you? Look at this:
calc_slip_two_cylinders_electo_mmcdara.mw

@acer 

Thankyou acer for having corrected this.

@shreen 
Why can't you?

If you use an "old" Maple version, maybe this comes from the command LinearAlgebra:-LinearSolve?
If it is so replace

SymbolicSol    := LinearAlgebra:-LinearSolve(SymbolicMatrix, SymbolicRhs):

by

C_Vector := Vector(4, [c1, c2, c3, c4]):

solve( {seq(SymbolicMatrix[i] . C_Vector = SymbolicRhs[i], i=1..4)}, [c1, c2, c3, c4]):

If you are stuck on the command DesiredSolution := solve({fn1 = 0, fn2 = 0, fn3 = 0, fn4 = 0}, {c1, c2, c3, c4}), just comment it.


Did you read my answer to your previous question?
I guess not, as I advised you to load your worksheet in your future questions... which you did not.

So load it and afterwards we can figure out where the error comes from..

@Carl Love 

I'm not familiar with curry/rcurry, so please don't take this the wrong way: I feel like your randpoly example is not well chosen because it doesn't highlight the advantages of rcurry over this simple command:

collect(a, [x, y]);

Could you give me an example where collect really requires curry/rcurry?
Thanks in advance.

@Bart @Preben Alsholm 

With Maple 2015.2 the two first integrals are undefined.
@Bart: I have the feeling that you want them to be 0, don't you?
But look at this:
 

z :=0:
i := +infinity:
z*i 
                           undefined

Why would you like the result not to be undefined given the answer above?
Another way to tackle the problem:

J := Int(C, x=0..infinity, y=0..1):
value(J);
                       
                           C infinity
eval(%, C=0)
                           undefined

Then Maple 2015.2 gives in both cases consistent answers.

Now the question is, @Preben Alsholm, "What does Maple 2023 returns in the following case?"

z :=0:
i := +infinity:
z*i ;  # = ???

If it doesn't return undefined, then I would consider this as a bug, and if it returns  undefined, then Maple 2023 is not consistent with itself.
Whatever the answer it seems there is a serious problem?


The problem is that even Maple 2015.2 is not complettely consistent with itself:

int(0,x=0..infinity);
int(int(0,x=0..infinity), y=0..1);
int(int(0,x=0..1),y=0..infinity);
                               0
                               0
                               0

But, using Int instead of int, the result becoms consistent with z*i : undefuned:

Int(C, x=0..infinity):
value(%);
eval(%, C=0)
                       signum(C) infinity
                           undefined


I believe the OP asked a question which s far frim being anecdotal.



but you keep changing your notations from question to question and I dont' have anymore time to fix this kind of things.

I answered your initial problem with the notations you first gave, next you changed them and in order not to modify my code I wrote the  recode procedure which, from some step, introduces your new notations; and now you change them again and you seem surprised that this recode procedure doesn't work?

So I'm done with that.

@acer 

Thank you acer.

# acer's code
S := "124e34e243e45e56e76f34e45e23ea12e98e34e43":
N := parse~(StringTools:-Split(S,cat(seq("A".."z"))));
     [124, 34, 243, 45, 56, 76, 34, 45, 23, 12, 98, 34, 43]

# next
ListTools:-Reverse~(convert~(N, base, 10))
[[1, 2, 4], [3, 4], [2, 4, 3], [4, 5], [5, 6], [7, 6], [3, 4], 

  [4, 5], [2, 3], [1, 2], [9, 8], [3, 4], [4, 3]]



 

restart:

R0 := (a, b, c) -> 1/(a-sqrt(b+c*cos(x)));
Je := int(R0(0.9, 4.5, 0.1), x=0..2*Pi)

proc (a, b, c) options operator, arrow; 1/(a-sqrt(b+c*cos(x))) end proc

 

-5.145818656

(1)

Digits := 10:
J  := int(R0(a, b, c), x=0..2*Pi):
eJ := eval(J, [a=0.9, b=4.5, c=0.1]):
eJ := simplify(fnormal(eJ));

convert~(subs(I=i, eJ), Heaviside)

eJ := piecewise(0. <= 1-I, 0., 0.)+piecewise(I <= 0., 0., 0.)+piecewise(I <= 1, 0., 0.)+piecewise(0. <= -I, 0., 0.)-5.145818658

 

-5.145818658

(2)

Digits := 10:
K  := int(R0(a, b, c), x=0..2*Pi) assuming a > 0, b > 0, c > 0:
eK := eval(K, [a=9/10, b=9/2, c=1/10]):
eK := simplify(fnormal(eK));
eK := convert~(subs(I=i, eK), Heaviside)

eK := piecewise(0. <= 1-I, 0, 0.)+piecewise(I <= 0., 0, 0.)+piecewise(I <= 1, 0, 0.)+piecewise(0. <= -I, 0, 0.)-(162/3949)*EllipticPi(-20/359, (1/22*I)*sqrt(2)*sqrt(11))*sqrt(5)*sqrt(2)*sqrt(11)-(2/11)*EllipticK((1/22*I)*sqrt(2)*sqrt(11))*sqrt(5)*sqrt(2)*sqrt(11)-(180/136061)*Pi*sqrt(136061)

 

-(162/3949)*EllipticPi(-20/359, (1/22)*i*2^(1/2)*11^(1/2))*5^(1/2)*2^(1/2)*11^(1/2)-(2/11)*EllipticK((1/22)*i*2^(1/2)*11^(1/2))*5^(1/2)*2^(1/2)*11^(1/2)-(180/136061)*Pi*136061^(1/2)

(3)

evalf(subs(i=I, eK));

-5.145818656+0.*I

(4)

 

ANOTHER SET OF DATA

 

restart:

R0 := (a, b, c) -> 1/(a-sqrt(b+c*cos(x)));
Je := int(R0(0.9, 4.5, -4), x=0..2*Pi)

proc (a, b, c) options operator, arrow; 1/(a-sqrt(b+c*cos(x))) end proc

 

Float(undefined)+3.662506136*I

(5)

# Look how yout integral behaves

evalf(Int(R0(0.9, 4.5, -4), x=0..2*Pi, method=_d01ajc));

Error, (in evalf/int) NE_QUAD_NO_CONV:
  The integral is probably divergent or slowly convergent.

 

# So it is not that surptising that you may obtain wrong results

evalf(Int(R0(0.9, 4.5, -4), x=0..2*Pi));
evalf(Int(R0(0.9, 4.5, -4), x=0..2*Pi, method=_d01akc));
evalf(Int(R0(0.9, 4.5, -4), x=0..2*Pi, method=_d01akc));

Float(undefined)

 

Error, (in evalf/int) NE_QUAD_BAD_SUBDIV:
  Extremely bad integrand behaviour occurs around the
  sub-interval ( 5.8868969e+00,  5.8868969e+00 ).

 

Digits := 10:
J  := int(R0(a, b, c), x=0..2*Pi):
eJ := eval(J, [a=0.9, b=4.5, c=-4]):
eJ := simplify(fnormal(eJ));

subs(i=I, convert~(subs(I=i, eJ), Heaviside))

eJ := piecewise(1 <= 1-I, 0., 0.)-2.362349456-2.406002148*10^(-8)*I+piecewise(I <= 0., 0., 0.)

 

-2.362349456-0.2406002148e-7*I

(6)

Digits := 10:
K  := int(R0(a, b, c), x=0..2*Pi) assuming a > 0, b > 0, c < 0:
eK := eval(K, [a=9/10, b=9/2, c=-4]):
eK := simplify(fnormal(eK));

-(4/17)*17^(1/2)*2^(1/2)*EllipticK((4/17)*17^(1/2))-(324/13073)*17^(1/2)*2^(1/2)*EllipticPi(800/769, (4/17)*17^(1/2))-((180/23839)*I)*Pi*23839^(1/2)

(7)

evalf(eK);

-2.362349463-0.30e-7*I

(8)

 


 

Download No_discrepancy.mw

@sursumCorda 

I can only use Maple 2015 at home (where I am currently), but I have Maple 2021 at work and I seem to remember that there are many options for customizing edegs and vertices.
This unaesthetic rendering can easily be avoided, but the solution differs for the 2015 and 2021 versions and more.
Refering to my previous answer, and assuming you use Maple 2020 or beyond, the structure sent to PLOT is made of (NV = number of vertices, NE = number of edges)

  • NV POLYGONS corresponding to the shape the vertex name is written on,
  • NV TEXT corresponding to the vertex names,
  • NE CURVES (non directed graphs) or sequences of CURVES, POLYGONS (directed graphs) where:
    • each CURVES draws an edge,
    • each POLYGONS draws an arrow.

Then 

NV := numelems(Edges(K3)):
PLOT(others[NV+1..-1][], eval(texts, texts[2]=substext)[])

should remove the unaesthetic shapes around the vertex names.


In any case it is always possible to go beyond what Maple enables, see my answers and  @acer 's here https://www.mapleprimes.com/questions/236139-Can-The-Shape-And-Color-Of-The-Arrowheads

You shoul either load a worksheet (use the green up-arrow in this menu bar), or provide the expression of S (either explicit or as a soluyion of some equation).
Without this nothing can be done.

@lcz 

I'm glad to hear that.

Ice on the cake: bended edges

  • pos is the abscissa of the "bending knot", defined by 0 pos < 1, with pos=1 at the origine of the edge and pos=0 at its end.
  • mag is the magnitude of the bending. It can be positive or negative.
  • This bending could be coupled with the mofification of the arrows (the most tricky point is to rotate the arrow correctly in otder to make it tangent to the nended edge).

Download For_Fun.mw

But maybe this feature alredy exists in Maple 2023?

1 2 3 4 5 6 7 Last Page 3 of 106