MaplePrimes Questions

I have a spike train which is a series of time points, for example saved as a vector of floats. Could someone tell me how I can plot this spike train as a series of vertical bars at each of these time points ?

I would also like to know how to plot a series of spike trains one above the other[i.e. the raster plot] if I start with a 2-D matrix of floats where each row correspond to one spike train.

Thanks in advance.

  

I am trying to solve a factorial inequality.

solve(1/(n+1)! * exp(0.1)<=0.00001)

I get no result and a warning, "some solutions may have been lost".

Also same problem with the simpler inequality

solve(1/(n+1)! <=0.00001)

Wolfram has no problem solving it.

Am I entering it wrong? I attached a copy of my worksheet.

factorialinequality.mw

 

The problem came up when solving this problem: What degree of the maclaurin polynomial  is required so that the error in the approximation of e0.1 is less than 0.00001

When I right-click on a Matrix, the cursor rotates, but the context menu does not open at all (in Maple 2017, in document mode, in Win 10).
Any suggestions - Anyone else with this problem?

Hi all,

I have an differential equation in terms of the D-operator and am trying to convert it to diff form. Using convert/Diff works fine as long as partially evaluated functions don't appear in the equation. However, I can't figure out how to get the two to cooperate.

For instance, running

D[2](eta)(t,x)+D[2](phi)(t,x,0)+D[2](phi)(t,x,0):
convert(%, Diff);

returns

D[2](eta)(t,x) + Diff(phi(t,x,0),x)

Why is the eta term not converted to diff(eta(t,x),x)?

Thanks a lot!

Hello everyone!

Please help me to resolve following error appeared in PDEs.

I have following system of partial differential equation and tried to solve with numerical method

pde1:=diff(U, t)-(diff(U, x, x))-2*U*(diff(U, x))+diff(U*V, x)

> pde2 := diff(V, t)-(diff(V, x, x))-2*V*(diff(V, x))+diff(U*V, x);
> ics := { U(x, 0) = sin(x),  V(x, 0) = sin(x)};

sol:=pdsolve(pde1,pde2,ics,numeric,time=t, range=1..20)

I am get following error

Error, (in pdsolve) invalid input: `pdsolve/numeric` expects its 2nd argument, IBCs, to be of type {set, list}, but received 0
 

Now, I'm not the professional here, you guys are, since this is how the software has been built to produce this code automatically as i can only assume to be educational purposes for the user, concerning the analytic extension of the factorial on C, the gamma function. 

I feel that doing this is in no way helping or promoting your product, clearly despite the idea indeed having merit, it is not applicable to the extent it has been written into your convert function, and look, show me the mathematics of why it makes sense to have things designed this way. 

 

I am not saying i know anything important or am trying to be insulting, I just feel like this is some kind of joke to be honest, i mean how can for the most part the software be an exceptional in terms of computational power, and then this garbage is thrown at me? yeah just silly.

 


 

product(n/k^2-1/(k*n), k = 1 .. n-3)

-(-1)^(n-2)*GAMMA(-n^2+n-2)*(1/n)^(n-2)*n/(GAMMA(n-2)^2*GAMMA(-n^2+1))

(1)

seq(product(n/k^2-1/(k*n), k = 1 .. n-3), n = 3 .. 10)

1, 15/4, 138/25, 6545/1296, 16215/4802, 2342949/1310720, 7512505/9565938, 29537761/100000000

(2)

seq(convert(-(-1)^(n-2)*GAMMA(-n^2+n-2)*(1/n)^(n-2)*n/(GAMMA(n-2)^2*GAMMA(-n^2+1)), 'factorial'), n = 3 .. 10)

Error, (in GAMMA) numeric exception: division by zero

 

Um there is no gamma it was converted to a factorial.....? but ok....

convert(-(-1)^(n-2)*GAMMA(-n^2+n-2)*(1/n)^(n-2)*n/(GAMMA(n-2)^2*GAMMA(-n^2+1)), 'factorial')

-(-1)^(n-2)*factorial(-n^2+n-3)*(1/n)^(n-2)*n/(factorial(n-3)^2*factorial(-n^2))

(3)

seq(-(-1)^(n-2)*factorial(-n^2+n-3)*(1/n)^(n-2)*n/(factorial(n-3)^2*factorial(n^2)), n = 100 .. 100)

Error, numeric exception: division by zero

 

``


 

Download REALLY_REALLY.mw

Just like the title described, I have encountered an error when I use the command "expand". Actually, I just follow the example, but it doesn't work. Please help me or tell me how can I solve it in other commands.


restart;
alias(epsilon = e, omega = w, omega[0] = w0, t[1] = t1, t[2] = t2); e := proc (t1, t2) options operator, arrow; e end proc; w0 := proc (t1, t2) options operator, arrow; w0 end proc; a := proc (t1, t2) options operator, arrow; a end proc; f := proc (t1, t2) options operator, arrow; f end proc; mu := proc (t1, t2) options operator, arrow; mu end proc;
ode := (D@@2)(u)+2*mu*e*D(u)+w0^2*u+e*w0^2*u^3-e*f*cos(omega*t) = 0;
                                               2  
     @@(D, 2)(u) + 2 mu epsilon D(u) + omega[0]  u

                          2  3                             
        + epsilon omega[0]  u  - epsilon f cos(omega t) = 0
e_oredr := 1;
ode := simplify(subs(D = sum('e^(i-1)*D[i]', 'i' = 1 .. e_oredr+1), ode), {e^(e_oredr+1) = 0});
 / 3         2                                                 
 \u  omega[0]  + 2 (epsilon D[2] + D[1])(u) mu - cos(omega t) f

                  \                   2                   
    + 2 D[1, 2](u)/ epsilon + omega[0]  u + D[1, 1](u) = 0
simplify(collect(%, e), {e^(e_oredr+1) = 0});

u := sum('v[i]*e^i', 'i' = 0 .. e_oredr);
                      epsilon v[1] + v[0]
ode := simplify(collect(ode, e), {e^2 = 0});
for i from 0 to e_oredr do eq[i] := coeff(lhs(ode), e, i) = 0 end do;
                       2                         
               omega[0]  v[0] + D[1, 1](v[0]) = 0
       3         2           2                       
   v[0]  omega[0]  + omega[0]  v[1] + 2 D[1](v[0]) mu

      - cos(omega t) f + 2 D[1, 2](v[0]) + D[1, 1](v[1]) = 0
remove(has, lhs(eq[1]), cos); convert(%(t1, t2), diff);
eq[1] := %-convert(f*cos(sigma*t2+t1*w0), 'exp');

v[0] := A(t2)*cos(w0*t1+B(t2)); convert(%, 'exp'); v[0] := unapply(%, t1, t2);
                         /1                             
       (t1, t2) -> A(t2) |- exp(I (omega[0] t1 + B(t2)))
                         \2                             

            1                              \
          + - exp(-I (omega[0] t1 + B(t2)))|
            2                              /

expand(eq[1]);
Error, (in property/ConvertProperty) invalid input: PropRange uses a 2nd argument, b, which is missing
collect(%, exp(I*w0*t1));
Error, (in collect) invalid 1st argument proc (t1, t2) options operator, arrow; A(t2)*((1/2)*exp(I*(w0*t1+B(t2)))+(1/2)*exp(-I*(w0*t1+B(t2)))) end proc
coeff(%, exp(I*w0*t1));
map(proc (x) options operator, arrow; x*exp(-I*B(t2)) end proc, %);
combine(%, 'exp');
subs(I*B(t2) = I*sigma*t2-I*C(t2), B(t2) = sigma*t2-C(t2), %);
conds := combine(%, 'exp');
                               0

 

With this feature, it requires the worksheet from which to import a result from executing it from the worksheet with the Run worksheet command to have section titles as Input  and Calculation respectively.

 

This is a really helpful feature, but what i need is to "fetch" the content from a number of worksheets in a folder from a specified particular section name, for a number of different section names.

Hi everyone,
I was wondering how to create a function, as we create in MatLab, in Maple. Here is an example of MatLab function, that I should convert to Maple:

function Y=fsin(delta,b,n)

if n==0
    Y=1/(1+b^2);
end
if n==1
    Y=atan(1/b);
end
if n==2
    Y=1+log(b^2 + 1)/2-b*atan(1/b);
end
if n==3
    Y=0.5*(2*delta-3*b-2*b*log(b^2 + 1)/2+atan(1/b)*(b^2-1));
end
if n==4
    Y=(1/36)*(18*delta^2-36*delta*b+33*b^2-11+6*log(b^2 + 1)/2*(3*b^2-1)+6*b*atan(1/b)*(3-b^2));
end
if n==5
    Y=(1/72)*(24*delta^3-36*delta^2*b+12*delta*(3*b^2-1)+25*b-25*b^3+12*b*log(b^2 + 1)/2*(1-b^2)+3*atan(1/b)*...
        (1-6*b^2+b^4));
end
if n==6
    
    Y=(1/7200)*(1800*delta^4-2400*delta^2*b+600*delta^2*(3*b^2-1)+1200*b*delta*(1-b^2)+685*b^4-1370*b^2+137+...
        60*log(b^2 + 1)/2*(5*b^4-10*b^2+1)+60*b*atan(1/b)*(-5+10*b^2-b^4));
end
if n==7
    Y=(1/21600)*(4320*delta^5-5400*delta^4*b+1200*delta^3*(3*b^2-1)+...
        1800*delta^2*b*(1-b^2)+180*delta*(5*b^4-10*b^2+1)-441*b+1470*b^3-441*b^5+...
        60*b*log(b^2 + 1)/2*(-3*b^4+10*b^2-3)+30*atan(1/b)*(-1+15*b^2-15*b^4+b^6));
end
end

  Thank you,  

In Maple 2018 help written:

The interpolation methods available in the Interpolation package all work as follows. First, the user calls one of the commands in the package, submitting the input points and the values at these points. This returns an object encapsulating all the data and options submitted. This object can then be used like a normal mathematical function, e.g. for plotting, integration, or just to evaluate at a given point.

The Interpolation[Interpolate] command was introduced in Maple 2018
 

My test example:

with(Interpolation):

points := [seq(x, x = 0 .. 10, 1)]; data := [seq(sqrt(1.+x^2), x = 0 .. 10, 1)];

f := Interpolate(points, data);

f(1); # OK works :).

int(f(x), x = 0 .. 1); # Not working ?

int(f(x), x = 0 .. 1,numeric); # Not working ?

eval(diff(f(x), x), x = 2);# Not working ?

plot(f(x), x = 0 .. 10);#  OK works :)

plot([f(x), diff(f(x), x)], x = 0 .. 10);# Not working ?

plot([f, diff(f, x)], 0 .. 10);# Only a half  working ?

 

Thanks.


 

 

Hi everybody,

I am a newbie in Maple. Could you please help me to convert the following short code from Matlab to Maple: 

I=0.0;

for i1=1:3

  for i2=1:3

    for i3=1:3

      for i4=1:3

        if i1==i2 && i2==i3 && i3=i4

        I(i1,i2,i3,i4)=1.0;

        else

        I(i1,i2,i3,i4)=0.0;

        end

      end

    end

  end

end

Thank you,

Hi,

I would like to plot a stem plot of a function and its Fourier transform but I'm not too sure how to. I have tried using different packages like DiscreteTransforms, DynamicSystems and SignalProcessing but can't seem to get it to work. Any advice is appreciated.

Thanks

Ok so I have a matrix I reduct to echolon form etc and i use the determinent command to get the deteriment  for the value of K

I use the command fsolve(deterimant(matrix) and I get the the answer printet out as 2,2.

 

Is there a way to get maple to print out  something like K = 2 or even better have it print out something like

''it's linjeay indepedent when K not equals to 2" or something like that?

You know I would like to have it look nicer or something. 

 

 

Hello, I am new to MAPLE TA so I hope my question makes sense:

I am asking the students to compute the Laplace transform of a differential Equation and wirte the answer which is an equation in the respose area. I use the following algorithm to generate the answer:

$LaplaceY=maple("
with(inttrans):
ode:=diff(y(t), t) -3*y(t) = 2*exp(t);
y(0):=2;
ans:=laplace(ode, t, s);
alias( Y(s)= laplace( y(t), t, s ) );

[convert(ans,string)];
");

$ans=switch(0,$LaplaceY);
 

Here is the output of the algorthim: ans   s*Y(s)-2-3*Y(s) = 2/(s-1)

The students are supposed to enter s*Y(s)-2-3*Y(s) = 2/(s-1) in the response area using symbolic entry. I tried both Maple graded Maple syntax and Mathematical formula for the response area. It always marks the answer wrong when previewed.

I can't figure out the issue here.

Thanks

Substituting variables for numbers doesn't always work in some situations.  For example.

a:=sqrt(6)/6
                            

subs(6=b,a)
                        

 

 

First 831 832 833 834 835 836 837 Last Page 833 of 2434