Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have this maple code:
I want to change

back to α. How can i do it ? (it don't work with unprotect)

 

 

I do the numerical simulation with

lp:=dsolve(....,type = numeric, range = ta .. te)

The simulation stop at t=te .

I want to stop the simulation when e.g. x(t) < 0

How can i do it ?

 

I use
lp1=dsolve(...,numeric)
p1 := odeplot(lp1,....)

new parameter

lp2=dsolve(...,numeric)
p2 := odeplot(lp2,....)

display([p1, p2], legend = ["step", "impulse"])

anf get the error

 

Error, (in plots:-display) display does not accept the legend option

 

 

 

 

Hi 

I have a question about function as parameter in procedure

is it possible that I type 

f := x-> x+1

Test (f(x))

instead of Test(f) ? 

where Test is a simple procedure that takes in one function parameter 

Test := proc (f)
return f(1) + f (2) 

 

    Hello, colleagues!

    I want to find zero function given by the process that integrates the ODE, but get this warning and do not know what to do with it.  I will be grateful to any advice!!!

T0 := 300; G1 := 1.2*10^6; G2 := 1.2*10^6; k := 1.79333595*10^(-6); l := 1/(12*10^4); U_max := 5.0; th0 := .5; q0 := 0.1e-2:

u(x):=piecewise(x<=-1,-U_max,x>1,U_max,x<=1 and x>-1,0): 

sys := diff(x1(t), t) = x2(t),
           diff(x2(t), t) = l*u(x4(t))-k*sin(2*x1(t)),

           diff(x4(t), t) = -x3(t),

            diff(x3(t), t) = 2*k*cos(2*x1(t))*x4(t);


init:=x1(0)=th0,   x2(0)=q0: 

h1 := proc (t1, alpha_1, alpha_2, th_0, q_0, g1)::float;
local X1, X3, Res;
ptions operator, arrow;
global sys, u;
X1 := eval(x1(t), dsolve({sys, x1(0) = th_0, x2(0) = q_0, x3(0) = alpha_1, x4(0) = alpha_2}, numeric, range = 0 .. t1, output = listprocedure));
X3 := eval(x3(t), dsolve({sys, x1(0) = th_0, x2(0) = q_0, x3(0) = alpha_1, x4(0) = alpha_2}, numeric, range = 0 .. t1, output = listprocedure));
es := X3(t1)+2*g1*X1(t1);
return Res end proc

h2 := proc (t1, alpha_1, alpha_2, th_0, q_0, g2)::float;
local X2, X4, Res;
options operator, arrow;
global sys, u;
X2 := eval(x2(t), dsolve({sys, x1(0) = th_0, x2(0) = q_0, x3(0) = alpha_1, x4(0) = alpha_2}, numeric, range = 0 .. t1, output = listprocedure));
X4 := eval(x4(t), dsolve({sys, x1(0) = th_0, x2(0) = q_0, x3(0) = alpha_1, x4(0) = alpha_2}, numeric, range = 0 .. t1, output = listprocedure));
Res := X4(t1)+2*g2*X2(t1);
return Res
end proc

Test_h1 := proc (x, y)::float;
h1(10.0, x, y, 0.209327944398961e-2, -0.417641536045032e-3, G2)
end proc;

Test_h2 := proc (x, y)::float;
h2(10.0, x, y, 0.209327944398961e-2, -0.417641536045032e-3, G2)
end proc

fsolve([Test_h1, Test_h2]);
Warning, unable to store _EnvDSNumericSaveDigits when datatype=integer[8]
Test_2.mw

Can someone help me to find graph of this type of solutions .

finalsol := exp(I*(-k*x+t*(k^2+2*rho^2-2*sigma^2)+theta))*rho*tanh(-2*k*rho*t+rho*x);

sol1 := eval(finalsol, [rho = .5, theta = .5, sigma = .5, k = .5]);

graph1 := plot3d(sol1, t = -5 .. 5, x = -5 .. 5, numpoints = 300, frames = 50, axes = framed, color = x, thickness = 5, axesfont = ["HELVETICA", "ROMAN", 24], labelfont = ["HELVETICA", "ROMAN", 24]);

ContPlot1 := contourplot(sol1, t = -20 .. 20, x = -20 .. 20, frames = 50, axes = framed, thickness = 5, numpoints = 300, a*xesfont = ["HELVETICA", "ROMAN", 24], labelfont = ["HELVETICA", "ROMAN", 24])

plot_solution.mw

 

in maple 12,

i follow https://en.wikipedia.org/wiki/Eigenvalue_algorithm

it said QR return eigenvector but after compare with eigenvector function, they are not the result from eigenvector function

with(LinearAlgebra):
M := Matrix([[1,2,3],[4,5,6],[7,8,9]]);
A := HessenbergForm(M);
Q1, R1 := QRDecomposition(A);

Q1, R1 := QRDecomposition(M);

v, e := Eigenvectors(M);
v, e := evalf(Eigenvectors(M));
 

in maple 2015

if start from GivensRotationMatrix , how many times of 

GivensRotationMatrix in order to calculate the result of QR decomposition?

can this QR decomposition calculate the result of eigenvector?

Hi I was hoping if someone could mark this proof for a lemma regarding the Euler totient functin for me.

 

Thanks in advance.

 

totient_lemma_proof.mw

How am I going to evaluate function like this ? I tried signum evalf, eval and solve, they dont work

I am working on problems in identifiability and I am interested in how many Lie derivatives of two kinds are required to get a full result for a simple system, and more interestingly a way of visualising what comes out when too few Lie derivatives are used. 

The method is simple, I use Lie derivatives my own program GTS2 to get relationships that must be conserved for the output for two parameter vectors to give the same output (you can find it along with everything else for this question here.

An example of a list of parameter relationships is: 

[{R = R, Rh = Rh, alpha = alpha, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -(k[a2]*C[T]*R-kh[a1]*Ch[T]*Rh-kh[a2]*Ch[T]*Rh)/(R*C[T]), k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d2], kh[a1] = kh[a1], kh[a2] = kh[a2], kh[d1] = -(k[d1]*x[2]-k[d1]*xh[1]-k[d1]*xh[2]-k[d2]*x[2]+kh[d2]*xh[2])/xh[1], kh[d2] = kh[d2], x[1] = -x[2]+xh[1]+xh[2], x[2] = x[2], xh[1] = xh[1], xh[2] = xh[2]},{...},{...}]

i.e. they will show that there are multiple relationships that satisfy the Lie derivative conditions (each relationship is in a seperate set within the list) and within each set some parameters can vary freely (like R and Rh in the above) and others are determined by the ones that vary freely (like k[a1] and kh[a2]).
 
I want to count the numbers of parameters that have their relationships determined in three different ways so i can plot these numbers as the numbers of both types of Lie-Derivatives vary. These numbers are:
 

  1. N_i number of identifiabile parameters; parameters that in all solutions are of the form {p=ph or ph=p}
  2. N_l number of locally identifiable parameters; parameters that in all solutions take either the form {p=ph or ph=p} or {p=some function of the parameters with hs at the end of their names or ph=some function of exclusively the parameters without hs at the end of their names}
  3. N_u number of unidentifiable parameters; parameters that are neither identifiable or n locally-identifiable. 

    I think its nice to have a link to a worksheet at the end of a question, so here_it_is_again.

Acknowledgement: most of the code in the above was based on snippets written by @Carl Love in response to my previous questions.

EDIT: I had some teaching to do, so uploaded the question early as i was writing in a computer room- as a result the maple worksheet I originally included was confusing, the worksheet I've included in this edit is much easier to understand.

TLDR: i am looking a way to count the numbers of outputs of various types from a program that is built around maples solve feature, and stuck

prove that

∇ x (∅F) = ∅∇ x F + (∇∅) x F

where ∅ and F are differentiable scalar function and vector function respectively.

When a child proc calls a parent local proc using parent_module:-parent_proc(), Maple gives an error. But when the child calls the parent local proc using just parent_proc() it works. Why is that?

parent_module:=module()
 
 local child_module;
 local parent_proc;

 export parent_entry;

 child_module:= module()
    export child_entry; 
    child_entry :=proc()
     #parent_module:-parent_proc(); #this fails
     parent_proc(); #this works
    end proc;
  end module;

 #local
 parent_proc :=proc()
   print("insider parent proc");
 end proc;

 #public
 parent_entry :=proc()
   child_module:-child_entry();
 end proc;
end module;

parent_module:-parent_entry();
              "insider parent proc"

but the other way, (the commented code above) gives

parent_module:-parent_entry();
Error, (in child_entry) module does not export `parent_proc`

 

Hello there!
I was wondering if there is a way we can skip one or more variables from LSSolve to be optimized on a specific value?

For exmaple, please see the following file


 

restart; with(Optimization)

[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, NLPSolve, QPSolve]

(1)

LSSolve([x-1, y-1, z-1], {-10 <= x, x <= 0, 6*x+3*y <= 1}, initialpoint = {x = -1, y = 1})

[.711111111111111138, [x = HFloat(-0.06666666666666665), y = HFloat(0.46666666666666656), z = HFloat(1.0)]]

(2)
 

 

 

 

 

``


Can I skip the value of x and just find a global minimum of the objective functions over the given range of x, not just the specific value?  Its because I need to keep x as a variable.

Download LSSOLVEparameter.mw

Bisection := proc (f, a, b, delta)

local startpoint, endpoint, midpoint; startpoint := a; endpoint := b;

do midpoint := (1/2)*startpoint+(1/2)*endpoint;

if abs(startpoint-endpoint) < delta or abs(f(midpoint)) < delta then

return midpoint

elif f(midpoint) < 0 then endpoint := midpoint

elif 0 < f(midpoint) then startpoint := midpoint

end if end do end proc

 

I'm trying to do a procedure for bisection method but it doesnt give me answer when  I type 

Bisection (x-> x + 0.001 , 1, -1, 0.001 )

it returns Bisection (x-> x + 0.001 , 1, -1, 0.001 )

why this is happening, Is it because the procedure is wrong ? or does not provide answer 

What is the difference between a divisor and a factor? Like:

with(numtheory):

X := 89733992396903316277681863138688595394562888838833;

S := map(expand, [op(ifactor(X))]):

And we have the singleton of unity for the output of:

divisors(X/(product(S[j], j = 1 .. nops(S))));

and so on:

seq(divisors(X/(product(S[j], j = 1 .. nops(S)-k))), k = 0 .. 3);

but yet if i try

divisors(X);

my computer freezes.

So yes although my friend is somewhat embarassed to not know the difference and needed me to ask for him what the difference between a divisor and a factor is. 

 

Like is it just the uniqueness? ie a factor is one of the terms in the product of a number's prime factorization, where as any number that divides the number is considered to be a divisor?

like for example i can then go:

seq(min(`minus`(divisors(X/(product(S[j], j = 1 .. nops(S)-k))), {1})), k = 1 .. 10);

X:=X/(131*(139*(151*(163*(173*167)*157)*149)*137)*127)

from the first 10 terms reducing it original number substantially to:

 17026820583257598495326242577

and carry this on i dont see why i cant end up with the divisor set that caused my computer to freeze if i just called divisors(X) as I originally did

 


 

https://www.youtube.com/watch?v=qSO2lLiDybg

with(numtheory):

X := 89733992396903316277681863138688595394562888838833;

89733992396903316277681863138688595394562888838833

(1)

S0 := map(expand, [op(ifactor(X))]);

[31, 47, 59, 61, 67, 71, 73, 79, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173]

(2)

P := convert([seq(min(`minus`(divisors(X/(product(S0[j], j = 1 .. nops(S0)-k))), {1})), k = 1 .. 15)], '`*`');

72255473008151934648648475807453

(3)

S1 := divisors(X/P):

seq(`mod`(X, S1[k]), k = 1 .. nops(S1))

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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