MaplePrimes Questions

Hi everyone, I'm having issues using Maple through the command line (I have reasons to be avoiding the GUI, namely I am trying to use Maple in a development environment that integrates other programs, e.g. Mathematica into the mix. This forces me to only be able to access Maple via the command line).

 

Here is my issue: for some functions, like diff(), which differentiates functions, Maple evaluates the function on the input:

 

> f:=x+2;                                                
                    f := x + 2

> g := diff(f, x);                                 
                      g := 1

 

For other functions though, such as SPolynomial() (from the Ore_algebra library), command-line Maple is lazy and just spits back the input:

> with(Ore_algebra) 

> A:=diff_algebra([D1, x1], [D2, x2]);     
A := diff_algebra([D1, x1], [D2, x2])

> T:=MonomialOrder(A, grlex(D1, D2));              
T := MonomialOrder(diff_algebra([D1, x1], [D2, x2]), grlex(D1, D2))

> L1:=D1;                                          
                     L1 := D1

> L2:=D2;                                          
                     L2 := D2

> L:=SPolynomial(L1, L2, T);                       
L := SPolynomial(D1, D2, MonomialOrder(diff_algebra([D1, x1], [D2, x2]), grlex(D1, D2)))

 

Let me know if you get the same error as well! The correct output (outputted by the worksheet version of Maple) should be:

 

L := 0

 

Hi,

Let's take the last example (Maple 2019) given in help[sparsematrixplot] (representation of the adjacency matrix of a graph).
Vertices of this graph are labelled 1, 2, ...20.
Suppose I change these names as a, b, ...t.
I would like the tickmarks of the sparsematrixplot output match the names of the vertices of the graph, and not the integers 1, 2, ..20

I tried this:
S := [$1..20] =~ StringTools:-Char~(96 +~  [$1..20]);
plots:-sparsematrixplot(..., tickmarks=[S, S])

But the only the tickmars of the columns are changed, not those of the rows.

Is it possible to change the names of the tickmarks ?


Thanks in advance.

How  to get step by step solutions in dsolve? 

Hello,

Please, what is going wrong that it is not graphing the ODE system solution?

eqs := seq(eq[i], i = 1 .. 6*n);
cis := seq(ci[i], i = 1 .. 6*n);
sol := dsolve([eqs, cis], numeric, stiff = true, output = listprocedure);
for i to n do
    graf1[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = black);
end do;
for i from 11 to 2*n do
    graf2[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = blue);
end do;
for i from 21 to 3*n do
    graf3[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = green);
end do;
for i from 31 to 4*n do
    graf4[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = red);
end do;
for i from 41 to 5*n do
    graf5[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = pink);
end do;
for i from 51 to 6*n do
    graf6[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = orange);
end do;

display(seq(graf1[i], i = 1 .. n));
display(seq(graf2[i], i = 11 .. 2*n));
display(seq(graf3[i], i = 21 .. 3*n));
display(seq(graf4[i], i = 31 .. 4*n));
display(seq(graf5[i], i = 41 .. 5*n));
display(seq(graf6[i], i = 51 .. 6*n));


trabalho_final_2019.mw

I had a warning solutions may be lost for the following:

with(plots);
with(plottools);
with(DEtools);
solve({0.5*`sinφ` + 0.5*`sin2φ` + 0.5*sin(-phi) + 0.5*sin2(-phi) - 0.5*sin(phi + psi) + 0.5*sin2(phi + psi) - 0.5*`sinψ` + 0.5*`sin2ψ`, ((-0.5*`sinφ` - 0.5*`sin2φ` + 0.5*sin(-phi - psi) + 0.5*sin2(-phi - psi)) - 0.5*`sinφ`) + (0.5*`sin2φ`)*0.5*sin(-psi) + 0.5*sin2(-psi) = 0}, {phi, psi});
Warning, solutions may have been lost

Any suggestions

 

 

BIOMAT_project.mw

 

I am looking at an SIR model and an adapted model that has a vaccine for measles. I would like to use Maple to plot the difference between the two models. 

All the work that's been done so far is in the attached file. I would like to have multiple graphs, changing the starting values but I just need the general idea of how to do this first. 

Hi

I'm trying to rearrange a transfer function to get my s^2 term with other specific terms . Below is the denominator of the transfer function. I know that my goal is to get (Izz*u)/m for the s^2 term, so I divide by Df*Dr*(a+b)*u*m, as shown below.

However, if we look at the s^2 terms for now, the equation should be further simplified leaving me with simply (Izz*u)/m, but Maple doesn't want to do this for some reason, and if I use simplify on the above expression it tries to expand everything again, and forgetting about my collect(fun, s).

 

Is there any way to get around this?

 

Many thanks

 

Dear all

I have a function g that I compute its limit at x0 

but when I compute series(g(x),x=x0) then I compute the limit of the series I get different limit

 

series_limit.mw

 

Many thanks for your help

Hi

I have a piecewise equation,and two Sum (one of them is infinity and the other has upperband k). I need a numerical value for F2. 

H := r->; piecewise(r < 1, 1);

XF := x-> 2;

f1 := k-> sum(XF(j)*(1-H(j)), j = 0 .. k);

F2:=sum(f1(i), i = 0 .. infinity);

Hi, 

This is a question more or less related to this one Is it possible to define variables with unusual na... but I think it's better to open a new thread. If some think otherwise, please feel free to displace it to the link above.

I want to relabel the vertices of a graph by using special characters.
It happens that this works perfectly if I do not impose the style of the drawing but that it doesn't if I set, for instance, spring=style.
In the attached file you will see that the subsitution of the old vertex names by the new ones doesn't work if apply it directly on the many operators of the PLOT command contains.

Is this behaviour fixed in more recent versions of Maple or it's still present?


Strange-Behaviour-with-SpringStyle.mw

Why does Maple not have texture fill for plotting. Even the old Pascal had it.

Maple Help points out

All Programs>Maple 2017>Classic Worksheet Maple 2017

link that I do not have. Is there a reason for this and how do I fix this?

 

I don't understand whats wrong with my code
r(x):=proc(x) 
    local y
    if (x=1)
    then    
    y=1;
    else 
        y=0;
    end if; 
    return y
    end proc    

Error, reserved word `if` unexpected

I'm also having trouble getting this code to work:

h(x):=proc(x) 
    if (x= infinity)
    then    
    return 1 ;
    else 
        return 0;
        end if; 
    end proc 
theres no error but h(0) just returns h(0) not either value as I would like

Dear All,

How do I use the piecewise function z[k]:=piecewise(k<>0,0,k=0,1) in the loop 

for k from 0 to 10 do

(sum((m^2-1)/z(z[k]+1),m,0..k))

end:

i want the value of z[k] to be automatically used in the loop for the corresponding value of k

Graph the real roots of the equation x3 + (a − 3)3x2 − a2x + a3=0 for a ∈ [0, 1].

 

Sol:=[solve(x^3+(a-3)^3*x^2-a^2*x+a^3=0,x)];

for i from 1 to 3 do

R||i:=unapply(Sol[i],a):

print(plot(R||i(a),a=0..1,numpoints=500)); end od:

 

Is there a simplier way to solve this. If not why did they choose this path?

First 325 326 327 328 329 330 331 Last Page 327 of 2143