MaplePrimes Questions

Hello,

I am trying to solve CVRPSD by integer L shape method. I have some problems.

d=(0, 20,20,25,15,10): Demand
p=(1,1,1/3,1/2,1/4): the probability demand

K=50
1) How to write properly Recourse Policy (Q) in maple (I attached my problem) ? Recourse (Penalty cost) is applied when the demand exceed the vehicle capacity. We know that in CVRPSD, we don't know the demand until vehicle arrive at the node(customer).
(Look at my program)

Hopefully anybody could help me to solve this.

Thank you any way.
Exact_CVRPSD.mw

Hi everyone:

I want to calculate the value of eval(diff(y, x), x = 0.418e-1)-eval(diff(y, x), x = 0.1e-1), how?

y := (1-Heaviside(x-0.10e-1))*(cos(9.0218219*x)-.99533285*sin(9.0218219*x)-.99999991*cosh(9.0218219*x)+.99533285*sinh(9.0218219*x))+(Heaviside(x-0.10e-1)-Heaviside(x-0.418e-1))*(.24369100*cos(7.7520047*x)-.36109859*sin(7.7520047*x)-.23739778*cosh(7.7520047*x)+.19615343*sinh(7.7520047*x))+Heaviside(x-0.418e-1)*(.95680995*cos(9.0218219*x)-.80884870*sin(9.0218219*x)-1.0381918*cosh(9.0218219*x)+1.1704059*sinh(9.0218219*x))

with regards...

Hi there

Can anyone explain the following calculation error? (The task seems quite simple.)
 

restart

Original - very unintuitive calculation error:

Vector(3, {(1) = 20.09230769, (2) = 32.43076923, (3) = 15.26153846}) = Vector[column](%id = 18446746432715486622)NULL

``

In 1D math it works:

Vector[column](3, [1306./65, 2108./65, 992./65]);

Vector(3, {(1) = 20.09230769, (2) = 32.43076923, (3) = 15.26153846})

(1)

````

Approximate works:

Vector(3, {(1) = 1306/65, (2) = 2108/65, (3) = 992/65})"(->)"Vector[column](%id = 18446746432750076862)

``

Multiplying by 1. works:

Vector(3, {(1) = 20.09230769, (2) = 32.43076923, (3) = 15.26153846}) = Vector[column](%id = 18446746432750171550)NULL

``

 

Download Maple_-_vector_of_fractions_with_floats.mw

Kind regards,

Jens Jacob Thomsen

how to submit maple job through command line. Thank you.

This should be simple but I am missing something. I want to sum the product of combinations of numbers.

I know I can assign values to a0...a[n-1]. But that isn't nice.

 

(n,k):= (5,4);
add(mul~(combinat:-choose([a(||)[](0..n-1)], k))) ; =a0*a1*a2*a3+a0*a1*a2*a4+a0*a1*a3*a4+a0*a2*a3*a4+a1*a2*a3*a4  which is correct.
add(mul~(combinat:-choose([(0..n-1)], k))) ;   #should be 24 but I get 0

 

Hello,

How I can remove this error.

also, i want to find answer via fsolve.

Error, (in fsolve) too many levels of recursion.

Thanks.

test.mw

Ok I am still not further... Lets assume wie have F_q with q=3^2 and the irreducible polynomial T^2+2T+2...
Be tau the alsias(tau=RootOf(T^2+2T+2));
Then I get in Maple the wrong (??) calculation 

(tau+1)(2tau+2)= tau+1 \neq 1, which is supposed to be the right answer: =2tau^2+4tau+2=2(tau^2+2tau+2)-2=0-2=1 because our prime number is 3... WHY does Maple not calculate that stuff correctly??

Another problem:
Be f:= x^2+tau*x;
When I enter Rem(x^q,f,x) mod 3 then Maple returns x, whereas I calculate (tau+1)x...
Where is the mistake?
I build my finite field either via firred := T^2+2*T+2; alias(tau = RootOf(firred))

 

or 
G := GF(3, 2); a := G:-extension; aOut := G:-ConvertOut(a); alias(tau = RootOf(aOut))

But both times the calculations are not correct... I dont know why? 

Please, can somebody help?

Hello,

I have another problem and maybe someone can help me.
When I enter the code: 

with  alias(tau=RootOf(T^2+2T+2)) ;
then Maple gives me the output false???
Why is it false??
Can someone help me?
How do I tell Maple that for example f:= x^2+tau*x is a Polynom with x=variable, tau= RootOf?
Thank you!!

Some definition of n! where n are the negative integers is taken to be infinity. (this is Gamma function for negative integers).

https://en.wikipedia.org/wiki/Gamma_function

So 1/(-1)!  should be zero. And that is what Mathematica gives

But Maple does not like (-1)!, it gives division by zero, I assume because it is not using the above definition using Gamma function.  But then how come Maple is able to find correctly this sum

sum(1/factorial(n-1),n=0..infinity)

Which is exp(1).   The first term above, when n=0 is   1/(-1)!  which Maple does not like. Because if we take the first term as 1/infinity=0 then the sum is the same as if we had

sum(1/factorial(n-1),n=1..infinity)

And now it is exp(1) with no problem dealing with negative integer factorial.

Question is: Since Maple does not like negative integer factorial, how comes it accepted the above sum, whose first term contain negative integer factorial? 

Just wondering how it did the above, that is all. When I solved this by hand, I used 1/(-1)! = 0 to be able to sum it.

Does anyone know of the simplest way to insert  a new line, or carriage return in a Maple Startup Script ?

I am brand new to Maple, so I really don't have a clue what I am doing, but essentially, I would like my new worksheet to start two lines down from the top.  I cannot seem to get the Startup Script to do this.

I have tried several things, and cannot find anything that works.

Any ideas ?

pellsolve := proc (D::posint) local P, Q, a, A, B, i; if type(sqrt(D), integer) then error "D must be a nonsquare integer" end if; P := 0; Q := 1; a := floor(sqrt(D)); A := 1, a; B := 0, 1; for i do P := a*Q-P; Q := (D-P^2)/Q; a := floor((P+sqrt(D))/Q); A := A[2], a*A[2]+A[1]; B := B[2], a*B[2]+B[1]; if Q = 1 and `mod`(i, 2) = 0 then break end if end do; return A[1], B[1] end proc;
pellsolve(107);
                            962, 93
isolve(x^2-107*y = 13);
       /                             2             \   
      { x = 21 - 107 _Z1, y = 107 _Z1  - 42 _Z1 + 4 }, 
       \                                           /   

         /                             2               \ 
        { x = 86 - 107 _Z1, y = 107 _Z1  - 172 _Z1 + 69 }
         \                                             / 
genpellsolve := proc (D::posint, N::integer) local t, u, L1, L2, sols, x, y; if type(sqrt(D), integer) then error "D must be a nonsquare integer" end if; t, u := pellsolve(D); if 0 < N then L1 := 0; L2 := floor(sqrt((1/2)*N*(t-1)/D)) elif N < 0 then L1 := ceil(sqrt(-N/D)); L2 := floor(sqrt(-(1/2)*N*(t+1)/D)) else return {[0, 0]} end if; sols := {}; for y from L1 to L2 do x := sqrt(N+D*y^2); if type(x, integer) then sols := sols union {[x, y]}; if `mod`(x^2+D*y^2, N) <> 0 or `mod`(2*x*y, N) <> 0 then sols := sols union {[-x, y]} end if end if end do; DEBUG(); return sols end proc;

Debug inefficace

I have converted a single large worksheet into a workbook comprising many worksheets.  One of the worksheets contains start-up code.  Is that start-up code (which includes numerous subroutines/functions) automatically available/accessible/executable by all the other worksheets in the workbook?  

Melvin

 

Hello,

Is there any formula in maple to find simplex multipliers vector?

Thank you

I have this animation that displays a particle's position after reflection from a shock (the blue plane). I want to add a line that shows the particle coming in and reflecting and have them animate sequentially, but I cannot figure out how. The line should travel along the b axis, but offset in the xi axis to end where the helix begins. Here is the code for the helix animation:

 

restart; with(VectorCalculus); with(Student[LinearAlgebra]); with(plots);
v[i] := 145000; thetabn := (1/8)*Pi; thetavn := (1/6)*Pi; k := 10; omegac := .5;
v[b] := cos(2*thetabn)/cos(thetabn); v[g] := sin(2*thetabn)/cos(thetabn);
n := `<,>`(k*cos(thetabn), k*sin(thetabn), 0);
vr:=
[v[b]*t, v[g]*sin(omegac*t)/omegac, v[g]*cos(omegac*t)/omegac];

lambda := v[i]*cos(thetavn)/cos(thetabn);
shockplot := PlanePlot(n, caption = "", planeoptions = [colour = blue, transparency = .5], normaloptions = [shape = cylindrical_arrow, colour = red]);

t1 := textplot3d([k*cos(thetabn), k*sin(thetabn), 0, 'n'], align = above);

display(plots[animate](plot3d, [[v[b]*t, v[g]*sin(omegac*t)/omegac, v[g]*cos(omegac*t)/omegac], t = 0 .. x], x = 0 .. 6*Pi, axes = normal, colour = red, labels = ["b", zeta, xi], thickness = 2, paraminfo = false), shockplot, t1, scaling = constrained, tickmarks = [0, 0, 0]);

 

First 724 725 726 727 728 729 730 Last Page 726 of 2427