Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

The command

plots[textplot]({[4.2,1.9,typeset(sin(30°))]},
symbol=point,color=black,font=["Arial","Bold",25]);

will output

Can we have the number 30 in a non-italic format?
Thank you!
mapleatha


 

Why is the minus sign so weak even in the bold font case? My students sometimes miss it in online tests.
How do we make the minus sign bolder?
Thank you!

mapleatha

 

Hi, 

First question
Let P1 the logical proposition

restart
with(Logic):
local O
P1 := (&not O) &and (&not C) &implies (&not Q);

Is it possible to obtain its contraposition P2  in a form that contains &implies?

# P2 := (Q) &implies &not ((&not O) &and (&not C));


Second question
Why does the modulo 2 canonical form of proposition P5 above contains "1" "plus" other terms:
(if 1 is present this means 1 + something = 1 and then that P5 is a tautology, which is obviously wrong as Tautology(P5) shows)

restart
with(Logic):
local O
P1 := (&not O) &and (&not C) &implies (&not Q);-
P2 := (Q) &implies &not ((&not O) &and (&not C));
P3 := op(1, P2) &and (&not C);
P4 := op(2, P2) &and (&not C);
P5 := P3 &implies P4:

Canonicalize(P5, {O, C, Q}, form=MOD2)

                   C O Q + C Q + O Q + Q + 1


Verificaion of what the modulo 2 canonical form of a proposition including an "addititive" tautology is

T := O &or (&not O):
Canonicalize(T, {O}, form=MOD2);
Canonicalize(T &or S, {O, S}, form=MOD2);
                               1
                               1

Is it that I missed something or is iot a bug?

Watchout: this result has been obtained with Maple 2015.2

TIA
 

Is there any command for defining piecewise functions in 2 dimensional domain (x, y)

Say (x,y) such that ((0,0)<(x,y)<(1,1), x+y, (1,1)<(x,y)<(2,1), x-y), x=0..2, y=0..1)

 

Thanks for help.

Ramakrishnan

Hi, I want to animate the motion of an electrond around a negative-source electric field. The trajectory would be iperbolic, however I've encountered one problem: I have to compose the movemente with 4 different animate pointplot3d, and they all start at a certain point at the same time and end in another at the same time. Can I make it so that they all start when another one has finished and only the moving one is shown?

display(
animate(pointplot3d, [[A, sqrt(A^2 - 1), 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = 1 .. 3), 
pointplot3d([0, 0, 0], symbol = solidsphere, color = "Blue", symbolsize = 15), 
animate(pointplot3d, [[-A, -sqrt(-1 + (-A)^2), 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = -3 .. -1), 
animate(pointplot3d, [[A, 3*sqrt(2)/4*A - sqrt(2)/4, 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = 3 .. 6), 
animate(pointplot3d, [[-A, 3*sqrt(2)/4*A - sqrt(2)/4, 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = -6 .. -3), 
implicitplot3d(x^2 + y^2 + z^2 = 17, x = -6 .. 6, y = -10 .. 10, z = -10 .. 10, color = "Green", style = wireframe), 
scaling = constrained)

This is the code I've come up with, the blue still point is the elctron which powers the field, the moving blue point (there are 4 of them but all represent the same thing) is the moving electron and the green ball is a representation of the electric field.

Edit: I'll use the code for interactive components.

Thanks in advance to everyone!

 

I have a list of 1's and 2's. Something like [1,1,1,2,2,2]. I want to remove 1 or 2 from the list (only once), without needing to mention at which place. The remove command removes all of the occurrences, I need something similar which remove the given element only once.
>L:[1,1,1,2]
>remove(has, L, 1)
[2]

I want the output to be [1,1,2]

Does Maple support nested modules, to better organize library code?

Hi,

I have created a simple command which extracts the term containing the input. It works fine when I have more than one term in the expression but fails when there is the only one term in the expression. See below.

LT:= (expr, term)-> select(has, expr, term) #extract the operand containing the "term" in the given expression "expr"


>A:=t*u[1,1,1]*u[1,1,1,2]+2;
             

(input)>LT(A, u[1,1,1]);# works as expected, extracting the operand containing u[1,1,1]
 (output) t u[1, 1, 1] u[1, 1, 1, 2]

>op(A);#works, there are two operands
 t u[1, 1, 1] u[1, 1, 1, 2], 2

>A:=t*u[1,1,1]*u[1,1,1,2];
 

>LT(A, u[1,1,1]);#doesn't work, expected output is tu[1,1,1]u[1,1,1,2]
 u[1, 1, 1]

>op(A); doesn't work, expected output is tu[1,1,1]u[1,1,1,2]
t, u[1, 1, 1], u[1, 1, 1, 2]

Find the sum of the degrees of the Neighbors of a vertex say u in a graph G. Kind help with writing a function.

Let$ (C):f(x)=3+\frac{(e^{x^2}+e)}{e^{x^2}-e)}$.Find the equation of the circle touching the graph $(C)$ at three points?

dsolve accept system of first order ode's in the form x'=A x, where x' is vector, A is matrix of coefficients and x are the dependent variables. This is convenient since one does not have to convert things to a list.

But  dfieldplot and phaseportrait and DEplot do not accept this form. One must convert things to list first.

Here is an example

restart;
sys:=Vector([diff(x(t),t),diff(y(t),t)]) = Matrix([[1,2],[0,3]]).Vector([x(t),y(t)]);
dsolve(sys)

But

DEtools:-dfieldplot(sys,[x(t),y(t)],t=0..4,x=-4..4, y=-4..4);

Error, (in DEtools/dfieldplot) system must have same number of dependent variables as DE's.

workaround is to write the system as list

new_sys:=[diff(x(t), t)=x(t) + 2*y(t),diff(y(t), t)=3*y(t)];
DEtools:-dfieldplot(new_sys,[x(t),y(t)],t=0..4,x=-4..4, y=-4..4);

I know one can automate the conversion. But still, it would be better if dfieldplot would accept sys as dsolve did.

Same for 

DEtools:-phaseportrait(sys,[x(t),y(t)],t=0..4,[[x(0)=1,y(0)=0]],x=-4..4, y=-4..4);
#
DEtools:-DEplot(sys,[x(t),y(t)],t=0..4,[[x(0)=1,y(0)=0]],x=-4..4, y=-4..4);

They gives same error.

Since dsolve can do it, may be these other functions can also support taking a system of ode's in vector/matrix form? Any reason why not?

Maple 2021.1

 

 

There seems to be an "issue" when using a indexed name (say x[4]) as the loop index in a seq() mul() or add() command - the indexed name is assigned once the command exits!!

This never(?) happens if the loop index is not an indexed name. A bug??

See the attached which illustrates the issue for the add() command, where x[4] is assigned on exit from add(). The same thing happens if add() is replaced with seq() or mul()

  restart;

#
# x[4] should not be assigned on exit from add() !!
#
  add( u(x[4]), x[4]=1..10);
  x[4];
#
# x__4 is not assigned on exit from add()
#
  add( u(x__4), x__4=1..10);
  x__4;
#
# j is not assigned on exit from add()
#
  add( u(j), j=1..10);
  j;

u(1)+u(2)+u(3)+u(4)+u(5)+u(6)+u(7)+u(8)+u(9)+u(10)

 

10

 

u(1)+u(2)+u(3)+u(4)+u(5)+u(6)+u(7)+u(8)+u(9)+u(10)

 

x__4

 

u(1)+u(2)+u(3)+u(4)+u(5)+u(6)+u(7)+u(8)+u(9)+u(10)

 

j

(1)

 


 

Download aBug.mw

 

 

Hi... I have a long-expression, which I have abbreviated here. I want every 5th term summed. Included is my code, but I need the unassign command (after point 12) for it to work. The problem is when I unhash and insert this unassign('s','X[4]') command into my actual Table of Records procedure, Maple protests. it gives a cryptic: " Error, `(` unexpected " .
How can I modify the original code to sum every 5th term as efficiently as possible as the thing is a 4000 term expression which I later need to numerically integrate?

sum_every_5th.mw


 

I do not remember if there was a post on this before or not
Maple 2021.1

int(arcsin(x)/(1+(-x^2+1)^(1/2)),x)

gives

Error, (in Utils:-TransformAndApply) numeric exception: division by zero

The correct answer should be

((-1 + Sqrt[1 - x^2]) ArcSin[x])/x + ArcSin[x]^2/2 -  Log[1 + Sqrt[1 - x^2]]

I had to go back to Maple 2018, to get no exception:

May be this could be looked at for next Maple version?

First 395 396 397 398 399 400 401 Last Page 397 of 2216