MaplePrimes Questions

When creating my account I was asked what type of user I am. Academic,Commercial, Government or Student.  None of those applies to me but I had to pick one.  Might I suggest a "catch all" category?  Something like "Ordinary, average guy" who just happens to like your software.

Happy New Year.👍

The goal is to eliminate x, y and z from [a^2=(4*y*z)/((x+y)*(x+z)),b^2=(4*z*x)/((y+z)*(y+x)),c^2=(4*x*y)/((z+x)*(z+y))]. However, eliminate only outputs a null expression (I added a  to emphasize it): 

restart;
expr := 4*[y*z/((x + y)*(x + z)), z*x/((y + z)*(y + x)), x*y/((z + x)*(z + y))]:
{eliminate}([a, b, c]**~2 =~ expr, [x, y, z]);
 = 
                               {}

Why is the result empty? 
In my view, the result should be (a*b*c)**2 = ((a**2 + b**2 + c**2) - 2**2)**2 (or its equivalent). One may verify this by: 

seq(seq(seq(
    is(eval((a^2 + b^2 + c^2 - 4)^2 = (a*b*c)^2, 
      elementwise([a, b, c] = [k1, k2, k3]*sqrt(expr)))), 
    `in`(k3, [-1, +1])), `in`(k2, [-1, +1])), `in`(k1, [-1, +1]));
 = 
         true, true, true, true, true, true, true, true

I’ve spent considerable effort trying to understand how the solution was derived, particularly the approach involving the factoring of G′/G. Despite my attempts, the methodology remains elusive. It seems there’s an innovative idea at play here—something beyond the techniques we’ve applied in similar problems before. While I suspect it involves a novel perspective, I can’t quite pinpoint what it might be.

If anyone has insights into how this factoring is achieved or can shed light on the underlying idea, I’d greatly appreciate your help.


 

restart

with(PDEtools)

with(LinearAlgebra)

with(Physics)

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

_local(gamma)

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

 

declare(Omega(x, t)); declare(U(xi)); declare(u(x, y, z, t)); declare(Q(xi)); declare(V(xi))

Omega(x, t)*`will now be displayed as`*Omega

 

U(xi)*`will now be displayed as`*U

 

u(x, y, z, t)*`will now be displayed as`*u

 

Q(xi)*`will now be displayed as`*Q

 

V(xi)*`will now be displayed as`*V

(2)

``

ode := (-V*a[2]+a[1])*(diff(diff(U(xi), xi), xi))+U(xi)*(((-gamma+sigma)*k+b)*U(xi)^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(-V*a[2]+a[1])*(diff(diff(U(xi), xi), xi))+U(xi)*(((-gamma+sigma)*k+b)*U(xi)^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(3)

F := sum(c[i]*(m+(diff(G(xi), xi))/G(xi))^i, i = -1 .. 1)

c[-1]/(m+(diff(G(xi), xi))/G(xi))+c[0]+c[1]*(m+(diff(G(xi), xi))/G(xi))

(4)

D1 := diff(F, xi)

-c[-1]*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)

(5)

S := diff(G(xi), `$`(xi, 2)) = -(2*m*mu+lambda)*(diff(G(xi), xi))-mu

diff(diff(G(xi), xi), xi) = -(2*m*mu+lambda)*(diff(G(xi), xi))-mu

(6)

E1 := subs(S, D1)

-c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)

(7)

D2 := diff(E1, xi)

2*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^3-c[-1]*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)

(8)

E2 := subs(S, D2)

2*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2/(m+(diff(G(xi), xi))/G(xi))^3-c[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)

(9)

D3 := diff(E2, xi)

-6*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^4+4*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^3+2*c[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^3-c[-1]*((2*m*mu+lambda)^2*(diff(diff(G(xi), xi), xi))/G(xi)+(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+3*(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))*(diff(G(xi), xi))/G(xi)^2+6*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(diff(G(xi), xi), xi))/G(xi)^2+6*(diff(G(xi), xi))^2*(diff(diff(G(xi), xi), xi))/G(xi)^3-6*(diff(G(xi), xi))^4/G(xi)^4)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*((2*m*mu+lambda)^2*(diff(diff(G(xi), xi), xi))/G(xi)+(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+3*(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))*(diff(G(xi), xi))/G(xi)^2+6*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(diff(G(xi), xi), xi))/G(xi)^2+6*(diff(G(xi), xi))^2*(diff(diff(G(xi), xi), xi))/G(xi)^3-6*(diff(G(xi), xi))^4/G(xi)^4)

(10)

E3 := subs(S, D3)

-6*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^3/(m+(diff(G(xi), xi))/G(xi))^4+6*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^3-c[-1]*((2*m*mu+lambda)^2*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)+4*(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+12*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)^2/G(xi)^2-6*(diff(G(xi), xi))^4/G(xi)^4)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*((2*m*mu+lambda)^2*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)+4*(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+12*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)^2/G(xi)^2-6*(diff(G(xi), xi))^4/G(xi)^4)

(11)

``

NULL

K := U(xi) = F

K1 := diff(U(xi), xi) = E1

K2 := diff(U(xi), `$`(xi, 2)) = E2

K3 := diff(U(xi), `$`(xi, 3)) = E3

``

L := eval(ode, {K, K1, K2, K3})

(-V*a[2]+a[1])*(2*c[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2/(m+(diff(G(xi), xi))/G(xi))^3-c[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+c[1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3))+(c[-1]/(m+(diff(G(xi), xi))/G(xi))+c[0]+c[1]*(m+(diff(G(xi), xi))/G(xi)))*(((-gamma+sigma)*k+b)*(c[-1]/(m+(diff(G(xi), xi))/G(xi))+c[0]+c[1]*(m+(diff(G(xi), xi))/G(xi)))^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(12)

NULL

# rewritting rule

RR := isolate(m+diff(G(xi), xi)/(G(xi))=Phi, diff(G(xi), xi)/G(xi));

(diff(G(xi), xi))/G(xi) = Phi-m

(13)

# Apply RR and collect wrt Phi

subs(RR, L):
normal(%):
PhiN := collect(numer(lhs(%)), phi):
PhiD := denom(lhs(%%));

Phi^3*G(xi)^4

(14)



with(LargeExpressions):

LLE := collect(PhiN, Phi, Veil[phi] ):
LLE / PhiD = 0;

(Phi^6*phi[1]+3*Phi^5*phi[2]-Phi^4*phi[3]-Phi^3*phi[4]-Phi^2*phi[5]+Phi*phi[6]-phi[7])/(Phi^3*G(xi)^4) = 0

(15)

# phi[i] coefficients


phis := [ seq( phi[i] = simplify(Unveil[phi](phi[i]), size), i=1..LastUsed[phi] ) ]:

print~( phis ):

phi[1] = c[1]^3*G(xi)^4*((-gamma+sigma)*k+b)

 

phi[2] = c[0]*G(xi)^4*c[1]^2*((-gamma+sigma)*k+b)

 

phi[3] = -3*G(xi)^4*c[1]*(-(1/3)*a[1]*k^2+(-c[-1]*(gamma-sigma)*c[1]+(-gamma+sigma)*c[0]^2+(1/3)*w*a[2]-(1/3)*alpha)*k+b*c[-1]*c[1]+b*c[0]^2-(1/3)*w)

 

phi[4] = G(xi)*(2*c[1]*(V*a[2]-a[1])*(diff(G(xi), xi))^3+3*c[1]*G(xi)*(2*m*mu+lambda)*(V*a[2]-a[1])*(diff(G(xi), xi))^2+((2*m*mu+lambda)^2*G(xi)+3*mu)*(V*a[2]-a[1])*G(xi)*c[1]*(diff(G(xi), xi))+G(xi)^2*(-c[0]*(6*c[-1]*((-gamma+sigma)*k+b)*c[1]-a[1]*k^2+k*w*a[2]+((-gamma+sigma)*k+b)*c[0]^2-k*alpha-w)*G(xi)+c[1]*mu*(2*m*mu+lambda)*(V*a[2]-a[1])))

 

phi[5] = -3*G(xi)^4*(-(1/3)*a[1]*k^2+(-c[-1]*(gamma-sigma)*c[1]+(-gamma+sigma)*c[0]^2+(1/3)*w*a[2]-(1/3)*alpha)*k+b*c[-1]*c[1]+b*c[0]^2-(1/3)*w)*c[-1]

 

phi[6] = 4*c[-1]*((1/2)*(V*a[2]-a[1])*(diff(G(xi), xi))^3+(3/2)*(m*mu+(1/2)*lambda)*(V*a[2]-a[1])*G(xi)*(diff(G(xi), xi))^2+(V*a[2]-a[1])*((m*mu+(1/2)*lambda)^2*G(xi)+(3/4)*mu)*G(xi)*(diff(G(xi), xi))+(1/2)*G(xi)^2*((3/2)*c[-1]*((-gamma+sigma)*k+b)*c[0]*G(xi)+(m*mu+(1/2)*lambda)*(V*a[2]-a[1])*mu))*G(xi)

 

phi[7] = 8*((1/4)*(V*a[2]-a[1])*(diff(G(xi), xi))^4+(V*a[2]-a[1])*G(xi)*(m*mu+(1/2)*lambda)*(diff(G(xi), xi))^3+(V*a[2]-a[1])*G(xi)*((m*mu+(1/2)*lambda)^2*G(xi)+(1/2)*mu)*(diff(G(xi), xi))^2+(V*a[2]-a[1])*G(xi)^2*(m*mu+(1/2)*lambda)*mu*(diff(G(xi), xi))+(1/4)*G(xi)^2*(-(1/2)*((-gamma+sigma)*k+b)*c[-1]^2*G(xi)^2+mu^2*(V*a[2]-a[1])))*c[-1]

(16)

# WATCHOUT: you have 9 coefficients and so its desirable to have the same number of unknowns

unknowns := indets(rhs~(phis), name);

COEFFS := solve(rhs~(phis), unknowns)

{V, alpha, b, gamma, k, lambda, m, mu, sigma, w, xi, a[1], a[2], c[-1], c[0], c[1]}

 

Error, (in solve) cannot solve expressions with diff(G(xi),xi) for xi

 

NULL

case1 := COEFFS[4]

{alpha = alpha, beta = gamma, delta = delta, gamma = gamma, k = k, lambda = 0, m = 2*n, mu = mu, n = n, sigma = 32*alpha*mu^2*n^4/a[-1]^2, w = -2*alpha*k^2*n-4*alpha*mu^2*n+delta^2, a[-1] = a[-1], a[0] = 0, a[1] = 0}

(17)

NULL

F1 := subs(case1, F)

a[-1]/(2*n+1/(diff(G(xi), xi)))

(18)

F2 := subs(case1, ode)

128*V(xi)^4*n^6*alpha*mu^2/a[-1]^2+(16*alpha*k^2*n^4-8*delta^2*n^3+8*n^3*(-2*alpha*k^2*n-4*alpha*mu^2*n+delta^2))*V(xi)^2-4*V(xi)*(diff(diff(V(xi), xi), xi))*alpha*n^2 = 0

(19)

W := V(xi) = F1

V(xi) = a[-1]/(2*n+1/(diff(G(xi), xi)))

(20)

NULL

E := diff(G(xi), xi) = -(-2*m*mu-lambda)*exp(-(2*m*mu+lambda)*xi)*c__1/(2*m*mu+lambda)-mu/(2*m*mu+lambda)

diff(G(xi), xi) = -(-2*m*mu-lambda)*exp(-(2*m*mu+lambda)*xi)*c__1/(2*m*mu+lambda)-mu/(2*m*mu+lambda)

(21)

W1 := subs(E, W)

V(xi) = a[-1]/(2*n+1/(-(-2*m*mu-lambda)*exp(-(2*m*mu+lambda)*xi)*c__1/(2*m*mu+lambda)-mu/(2*m*mu+lambda)))

(22)

W2 := subs(case1, W1)

V(xi) = a[-1]/(2*n+1/(exp(-4*mu*n*xi)*c__1-(1/4)/n))

(23)

W3 := rhs(V(xi) = a[-1]/(2*n+1/(exp(-4*mu*n*xi)*c__1-(1/4)/n)))

a[-1]/(2*n+1/(exp(-4*mu*n*xi)*c__1-(1/4)/n))

(24)

W4 := convert(W3, trig)

a[-1]/(2*n+1/((cosh(4*mu*n*xi)-sinh(4*mu*n*xi))*c__1-(1/4)/n))

(25)

W5 := W4

a[-1]/(2*n+1/((cosh(4*mu*n*xi)-sinh(4*mu*n*xi))*c__1-(1/4)/n))

(26)

odetest(W2, F2)

0

(27)
 

``

Download problem99.mw

This is probaby more of a software request and I think it would be useful. 

You can obviously open two worksheets of maple and tile them vertically to give the effect of a split screen but then all the icons of each worksheet reduce the visible on screen real estate in which you can work.

It should work similar to how Excel does it when you split cells.  It would work nicely in situations where you have a diagram or picture you are referring to during the creation of your worksheet. 

Anyways just a request, I'm sure some people would find that functionality welcome. 

I have a global matrix with a default value set in a module. I also need the inverse of the matrix. Can the module do this?  I don't really want to have to get routines to calculate the inverse every time they are called.

restart

``

TM := module () local invMetric; export foo, bar; global Metric;  Metric := Matrix(3, shape = symmetric, [[1, 0, 0], [0, 1, 0], [0, 0, 1]]); invMetric := LinearAlgebra:-MatrixInverse(rtable_eval(Metric, 'inplace')); foo := proc () print('Metric' = Metric) end proc; bar := proc () print('invMetric' = invMetric) end proc end module

_m2278573910560

(1)

TM:-foo()

Metric = Matrix(%id = 36893490426002737860)

(2)

TM:-bar()

invMetric = Matrix(%id = 36893490426002738460)

(3)

Metric := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -2})

Matrix(%id = 36893490426002715820)

(4)

TM:-foo()

Metric = Matrix(%id = 36893490426002715820)

(5)

TM:-bar()

invMetric = Matrix(%id = 36893490426002738460)

(6)

NULL

Download 2024-12-30_Q_Module_Global_and_Local.mw

Hello 

I have a 3D vector plot with 3 vectors. It would be nice to have a legend for this, but so far, I have struggled to find a solution.

At the moment, I use a caption for this, but I am not fully happy with this.legend_question.mw 

Is there a simple solution?

Thanks in advance 

In the attached model I have tried (among other things) to simulate a disk pendulum without friction.

The simulation shows bouncing and angular lock.

There are also 3 warnings and an initialization problem that I could not fix.

How can the model be improved?

Disk_pendulum.msim

P.S.:

Rolling without friction worked fine here.

This time domain diagram has been drawn, but if you want to draw its outer outline, how should you command it?
saopinjifen1230.mw

 

Is there an easy way to convert a maple worksheet to a command line .mpl file to be executed from command line?

Basically strips all the comments and just keep the commands.in the .mpl file.

The exports in the Maple interface do not produce command line executable code.

It is ok if there is a third party script also to do this.

When I attempt to solve for a specific parameter in Maple, it results in an error stating that the parameter does not exist. However, if I solve for all parameters, it successfully finds them, as shown in the figure. How can I resolve this issue?

parameter.mw

Hi

Following on from this question, https://www.mapleprimes.com/questions/200909-Roster-Choose-Teams
I wanted to create the sequence for n>3 teams, where n:: even and two byes.
Currently, my AI-modified code produces the wrong output, can someone modify it?

# Example usage with 8 teams and 2 byes
PrintPairings(8); 

Round 1:
  1 vs 2
  3 vs 4
  5 sits out
  8 sits out
....
:Round_Robin.mw
It should be
Round 1:
  1 vs 2
  3 vs 4
  5 vs 6
  7 sits out
  8 sits out
......
etc

I use this type ckect elsewhere inside a package and it works. I can't get it to work in a stand alone procedure.

This was originally provided by @acer (best answer) in this question Experimental format for projective vectors - MaplePrimes

restart

 

 

test:=proc(V::{And('Vector(1)',satisfies( v->type(v[1],'Vector[:-column](3)') ) ),
               And('Vector(1)',satisfies( v->type(v[1],'Vector[:-row](3)') ) )})
print("works",V);
end proc

proc (V::{And('Vector(1)', satisfies(proc (v) options operator, arrow; type(v[1], 'Vector[:-column](3)') end proc)), And('Vector(1)', satisfies(proc (v) options operator, arrow; type(v[1], 'Vector[:-row](3)') end proc))}) print("works", V) end proc

(1)

v1:=<[<1,3,2>]>;
v2:=<[<a|b|c>]>

Vector(1, {(1) = Vector(3, {(1) = 1, (2) = 3, (3) = 2})})

 

Vector[column](%id = 36893490573309309044)

(2)

test(v1)

Error, invalid input: test expects its 1st argument, V, to be of type {And('Vector[1]',satisfies(v -> type(v[1],'Vector[:-column](3)'))), And('Vector[1]',satisfies(v -> type(v[1],'Vector[:-row](3)')))}, but received Vector(1, [Vector(3, [1,3,2])])

 

test(v2)

Error, invalid input: test expects its 1st argument, V, to be of type {And('Vector[1]',satisfies(v -> type(v[1],'Vector[:-column](3)'))), And('Vector[1]',satisfies(v -> type(v[1],'Vector[:-row](3)')))}, but received Vector(1, [Vector[row](3, [a,b,c])])

 

whattype(v1)

Vector[column]

(3)

whattype(v1[1])

Vector[column]

(4)

whattype(v2)

Vector[column]

(5)

whattype(v2[1])

Vector[row]

(6)
 

 

Download 2024-12-29_Q_Type_checking_not_working.mw

A street of finite length has many houses on one side, which are numbered in consecutive order with 1, 2, 3, 4, ... Determine all house numbers where the sum of all house numbers before this house number is equal to the sum of all house numbers after it.

That's enough for this year.
I wish everyone a happy new year 2025.

Relative path does not seems to work on Linux.
 e.g. consider the read command
 `read  "/home/harpo/skits/slapstick/boguscalculus.mw"

At the moment I have to enter the full path above as stated to be able to read in "boguscalculus.mw"

This highly unfortunte, as generally you want to specify a path, independent of the home path.

That would mean

read "~/skits/slapstick/boguscalculus.mw"   , but this does not work. Any idea why ?

Furthermore using "currentdir" to set the current directory, I also have to use the full path from root "\" which is highly unusual.

Lastly given that I set a current directory with currentdir, how do I use the currentdir to read a file inside currentdir with read command ?

e.g.

currentdir "/home/harpo/skits"
how do I read the file in a worksheet using from the  currentdir

e.g. it should be

read "slapstick/boguscalculus.mw"

But that doesnt work either.

Given 4 hummingbirds, each located at the vertex of a unit tetrahedron.
The birds begin to fly in such a way that all birds fly at the same speed and:
(1) Bird #1 always flies directly toward bird #2
(2) Bird #2 always flies directly toward bird #3
(3) Bird #3 always flies directly toward bird #4
(4) Bird #4 always flies directly toward bird #1
As one can imagine, the flying birds eventually meet and collide. (Assume the birds are very small.)

What is needed is the distance to the collision point of the hummingbirds.

First 42 43 44 45 46 47 48 Last Page 44 of 2425