MaplePrimes Questions

eqs := [a = b, c = d, e = f]:

map(`+`, eqs, 2);
map(`-`, eqs, 2);
map(`/`, eqs, 2);
         [a + 2 = b + 2, c + 2 = d + 2, e + 2 = f + 2]

         [a - 2 = b - 2, c - 2 = d - 2, e - 2 = f - 2]

               [1     1    1     1    1     1  ]
               [- a = - b, - c = - d, - e = - f]
               [2     2    2     2    2     2  ]

These work differently

map(`*`, eqs, 2);
map(`^`, eqs, 2);
               [2 (a = b), 2 (c = d), 2 (e = f)]

Error, non-algebraic base in a power: a = b

(The first one can be dealt with by applying eval to the output)

Why do not all work the same way?

Edit:
Generic work arounds where arithop is one of: + - / * ^

map(eval@`arithop`, eqs, 2);
map(map@`arithop`, eqs, 2);# Update: Maple 2021 and higher
[seq(i arithop 2, i in eqs)];

Hi, the below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Any answer and reply is welcome.

restart

The below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Error, missing operator or `;`

 

C := x^2/A^2+y^2/B^2-1

x^2/A^2+y^2/B^2-1

(1)

l := y = k*x+b

y = k*x+b

(2)

subs(l, C)

x^2/A^2+(k*x+b)^2/B^2-1

(3)

eq := collect(%, {x, x^2})

(1/A^2+k^2/B^2)*x^2+2*b*k*x/B^2+b^2/B^2-1

(4)

x1_plus_x2 := simplify(-coeff(eq, x)/coeff(eq, x^2))

-2*b*k*A^2/(A^2*k^2+B^2)

(5)

x1_by_x2 := simplify(coeff(eq, x, 0)/coeff(eq, x^2))

(-B^2+b^2)*A^2/(A^2*k^2+B^2)

(6)

x1 := solve(eq = 0, x)[1]; x2 := solve(eq = 0, x)[2]

-(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

 

-(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

(7)

subs(x1, l); subs(x2, l)
I don't know how to make it like y1=k*x1+b and y2=k*x2+b auto in this procedure.

Error, invalid input: subs received -(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, invalid input: subs received -(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, missing operator or `;`

 

y1_plus_y2 := simplify(k*x1_plus_x2+2*b)

2*b*B^2/(A^2*k^2+B^2)

(8)

y1_by_y2 := simplify(b*k*x1_plus_x2+k^2*x1_by_x2+b^2)

B^2*(-A^2*k^2+b^2)/(A^2*k^2+B^2)

(9)
 

 

Download ask_ellispe_and_straight_line.mw

I needed to plot a function, using  plot in Maple.

plot(sin(x)*sqrt(1 - (sin(x)/x)^2), x = 0 .. Pi/4)

The graph shown by Maple seems to be identically 0 from x=0 up to some x*. At this point it jumps and for x>x* it looks fine. Of course the function has a singularity at x=0, but even changing the left end of plotting range to something small but positive does not alleviate the problem. Another strange thing is that x* seems to depend on the (end point of) the plotting range.

hello,
I've been playing around a bit with mapel in the 14 day trial version and now I have a few questions
how can I set mapel so that results are always shown to me in SI format and the engineering representation and the results are automatically approximated, e.g. pi is calculated with 3.14...?
The configuration appears in the margin for individual solutions, but how do I set this globally so that I don't have to set it individually each time?

I also have to manually set the format of an input to input so that I can access the result when solving.

is there a reset button that is hidden so that I can go back to the basic settings? I must have changed something.

I hope you can help me

thanks for the help and sorry for my nob question, im reele new in Cas or other software like this

If it is the wrong tags or generally wrong here, please delete or move Thanks
Arthur

restart:

 

inte_eq := int(-(sum(B[i]*beta[i]* exp(-beta[i] * (t-tau)),i=1..n)),tau=0..t);

int(-(sum(B[i]*beta[i]*exp(-beta[i]*(t-tau)), i = 1 .. n)), tau = 0 .. t)

(1)

how to solve this ?

Download creep_integral_sol.mw

I experience Maple 2024 not beeing responsive.

It happens often that nothing is happening for 10 to 15 seconds after placing the cursor in an input line.

When the cursor is back, typing is normal for a little while and then again Maple is not reacting to user input.

The worksheets I am working with are between 50 and 100 Mb large in file size (containing plot3d structures, approx 1000 frames distributed across several plots:-display statements). It looks to me that the GUI has to do some house keeping from time to time which keeps it buisy with all the plot structures.

I could delete (plot) output, but this would require execution of the worksheet (before deleting the output) each time I want to continue working normally. This takes several minutes to be ready to work.

Anything else that I can do?

I am learning patten matching in Maple. 

Any one could explain why patmatch(1, (x::anything)^(n::'nonunit'(anything)))   gives true but patmatch(2, (x::anything)^n::'nonunit'(anything)); gives false?

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

restart;

patmatch(1, (x::anything)^(n::'nonunit'(anything)))

true

patmatch(2, (x::anything)^n::'nonunit'(anything));

false

Download patmatch_question_nov_16_2024.mw

I was expecting result similar to using this other software

I do not understand Maple's result. How could I change the patmatch so it does not match 1 to the pattern x::anything^n::anything where n is not 1 ?

Update

To give context, I was trying to write this example from the other software  in Maple:

But when I wrote this

expr:=1 + x^2 + x^4;

F:=proc(X::anything,x::symbol)
    local la,y,n;
    if patmatch(X, (y::anything)^(n::'nonunit'(anything)) ,'la') then  
       f(eval(n,la));
     else
        X;
     fi;
end proc;

map(X->F(X,x), expr);

Maple gave 

So I modified the code now to check for explicit 1,  to avoid this bad match, like this

expr:=1 + x^2 + x^4;

F:=proc(X::anything,x::symbol)
    local la,y,n;
    if patmatch(X, (y::anything)^(n::'nonunit'(anything)) ,'la') then  
        if eval(y,la)=1 then #bug in maple?
           X;
        else
           f(eval(n,la));
        fi;
     else
        X;
     fi;
end proc;

map(X->F(X,x), expr);

And now it gives expected result

Hi all

I would like your help to represent the states of the ODE according to the parameter "a" for t=0..10 and a=0..5.
I can do this for a value of t=200.

enfonction_p_2_cas1.mw

Given list L:=[3,4,x,x^2,x^3]; return list of all exponents of x (other than 1). So result should be [2,3]

But this has to be done using patmatch, as this is what I am learning. Not using other means. This is my current code that does this.

restart;
L:=[3,4,x,x^2,x^3];
f:=proc(X::anything,x::symbol)
 local la,n;
 if patmatch(X,x^n::nonunit(anything),'la') then
    assign(la);
    RETURN(n);
 else
    RETURN(NULL);
 fi;
end proc;

map(X->f(X,x),L);

Returns [2,3]

I wanted to shorten it using `if` so that no need to call external function f() as shown. So I wrote

L:=[3,4,x,x^2,x^3];
map(X->`if`( patmatch(X,x^n::anything,'la'),[assign(la), n],NULL),L);

But the problem is that on first entry, the assign(la) now assigns value to and hence it is no longer a name for the next element in the list L. This gives error

Error, (in PatternMatching:-AlgStruct:-Match) first operand of `::' must be a name
So I added  unassign('n') like this

restart;
L:=[3,4,x,x^2,x^3];
map(X->[unassign('n'),`if`( patmatch(X,x^n::nonunit(anything),'la'),[assign(la), n],NULL)][],L);

And now this returns 

            [[2], [3]]

How to make it return [2,3]? Why did it add extra []? How can the above be shortened more? and still return [2,3]

edit: I found how to get rid of the extra [], like this

restart;
L:=[3,4,x,x^2,x^3];
map(X->[unassign('n'),`if`( patmatch(X,x^n::nonunit(anything),'la'),[assign(la), n][],NULL)][],L);

Now it returns [2,3] , needed to add extra [] after each closing [.....]

In another system, the code is 

Cases[{3, 4, x, x^2, x^3}, x^n_ -> n]

    {2, 3}
   

I was trying to make the Maple code as short as possible. I know it will not be as short as the above.

The question is: Can above code be made shorter but still use patmatch?

Again, I am looking for only solution using patmatch. I know I can use select and types in Maple to do this also.

Maple 2024.2

How to insert a file inside another file, creating a session, without equations with the same name conflicting?

Is there another way to change the x-axis values other than tickmarks? For example on an interval [0,4*Pi]

restart; with(plots); with(DEtools)

Ode1 := diff(y(t), t, t) = cos(t)

diff(diff(y(t), t), t) = cos(t)

(1)

IC := (D(y))(0) = 0, y(0) = 1

(D(y))(0) = 0, y(0) = 1

(2)

gsol := dsolve(Ode1, y(t))

y(t) = -cos(t)+c__1*t+c__2

(3)

exactsol := dsolve({IC, Ode1}, y(t), numeric, output = listprocedure)

odeplot(exactsol, [t, y(t)], 0 .. 4*Pi, color = blue, title = "Solution to the Differential Equation", labels = ["t", "y(t)"])

 

Download directly_integrable.mw

Hi every one, i want to identify the Chaotic behavior for the system :

at : w = 1, delta = 0:8,
k = 0:2, m = 2, epsilon = 1, n = 2, f0 = 0:6; mu = 2,1    and initial condition (0:1; 0:05).

A farmer has exactly 100m of wire mesh fence available to enclose a pasture. The fence must begin and end at his large oak tree. To do this, imagine the usual "north-south/west-east" cross of the cardinal directions in the drawing plane. The oak tree is at the center of this.

1. All land that lies west of the imaginary axis is not worth a cent.

2. All land that lies east of the oak tree becomes continuously more expensive the further it is from the north-south axis. The property value is based on the function y = k · x, where y represents the price per square meter and x represents the distance in meters to the north-south axis. k is a proportionality factor, which for the task is k = 1 euro/m^3.

a) On which curve must the fence run so that the enclosed pasture area has the greatest possible value?

b) On which curve must the fence run if instead of the distance x from the north-south axis the distance r from the oak tree is decisive with the same factor k?

I was watching Maple's video for conference 2024. In one of the presentation, this example is given

But in my Mapple 2024.2 I get an error typing the same command:

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

restart;

my_ode:={diff(x(t),t$2)-t^2*x(t)=0, x(0)=1,D(x)(0)=1}:
MultivariatePowerSeries:-PowerSeries(my_ode,t,x);

Error, invalid input: too many and/or wrong type of arguments passed to MultivariatePowerSeries:-PowerSeries; first unused argument is t

 

 

Download powerSeries_nov_14_2024.mw

Link to the video is here  it is around 39:00 in time. 

Any one knows why I get an error using same command shown in the video?

I have solved a simultaneeous equation for a variiable s. I have used command solve. Can i see what happens in background, Each step by which the equations are solved.

I got answer s=j. But how i got it can i see

attaching the sheet: Q_3.mw

First 54 55 56 57 58 59 60 Last Page 56 of 2426