Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

In the attached file I would like to use the functions "Gradient" and "Hessian". Hessian should also calculate the determinant and check positive definiteness. I was unable to do that. Other questions for me as a beginner are:
How are the long brackets and the > sign on the left edge created? What does a semicolon at the end of the command mean? How is a 3D plot created? What does "restart" mean?

Regards, Alfred_FAF_20240831.mwAF_20240831.mw

 In the calculation process, I selected (num=5). How can I detect the maximum value of num to ensure the series solution would be converged?

seried.mw

If there any way to make text  parallel to a line in textplot3d.

display(line([1,2,3],[4,5,-2],linestyle=longdash),
        point([2.5,3.5,0.5]),
        textplot3d([2.5,3.5,0.5,"not aligned"]))

I know to ways:

- calling the returned procedure with a value for the independend variable

- printing the procedure with interface(verboseproc=2)

The first requires a procedure and a values that work, the second is quite some typing.

Any other ways?

 

Update Nov 2024:
The option output = listprocedure provides a way.

Is one not supposed to make _Z local variable?  If not, then how to insure the global _Z do not have some value assigned to it?

In this example below, I build some integral. I used local _Z for upport limit. But now Maple generate internal error.

If I do not declare _Z as local, and leave it global, then no error is generated.

But if I also declare _Z inside the proc as global _Z, then the error also goes away.

So is one always supposed to use _Z as global? 

The strange thing _Z is protected, so I cant assign to it value from global space. Message says Try declaring `local _Z`; see ?protect for details. but when I do that, I still get an error. 

So is the bottom line here is that one should not declare _Z local to a proc, and just assume it is always global symbol that has no assigned value to it, and that will always be safe to do?  I do not assign value to _Z inside my proc. Just wanted to use it for upper limit, as symbol.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

foo:=proc()
 local _Z;
 local F,G,H,n;
 F:=x;G:=x;G:=x;n:=4;
 -RootOf(Intat(F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)/(-
         tau*F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)+F^(-n-1)*H^(-2*n+1)*(-G*F
         *n*H)^n*n^(-n)+tau^n),tau = _Z)-Int(-G,x)+C1)/G*H;
end proc:

foo()

Error, (in RootOf) expression independent of, _Z

boo:=proc()
 local F,G,H,n;
 F:=x;G:=x;G:=x;n:=4;
 -RootOf(Intat(F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)/(-
         tau*F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)+F^(-n-1)*H^(-2*n+1)*(-G*F
         *n*H)^n*n^(-n)+tau^n),tau = _Z)-Int(-G,x)+C1)/G*H;
end proc:

boo();

-RootOf(Intat(x^3/(H^3*tau^4-tau*x^3+x^3), tau = _Z)-(Int(-x, x))+C1)*H/x

boo2:=proc()
 global _Z;
 local F,G,H,n;
 F:=x;G:=x;G:=x;n:=4;
 -RootOf(Intat(F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)/(-
         tau*F^(-n-1)*H^(-2*n+1)*(-G*F*n*H)^n*n^(-n)+F^(-n-1)*H^(-2*n+1)*(-G*F
         *n*H)^n*n^(-n)+tau^n),tau = _Z)-Int(-G,x)+C1)/G*H;
end proc:

boo2()

-RootOf(Intat(x^3/(H^3*tau^4-tau*x^3+x^3), tau = _Z)-(Int(-x, x))+C1)*H/x

_Z:=5;

Error, attempting to assign to `_Z` which is protected.  Try declaring `local _Z`; see ?protect for details.

local _Z;
foo();

Warning, A new binding for the name `_Z` has been created. The global instance of this name is still accessible using the :- prefix, :-`_Z`.  See ?protect for details.

_Z

Error, (in RootOf) expression independent of, _Z

 

 

Download using_Z_inside_proc_august_28_2024.mw

For me this result is suspicious. What do you think? 

This ode diff(y(x),x) = f*y(x)^4+g*y(x)+h; is clearly quadrature, since I did not tell Maple that f,g,h depend on x. So this can be solved by just integration. But when asking odeadvisor if it is Chini, it says yes. When asking it what type it is, now it says it is quadrature.

Am I missing something here? I was expecting [NONE] when asking it if it is Chini.

Yes, the ode has the form of Chini, which is   y'=f(x)*y^n + g(x)*y + h(x), where n=4 here. But if f,g,h do not depend on x, then this is now just quadrature. Right? Calling it Chini is little misleading I think.

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1796 and is the same as the version installed in this computer, created 2024, August 29, 14:22 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

ode:=diff(y(x),x) = f*y(x)^4+g*y(x)+h;
DEtools:-odeadvisor(ode,y(x),[Chini]);

diff(y(x), x) = f*y(x)^4+g*y(x)+h

[_Chini]

DEtools:-odeadvisor(ode,y(x))

[_quadrature]

dsolve(ode,y(x),[quadrature]);

x-Intat(1/(_a^4*f+_a*g+h), _a = y(x))-c__1 = 0

dsolve(ode,y(x),[Chini]);

y(x) = -RootOf(Intat(g^4/(_a^4*f*h^3-_a*g^4+g^4), _a = _Z)+g*x+c__1)*h/g

 

 

Download question_on_advisor_august_28_2024.mw

Notice another problem in this solutions. If g=0, then the Chini solution gives divison by zero now, while the quadrature solution still works.

Dear All,

I am facing some problems. I want to draw some plots: I have considered the 4th order momentum equation and the 2nd order energy equation; it requires 6 boundary conditions, which I have provided, but till asking for errors (in dsolve/numeric/bvp/convertsys) too few boundary conditions: expected 7, got 6.

eqn1 := {((kappa[1].phi[1]+kappa[2].phi[2]+kappa[3].phi[3])/(phi[1]+phi[2]+phi[3])+(p-1).kappa[f]+(p-1).(kappa[1].phi[1]+kappa[2].phi[2]+kappa[3].phi[3])-(p-1).(phi[1]+phi[2]+phi[3]).kappa[f])/((kappa[1].phi[1]+kappa[2].phi[2]+kappa[3].phi[3])/(phi[1]+phi[2]+phi[3])+(p-1).kappa[f]-(p-1).(kappa[1].phi[1]+kappa[2].phi[2]+kappa[3].phi[3])+(phi[1]+phi[2]+phi[3]).kappa[f]).(diff(theta(eta), eta, eta)+4/3.N.(diff((1+(K-1).theta(eta))^3.(diff(theta(eta), eta)), eta)))+Pr.(((1-phi[3]).((1-phi[2])*(1-phi[1]+phi[1].(`ρc__s1`/`ρc__f`))+phi[2].(`ρc__s2`/`ρc__f`))+phi[3].(`ρc__s3`/`ρc__f`)).(R.f(eta)+alpha.eta).(diff(theta(eta), eta))+Q.theta(eta)+R.Ec.((diff(f(eta), eta, eta))^2)) = 0, diff(f(eta), eta, eta, eta, eta)-(1-phi[1])^2.5.((1-phi[2])^2.5).((1-phi[3])^2.5).((1-phi[3]).((1-phi[2]).(1-phi[1]+phi[1].(`ρ__s1`/`ρ__f`))+phi[2].(`ρ__s2`/`ρ__f`))+phi[3].(`ρ__s3`/`ρ__f`)).(alpha.(eta.(diff(f(eta), eta, eta, eta))+3.*(diff(f(eta), eta, eta)))+(diff(f(eta), eta, eta, eta)).f(eta)-(diff(f(eta), eta)).(diff(f(eta), eta, eta))).R-(1-phi[1])^2.5.((1-phi[2])^2.5).((1-phi[3])^2.5).A.B.e^(-B.eta) = 0, f(-1) = S, f(1) = 1, theta(-1) = 1, theta(1) = 0, (D(f))(-1) = 0, (D(f))(1) = 0}

sys1 := eval(eqn1, {A = 1, B = .5, Ec = .1, K = 1.5, N = .5, Pr = 2, Q = .4, R = 1, S = -.1, p = 3, alpha = .2, `ρ__f` = 997.1, `ρ__s1` = 0, `ρ__s2` = 0, `ρ__s3` = 5180, `ρc__f` = 997.1.4179, `ρc__s1` = 0, `ρc__s2` = 0, `ρc__s3` = 5180.670, phi[1] = 0., phi[2] = 0., phi[3] = 0.3e-1, kappa[1] = 0, kappa[2] = 0, kappa[3] = 9.7, kappa[f] = .613})

sol1 := dsolve(sys1, numeric);
Error, (in dsolve/numeric/bvp/convertsys) too few boundary conditions: expected 7, got 6
with(plots);
t1 := odeplot(sol1, [eta, diff(f(eta), eta)], eta = -1 .. 1, numpoints = 65, thickness = 0, color = green, linestyle = solid);
plots[plots:-display]({t1})

Download A1.mw

Dear all,

is there a versioning concept similiar to Eclipse ?

I did expect the following two plot statements (MaplePrimes is only rendering one statement) to produce the same plot. What did I do wrong when using mod in plot?

kernelopts(version)

`Maple 2024.1, X86 64 WINDOWS, Jun 25 2024, Build ID 1835466`

(1)

plot([seq([t, `mod`(t, 10)], t = 1 .. 100)])

 

plot(`mod`(t, 10), t = 0 .. 100)

 

NULL

Download mod_in_plot.mw

In my Maple 2020, I noticed my program got stuck (overnight so let's say for at least 8 hours) on factorization of relatively small integer, so I tried the command standalone:

ifactor(630743190664091077)

and it just froze. For comparsion I tried other SW and programming libraries and basically all of them had the answer instantly. Also looking at the Maple's methods, if I force pollard or lenstra, it also gets the answer instantly. If my understanding is correct, it gets stuck on the method 'morrbril' which is part of the default mix (I tried also mpqs and it gave FAIL, but at least instantly). 

Is that something that still happens by default in newer versions? Seems to me if it gets stuck on 18 decimal digit integer, maybe it's not the best default method...

This is another attempt to tell about one way to solve the problem of inverse kinematics of a manipulator.  
We have a flat three-link manipulator. Its movement is determined by changing three angles - these are three control parameters. 1. the first link rotates around the black fixed point, 2. the second link rotates around the extreme movable point of the first link, 3. the third link − around the last point of the second link. These movable points are red. (The order of the links is from thick to thin.) The working point is green. For example, we need it to move along a circle. But the manipulator has one extra mobility (degree of freedom), that is, the problem has an infinite number of solutions. We have the ability to remove this extra degree of freedom mathematically. And this can also be done in an infinite number of ways.
Let us give two examples where the same manipulator performs the same movement of the working point in different ways. In one case the last red point moves in a straight line, and in the other case it moves in an ellipse. The result is the same. In the corresponding program texts, the manipulator model is described by a system of nonlinear equations f1, f2, f3, f4, f5 relative to the coordinates of the ends of the links (very easy to understand). The specific additional connection that takes away one degree of freedom is highlighted in blue. Equation of a circle in red color.

1.mw

2.mw


And as an elective. The same circle was obtained using a spatial 3-link manipulator with 5 degrees of freedom. In the last text, blue and red colors perform the same functions as in the previous texts.
3.mw

 

restart;
with(geometry);
with(plots);
Bl := color = black;
y0 := x -> -ln(1 - exp(-x));
y0 := proc (x) options operator, arrow; -ln(1-exp(-x)) end proc

y1 := x -> -ln(-1 + exp(-x));
y1 := proc (x) options operator, arrow; -ln(-1+exp(-x)) end proc

y2 := x -> -ln(1 + exp(-x));
y2 := proc (x) options operator, arrow; -ln(1+exp(-x)) end proc

p := plot(y0(x), x = 0.02 .. 4, scaling = constrained, color = blue);
p1 := plot(y2(x), x = -4 .. 4, scaling = constrained, color = green);
p2 := plot(y1(x), x = -4 .. 0, scaling = constrained, color = red);
display({p, p1, p2}, view = [-4 .. 4, -4 .. 5]);
Calculate its area; Thank you.

Why Maple can not do this basic combining of two terms? What do  I need to do to help Maple do it? Am I not using the correct command?

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1795 and is the same as the version installed in this computer, created 2024, August 28, 23:14 hours Pacific Time.`

e:=B^2/(4*(k^n)^(2/3)) - (k^n)^(1/3)*x;

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e);

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,symbolic)

(1/4)*B^2*k^(-(2/3)*n)-k^((1/3)*n)*x

combine(e,power)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,radical)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e,radical,symbolic)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

combine(e) assuming positive;

(1/4)*B^2*k^(-(2/3)*n)-k^((1/3)*n)*x

combine(e,abs)

(1/4)*B^2/(k^n)^(2/3)-(k^n)^(1/3)*x

 

 

Download how_to_combine_august_28_2024.mw

For reference, using another software, this is what it gives

Is this valid:

Int(sqrt(x^2+sqrt(x^4+1))/(x+1)/sqrt(x^4+1),x=0..infinity) =
(1/8)*ln((52+36*2^(1/2))*(2+2*2^(1/2))^(1/2)+80*2^(1/2)+113)*(2+2*2^(1/2))^(1/2);

?

First 79 80 81 82 83 84 85 Last Page 81 of 2218