[go: up one dir, main page]

Items tagged with frem

Feed App Center

I did expect the following two plot statements (MaplePrimes is only rendering one statement) to produce the same plot. What did I do wrong when using mod in plot?

kernelopts(version)

`Maple 2024.1, X86 64 WINDOWS, Jun 25 2024, Build ID 1835466`

(1)

plot([seq([t, `mod`(t, 10)], t = 1 .. 100)])

 

plot(`mod`(t, 10), t = 0 .. 100)

 

NULL

Download mod_in_plot.mw

plot(x mod 3, x=-5..5);

 

plots exactly the same as

 

plot(x, x=-5..5);

 

and

 

plot(floor(x) mod 3, x=-5..5);

 

The mod function is doing nothing, why?

 

If I do 5 mod 4 I get 1, as expected.

restart;
#plot(exp('frem'(x+1,3)-1),x=-5..5,discont);
int(exp('frem'(x+1,3)-1),x=-5..5);
Error, (in int) wrong number (or type) of arguments: invalid options or option values passed to exact integration
evalf(Int(exp('frem'(x+1,3)-1),x=-5..5));
Error, (in evalf/int) when calling 'frem'. Received: 'invalid input: frem received x+1, which is not valid for its 1st argument, x'
sol1:=dsolve({diff(x(t), t)=eval(piecewise(0 <= t and t < 10/3, 60, 10/3 <= t and t < 13/3, 0),t='frem'(t,13/3)),x(0)=0},numeric,output=listprocedure);
sol2:=dsolve({diff(y(t),t)=eval(piecewise(0 <= t and t < 4, 50, 4 <= t and t < 5, 0),t='frem'(t,5)),y(0)=0},numeric,output=listprocedure);
#two commands above are well,but the below is not well.
sol:=dsolve({diff(x(t), t)=eval(piecewise(0 <= t and t < 10/3, 60, 10/3 <= t and t < 13/3, 0),t='frem'(t,13/3)),diff(y(t),t)=eval(piecewise(0 <= t and t < 4, 50, 4 <= t and t < 5, 0),t='frem'(t,5)),x(0)=0,y(0)=0},numeric,output=listprocedure);
Error, (in signum) invalid input: frem received t, which is not valid for its 1st argument, x
plots:-odeplot(sol,[[t,x(t)],[t,y(t),color=blue]],t=0..50,gridlines=true,thickness=2);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution.

any advice is appreciated.

Page 1 of 1