MaplePrimes Questions

Let us consider the maximum value of the polynomial

x^4+c*x^2+x^3+d*x-c-1

on the interval x=-1..1 as a function g of the parameters c and d. General considerations suggest its continuity. However, a plot3d of g does not  confirm it.  Also the question arises "Is the function g(c,d) bounded from below?". Here is my try with the DirectSearch and NLPSolve:

 

restart;
``

g(10, -10)

9.

(1)

plot(x^4+x^3+10*x^2-10*x-10-1, x = -1 .. 1)

 

plot3d(g, -5 .. 5, -5 .. 5, grid = [100, 100], style = surface, color = "DarkOliveGreen")

 

DirectSearch:-GlobalOptima(proc (a, b) options operator, arrow; g(a, b) end proc, {a = -1000 .. 1000, b = -1000 .. 1000}, variables = [a, b])

[-167.208333252089, Vector(2, {(1) = 999.9999999975528, (2) = 166.20833325208952}, datatype = float[8]), 815]

(2)

DirectSearch:-GlobalOptima( (a, b) -> g(a, b), variables = [a, b])

DirectSearch:-GlobalOptima(proc (a, b) options operator, arrow; g(a, b) end proc, variables = [a, b])

Error, (in Optimization:-NLPSolve) invalid input: PolynomialTools:-CoefficientVector expects its 1st argument, poly, to be of type polynom(anything, x), but received HFloat(HFloat(undefined))*x^4+HFloat(HFloat(undefined))*x^3+HFloat(HFloat(undefined))*x^2+HFloat(HFloat(undefined))*x+HFloat(HFloat(undefined))

 

``

 

Download bound.mw

 

Hello

I am trying to slve the second order differential equation with initial conditions  t0=0.dy/dt=0,y0=10000

-(diff(y, t, t))-9.81+0.563e-3*(0.1832e-2*abs(diff(y, t))+0.51702e-1*abs(diff(y, t))^(3/2)+.4*(diff(y, t))^2) = 0

using 4th order runge kutta.do i need to declare a step parameter like (D(y))(t) = u or is a command that can be applied automatically?

Thanks

 rk4.mw

>nombor1:=[4,6,2];

nombor1:=[4,6,2]

 

Hi, anyone know hot i need to continue my command to get 462 from [4,6,2]?

Thank you~=]]

I have an equation for r(t) that involves 3 (slidable) constants; an equation for phi(t) that involves the same three constants and is written in terms of arctan; theta is a slidable constant. How do I plot this on an x,y,z plot? I want an animation in terms of t.

>mylist:=462;

mylist:=462

>kekuncirahsia:=proc(n) local c,d,r,sum; c:=n; while (c>9) do sum:=0; d:=c; while (d>9) do r:=irem(d,10); sum:=sum+r; d:=iquo(d,10);od; c:=sum+d;print(c);od;end;

>kekuncirahsia(mylist);

12

3

 

Hi, anyone know how i need to write my command to get this >> kekuncirahsiafinal:=3

I just want it to print the last digit..

Thank you~=]]

>mylist:=468;

mylist:=468

 

Hi, how i need to continue my command to get [4,6,8] from 468?

Thank you~=]]

>teksbiasa:=`Kriptografi`;

teksbiasa:=Kriptografi

>nilaiASCI:=convert(teksbiasa,bytes);

nilaiASCII:=[75,114,105,112,116,111,103,114,97,102,105]

>kekuncirahsia:=3;

kekuncirahsia:=3

 

Hi, anyone know how i need to continue my command to add in kekuncirahsia(3) into nilaiASCII?
What i want to get>>[78,117,108,115,119,115,106,117,100,105,108]

Thank you, Have a nice day~=]]

Experts.

When I subtract (in base 10) 235 (octal digits) from its reverse I get  [-1,-1,2]. converting this list to number equals 189 (base 10)....divisible by 7. [I would think the list would be [9,8,1] ;

in wolfram alpha 532 base 8 - 235  base 8 = 189 base 10 ).

Converting 189 to octal yields 275. All this is done correctly in Maple.

Now when I add 275 base 8 to 572 (edit: not 575 as I had before) base 8 I should get 1067 base 8, but I don't....

for sure i've done something silly

octal.mw

Hello everyone, I recently learned how to plot vector fields using maple. So far, I know of two ways using VectorField(output = plot) and fieldplot3d(some_vectorfunction). My problem is that, it seems these two functions yield slightly different plots, fieldplot3d seems to give a more accurate depiction of the actual vector field, whereas the other function gives a similar ouput but in a more 'sloppy' form. Is this normal? Or am I doing something wrong?

Here are the two plots done by each function:

fieldplot3d:

Plot done by 'fieldplot3d' function.

VectorField(output = plot):

Plot done by 'VectorField(output = plot)' function.

Hello,

In a mechanical model, I would like to use the letter Psi. However, when I use it, i have a small issue with some index which disappear.

Here the code I put at the beginning of my worksheet to be able to use the Psi letter

constants:= ({constants} minus {Psi})[]:
`evalf/Psi`:= proc() end proc:
`evalf/constant/Psi`:= proc() end proc:
unprotect(Psi);


With the following code,

ChgtVariables:={seq(psi[i](t)=Psi[i](t)-gamma0(t),i=1..4)};

I obtain the following result:

 

The index with Psi has disappear.

However, if i use the code:

ChgtVariables:={seq(psi[i](t)=PSI[i](t)-gamma0(t),i=1..4)};

I obtain the following result:

There is no problem of index with PSI.

Do you have a idea why the index has disappeared ? How can I do to use the Psi letter with a index ?

PS: the code associated attached here:

Psi.mw

Thank you for your help

At here http://www.mapleprimes.com/questions/146604-How-To-Choose-The-Parameters-To-The, I posted my question and I got the answer. Now I have a new question, is there a program that can be solved for many equation with integers solutions. For example, the equation has the form sqrt(a x + b) = c x + d, sqrt(a x + b) - sqrt(c x + d) = k,...

With Mathematica, my code that solve the equation a x + b == Sqrt[c x + d]

ClearAll[a, b, c, d];
sol = x /. Solve[{a x + b == Sqrt[c x + d]} , x, Reals];
ClearAll[f];
(f[{a_, b_, c_, d_}] :=
Quiet@Check[And @@ (IntegerQ /@ #), False]) &[sol]
poss = Select[
Tuples[Range[1,
20], {4}], #[[1]] =!= 0 && #[[2]]^2 - #[[4]] =!= 0 &&
GCD[#[[1]], #[[3]], #[[2]], #[[4]]] == 1 && f[#] &];
Take[poss, Length[poss]];
With[{s = sol},
getSolution[poss_] := Block[{a, b, c, d}, {a, b, c, d} = poss;
Join[poss, s]]]
getSolution /@ poss

 

When I repair  a x + b == Sqrt[c x + d] into Sqrt[a x + b] + Sqrt[c x + d] == k, then I have a new propram, or if I replace into Sqrt[a x + b] - Sqrt[c x + d] == k, I  have also a new program. How can I do like that with Maple?

 

how to  force a dsolve to timeout since it run a very long time

 

how to be like python set timeout then stop the function, in here , is dsolver

j = 1
for functionlistelement in functionlist0
tesks.append(asyncio.ensure_future(mappedfunc.get(functionlistelement)()))
if j > 1:
workingthreadpool(functionlistelement)
j = j + 1

loop.run_until_complete(asyncio.wait_for(tesks, 1))
loop.close()

Is there a way to plot critical values of the Pearson Correlation Coefficient r?  See attached worksheet.  Thanks!

Les    ect4_critical_value_of_r.mw

Maple does not solve the equation: 

-144*z-44+12*sqrt(-12*z^3+96*z^2+24*z-15) using the solve command. I am writting exactly

 

solve(-144*z-44+12*sqrt(-12*z^3+96*z^2+24*z-15=0)) and it does nothing. Do you have any idea for why that happens?

 

Thank you in advance for your time

Hello,

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the Rank function of the LinearAlgebra can be used for this purpose. However, when I use this function, the function doesn't allow to find the different singularities that can occur on my jacobian matrix.

Here a exemple of a jacobian matrix that I obtain on a slidercrank mechanism:

Phi := Matrix(2, 3, {(1, 1) = -l1*sin(theta(t)), (1, 2) = -1, (1, 3) = l2*cos(beta(t)), (2, 1) = l1*cos(theta(t)), (2, 2) = 0, (2, 3) = l2*sin(beta(t))})

The rank of this jaobian (Phi) gives 2 whatever the values of theta(t) and beta(t). However, if the values of  theta(t) and beta(t) are :theta(t)=Pi/2,beta(t)=0. The rank shouldn't be 2 but 1.

Is a way to obtain the symbolic calculation of the rank of a jacobian matrix which can distinguish different cases following the values of the parameters ? In others words, my dream will be to have a Rank function (or another algorithm) which can gives :
the rank is 2 if theta(t) different of Pi/2 [Pi] and beta(t)=0 [Pi] 
and otherwise 1 if ...
and perhaps 0 if ...

Thanks a lot for your help.

I let a piece of code with an example of calculation of the rank

RankMatrix.mw

First 1143 1144 1145 1146 1147 1148 1149 Last Page 1145 of 2428