Items tagged with syntax

There is an error in my implementation as follow:

"Error, (in unknown) incorrect syntax in parse: `*` unexpected (near 1st character of parsed string)"

What I have to do to remove this error?

Tried different ways to apply unapply but failed:

a := .1994;

modfit3 := a*x^1.5;
f := unapply(rhs(modfit3), x);
Error, invalid input: rhs received .1994*x^1.5, which is not valid for its 1st argument, expr

What's wrong here?




I'm having some issues with this procedure it seems to take a very long time to evaluate. There is also an error in the Histogram I can't seem to fix... Does anybody know why? Any help would be greatly appreciated! Thank you in advance!

Kind regards,

Gambia man

Hello I am trying to plot this differential equation,  have not had any success can any one help me.

plot(q(t)= Ce^-1/2 + sin2t +cos4t)

not sure what i am doing wrong and i just used the plot command


after following a example , got error


               1   / d      \    1        2     2
               - m |--- x(t)|  - - m omega  x(t)
               2   \ dt     /    2              
Error, (in Mechanics:-LagrangeEqs) invalid input: subs received subst1, which is not valid for its 1st argument
Error, invalid input: Mechanics:-GeneralSol expects its 1st argument, eqs, to be of type list, but received eqs
Error, invalid input: rhs received sol, which is not valid for its 1st argument, expr


Mechanics := module()
export SetVariables, LagrangeEqs, GeneralSol;
option package;
local subst1, subst2, varN, t;

SetVariables = proc( vars:: list, time )
local i;
t := time;
varN := nops( vars );
subst1 := {};
subst2 := {};
for i from 1 to var N do
subst1 := subst1 union
{vars[i](t) = q[i], diff(vars[i](t), t) = v[i]};
subst2 := subst2 union
{q[i] = vars[i](t), v[i] = diff(vars[i](t), t)};
end do;
print( subst1 );
print( subst2 );
end proc;

LagrangeEqs := proc (L)
local i, l1, term1, term2;
l1 := subs(subst1, L):
for i to varN do
term1 := [seq(diff(subs(subst2, diff(l1, v[i])), t), i = 1..varN)]:
term2 := [seq(subs(subst2, diff(l1, q[i])), i = 1..varN)]:
end do;
[ seq(simplify(term1[i]-term2[i]) = 0, i = 1..varN) ];
end proc;

RayleighEqs := proc(L, R)
local i, l1, r1, term1, term2, term3;
l1 := subs( subst1, L ):
r1 := subs( subst1, R ):
for i from 1 to varN do
term1:=[seq(diff(subs(subst2, diff(l1, v[i])), t), i=1..varN)]:
term2:=[seq(subs(subst2, diff(l1, q[i])), i=1..varN)]:
term3:=[seq(subs(subst2, diff(r1, v[i])), i=1..varN)]:
end do:
[ seq(simplify(term1[i]-term2[i]+term3[i]), i=1..varN) ];
end proc;

LagrEqsII := proc( L, Q::list )
local i, l1, term1, term2;
l1 := subs(subst1, L):
for i to varN do
term1 := [seq(diff(subs(subst2, diff(l1, v[i])), t), i = 1 .. varN)]:
term2 := [seq(subs(subst2, diff(l1, q[i])), i = 1 .. varN)]:
end do;
[seq(simplify(term1[i]-term2[i]) = Q[i], i = 1 .. varN)];
end proc;

LagrEqsIII := proc (L, R, Q::list)
local i, l1, r1, term1, term2, term3;
l1 := subs(subst1, L):
r1 := subs(subst1, R):
for i to varN do
term1 := [seq(diff(subs(subst2, diff(l1, v[i])), t), i = 1 .. varN)]:
term2 := [seq(subs(subst2, diff(l1, q[i])), i = 1 .. varN)]:
term3 := [seq(subs(subst2, diff(r1, v[i])), i = 1 .. varN)]:
end do;
[seq(simplify(term1[i]-term2[i]+term3[i]) = Q[i], i = 1 .. varN)];
end proc;

GeneralSol := proc (eqs::list)
local i, initconds, eqs2;
initconds := NULL:
eqs2 := eqs[][]:
for i to varN do
initconds:=VarNames[i](0)=q[i], (D(VarNames[i]))(0)=v[i], initconds:
end do;
dsolve({initconds, eqs2});
end proc;

end module;

LibLocation := cat("c:\\Temp");
Save(Mechanics, LibLocation);
save(Mechanics, "c:\\Temp\\Mechanics.m");
read "c:\\Temp\\Mechanics.m";


SetVariables([x], t);
L := (1/2)*m*diff(x(t), t)^2 - (1/2)*m*omega^2 * x(t)^2;
eqs := LagrangeEqs(L);
sol := GeneralSol( eqs );
X := unapply( rhs(sol), t );




When I input an expression such as 3*(2*x-1)(x+1) > 0 into a Maple worksheet, Maple outputs this:

0 < 6*x(x+1)-3

(sorry, the formatter doesn't work for some reason).

I was wondering by which rules Maple determines to output that instead of, for example,

0 < 3(2*x^2+x-1)


0 < 6*x^2+3x-3


Also, Maple can't seem to be able to solve the inequality. It gives the following error to the command:

solve( { 3*(2*x-1)(1+x) > 0 } );

Error, (in solve) cannot solve for an unknown function with other operations in its arguments


So, I was wondering, is there a way to force Maple to output either in the most factorized form (which should be what I gave it as input) or in the least factorized form (that is, multiply it all)?

And, of course, why can't I solve the inequality with Maple?

i have to compute lie algebra condition by using maple 15, but currently i have code in maple 5.,

i already try to run in maple 15 but it say 'error,unable to match delimeters'
i try to find error, but i cant find it..
the coding are here...


local  i,j,k,l,m;  

for i from 1 by 1 to n do

for j from 1 by 1 to n do  

for k  from 1 by 1 to n do    

if A[i,i,k]<>0 then  

RETURN ('Input is NOT a Lie algebra (',i,i,k,')=',A[i,i,k], 'is not zero');  

elif A[i,j,k]+A[j,i,k]<>0 then  

RETURN ('Input is NOT a Lie algebra,(',i,j,k,')+(',j,i,k,')=',A[i,j,k]+A[j,i,k],'is not zero');  


for 1 from 1 by 1 to n do


simplify(sum(A[i,j,m]*A[m,l,k]+A[j,l,m]*A[m,i,k]+A[l,i,m]*A[m,j,k],   m=1..n))<>0  


RETURN('Input is NOT a Lie algebra---the Jac(',i,j,l,') is not zero');    







print('Yes,input IS a Lie algebra');  


can anyone help me here? Thank You..

Here, i attached the result in printscreen

Hi all,

I have this system

> system1D := H = alpha*gamma[2, 2]*d[2, 1]-beta*d[1, 2]*gamma[1, 2]^2-gamma*d[1, 2]*gamma[2, 1]^2+alpha*gamma[2, 2]^2*d[2, 2]-beta*d[2, 2]*gamma[2, 2]^2-gamma*d[2, 2]*gamma[2, 2]^2, E = alpha*gamma[2, 1]*d[1, 1]-beta*d[1, 2]*gamma[1, 1]-gamma*d[1, 1]*gamma[2, 1]+alpha*gamma[2, 1]^2*d[1, 2]-beta*d[2, 2]*gamma[2, 1]-gamma*d[2, 1]*gamma[2, 2], B = alpha*gamma[1, 1]*d[2, 1]-beta*d[1, 1]*gamma[1, 1]^2-gamma*d[1, 1]*gamma[1, 1]^2+alpha*gamma[1, 1]^2*d[2, 2]-beta*d[2, 1]*gamma[2, 1]^2-gamma*d[2, 1]*gamma[1, 2]^2, D = alpha*gamma[1, 2]*d[2, 1]-beta*d[1, 1]*gamma[1, 2]^2-gamma*d[1, 2]*gamma[1, 1]^2+alpha*gamma[1, 2]^2*d[2, 2]-beta*d[2, 1]*gamma[2, 2]^2-gamma*d[2, 2]*gamma[1, 2]^2, A = alpha*gamma[1, 1]*d[1, 1]-beta*d[1, 1]*gamma[1, 1]-gamma*d[1, 1]*gamma[1, 1]+alpha*gamma[1, 1]^2*d[1, 2]-beta*d[2, 1]*gamma[2, 1]-gamma*d[2, 1]*gamma[1, 2], C = alpha*gamma[1, 2]*d[1, 1]-beta*d[1, 1]*gamma[1, 2]-gamma*d[1, 2]*gamma[1, 1]+alpha*gamma[1, 2]^2*d[1, 2]-beta*d[2, 1]*gamma[2, 2]-gamma*d[2, 2]*gamma[1, 2], F = alpha*gamma[2, 1]*d[2, 1]-beta*d[1, 2]*gamma[1, 1]^2-gamma*d[1, 1]*gamma[2, 1]^2+alpha*gamma[2, 1]^2*d[2, 2]-beta*d[2, 2]*gamma[2, 1]^2-gamma*d[2, 1]*gamma[2, 2]^2, G = alpha*gamma[2, 2]*d[1, 1]-beta*d[1, 2]*gamma[1, 2]-gamma*d[1, 2]*gamma[2, 1]+alpha*gamma[2, 2]^2*d[1, 2]-beta*d[2, 2]*gamma[2, 2]-gamma*d[2, 2]*gamma[2, 2], H = alpha*delta[2, 2]*d[2, 1]-beta*d[1, 2]*delta[1, 2]^2-gamma*d[1, 2]*delta[2, 1]^2+alpha*delta[2, 2]^2*d[2, 2]-beta*d[2, 2]*delta[2, 2]^2-gamma*d[2, 2]*delta[2, 2]^2, E = alpha*delta[2, 1]*d[1, 1]-beta*d[1, 2]*delta[1, 1]-gamma*d[1, 1]*delta[2, 1]+alpha*delta[2, 1]^2*d[1, 2]-beta*d[2, 2]*delta[2, 1]-gamma*d[2, 1]*delta[2, 2], B = alpha*delta[1, 1]*d[2, 1]-beta*d[1, 1]*delta[1, 1]^2-gamma*d[1, 1]*delta[1, 1]^2+alpha*delta[1, 1]^2*d[2, 2]-beta*d[2, 1]*delta[2, 1]^2-gamma*d[2, 1]*delta[1, 2]^2, D = alpha*delta[1, 2]*d[2, 1]-beta*d[1, 1]*delta[1, 2]^2-gamma*d[1, 2]*delta[1, 1]^2+alpha*delta[1, 2]^2*d[2, 2]-beta*d[2, 1]*delta[2, 2]^2-gamma*d[2, 2]*delta[1, 2]^2, A = alpha*delta[1, 1]*d[1, 1]-beta*d[1, 1]*delta[1, 1]-gamma*d[1, 1]*delta[1, 1]+alpha*delta[1, 1]^2*d[1, 2]-beta*d[2, 1]*delta[2, 1]-gamma*d[2, 1]*delta[1, 2], C = alpha*delta[1, 2]*d[1, 1]-beta*d[1, 1]*delta[1, 2]-gamma*d[1, 2]*delta[1, 1]+alpha*delta[1, 2]^2*d[1, 2]-beta*d[2, 1]*delta[2, 2]-gamma*d[2, 2]*delta[1, 2], F = alpha*delta[2, 1]*d[2, 1]-beta*d[1, 2]*delta[1, 1]^2-gamma*d[1, 1]*delta[2, 1]^2+alpha*delta[2, 1]^2*d[2, 2]-beta*d[2, 2]*delta[2, 1]^2-gamma*d[2, 1]*delta[2, 2]^2, G = alpha*delta[2, 2]*d[1, 1]-beta*d[1, 2]*delta[1, 2]-gamma*d[1, 2]*delta[2, 1]+alpha*delta[2, 2]^2*d[1, 2]-beta*d[2, 2]*delta[2, 2]-gamma*d[2, 2]*delta[2, 2];

> subs({A = 0, B = 0, C = 0, D = 0, E = 0, F = 0, G = 0, H = 0, delta[1, 1] = 1, delta[1, 2] = 0, delta[2, 1] = 0, delta[2, 2] = 0, gamma[1, 1] = 1, gamma[1, 2] = 0, gamma[2, 1] = 0, gamma[2, 2] = 0, delta[1, 1]^2 = 0, delta[1, 2]^2 = 0, delta[2, 1]^2 = 1, delta[2, 2]^2 = 0, gamma[1, 1]^2 = 0, gamma[1, 2]^2 = 1, gamma[2, 1]^2 = 0, gamma[2, 2]^2 = 0}, {system1D});

The problem is: there is any simple way to use command "subs" when some expression such that delta[1,1]=1, gamma[1,1]=1, gamma[1,2]^2=1 have value and others are zero.

Can someone please advice and help me on this?



Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

For the life of me I can not get maple to plot this equation.  I have poured over various resources and it simply isn't working.  I have gone so far as to use SIMPLIFY and even  Re(circuitSix) and Im(circuitSix) yet still get only errors.  Any insight would be appreciated.


when i weite this expression

diff(1/(6*t+1)+x(12*t+1)/(6*t+1)^2, t)

then it give an ans


i want to solve it completly,but it give another darivative D(x) which is inside of the the equation.

how can i solve this D(x)



I have this task which says:

Find the equation of the tangent for the function: f(x)= -ln x + ex P(2,f(2)).

So, I first defined the function in Maple: f(x):=-ln(x)+(e)^(x)

then I wrote the equation of the line which is: y = f(2)*(x-2)+f(2)


BUT it does not work! Help me plzzzz



why the output for this program just only "print BChange" not a matrix?



local i,j,k,t,S1,S2,l,C,sols,eqns,BChange;

C:=matrix(n,n); BChange:=matrix(n,n); eqns:={};

for i to n-1 do

  for j from i+1 to n do

    for l to n do




    end do

  end do

end do;




for i to t do

  for j to n do

    for k to n do


    end do;

  end do;

end do;

print (BChange)

end proc:


> A1 := array(sparse, 1 .. 2, 1 .. 2, 1 .. 2, [(1, 1, 2) = 1]):
> Der(A1, 2);
                                                                   print BChange


Can someone please advice me on this?




Can i make a system of equations like this in maple?


What i am trying to do is i want to get all system of equations. For example when n=2, then we should get 8 equations like D(1,1,1), D(1,1,2),D(1,2,1),D(1,2,2),D(2,1,1),D(2,1,2),D(2,2,1) and D(2,2,2). If n=3 then the number of equations is 27 and so on. Can someone please advice me on this?



Every time I try to write a procedure I get stuck.

This time is no different:


global a:=0.081819221, PI:=3.1415926535897932384626433832795;
return d;
end proc;

I digit the following to get a result

and this is what I get (in blue)

Every single time. I can never have a procedure that works right away. It's getting on my nerves

People im with error to show a plot, this is a wor for universty about mechanic materials, and i'm with this error... do not show the plot... before, i've a error because the variable x has values, and i've to unassign to have this.. without unassign, has error in domin of the plot... i dont know how to do this ! And ive to send the work today. 

Someone can help me about this?

Value of variables:
plot algoritm...
plot algoritm

Thanks !

3 4 5 6 7 8 9 Page 5 of 9