Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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

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

a:=sqrt(6)/6
                            

subs(6=b,a)
                        

 

 

sign doesn't work with square roots

expr := sqrt(3)*x^2*y^4-2*x*y^5+x
                                              

sign(expr)

sign(sqrt(3))

 

 

Hi,

So I need an example of how the discrete fourier transform works, and I would like to do this using Maple but I can't figure out how to plot a discrete function. I have attached an example from wikipedia which is what I would like. It is the function on the right of the image. I have tried plotting a vector but then I can't seem to plot this. Let me know if the question isn't quite clear.

Thanks

 

Hi

When i try to simplify this, maple doesn't simplify to the final step. 

I hope anyone can help me. 

Laura

 

 

I want ot replace the free variable introduced by the BackwardsSubstitution procedure with a number. But though the variable looks like x1 I think it must be something else.

problem.maple


here my code . iam trying to generate a binomial sample but there is some error occure please help

with(Statistics):

 

with(Student[Statistics]):

``

P := .1:

``

r[1] := convert(BinomialRandomVariable(N-n, P), `+`)

`Non-fatal error while reading data from kernel.`

(1)

for i from 2 to N-n do A[i-1] := convert(r[i-1], `+`); r[i] := BinomialRandomVariable(N-n-(sum(A[i], j = 1 .. i-1)), P) end do;

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

 

`Non-fatal error while reading data from kernel.`

(2)

for i to N-n do x[i] := Sample(r[i], 1) end do

x[1] := Vector[row](1, {(1) = 1})

 

Error, (in pr) unable to evaluate 5-A[2] to floating-point

 

sum(R[j], j = 0 .. 10)

2+R[0]+r[4]+r[5]+R[6]+R[7]+R[8]+R[9]+R[10]

(3)

``

NULL


 

 

This should be a simple problem, but I am having trouble resolving a contradiction in integral evaluation that is included in the results below.  Instead of butting my head further perhaps someone can point out my probable error.

You will see in both cases I have a triangle signal with a slope of (-1).  However in the 2nd case I have linked the period T to the slope parameter alpha.  If I assign alpha=1 then the results of the 2 integrals should = 1/4, but the 2nd one does not.

Appreciate any feedback.


 

plot(piecewise(-1 < x and x < 0, 0, 0 < x and x < 1, 1-x), x = -2 .. 2, linestyle = solid, thickness = 5, scaling = constrained, title = "Asymmetric Triangle Wave", titlefont = [COURIER, 18])

 

n := 0; 1; T := 2; 1; a[0] := (int(0*exp(-I*(2*Pi*n*t/T)), t = -(1/2)*T .. 0)+int((1-t)*exp(-I*(2*Pi*n*t/T)), t = 0 .. (1/2)*T))/T

1/4

(1)

restart

alpha := 1; T := 2/alpha; plot(piecewise(x < 0, 0, 0 < x and x < (1/2)*T, -alpha*x+1), x = -T .. T, linestyle = solid, thickness = 5, scaling = constrained, title = "Asymmetric Triangle Wave", titlefont = [COURIER, 18])

 

  n=0 term:n := 0; 1; alpha := 1; 1; T := 2; 1; a[0] := (int(0*exp(-I*(2*Pi*n*t/T)), t = -(1/2)*T .. 0)+int((1-alpha*T)*exp(-I*(2*Pi*n*t/T)), t = 0 .. (1/2)*T))/T

-1/2

(2)

``


 

Download integral_contradiction.mw

Hi,

This is my first question here! 

I want to show weird things that can happen in numerical analysis. The example I use is the sum from i=1 to infinity of (1/i) (the harmonic series). In theory this series diverge but in practice it could converge. 

I would want all the calculations to use floating point arithmetic with small mantissa (for instance m=1,2,3)). But the problem is I don't know how to fix mantissa in maple... I have the following fonction: 

g := n -> evalf[m](sum(evalf[m](1/i),i=1..m))

but evalf just show significant digit without changing the mantissa.... 

I hope my question is clear! Thanks for your help! 

 

 

Hi, I a have a question, if you can help me I would be pleased
 

Here is a problem:

for i from 1 to 4 do
 if A[i,i]=0 then break
 else
  for l from i to 4 do
   A[i,l]=A[i,l]/A[i,i]:
   b[i,1]=b[i,1]/A[i,i]
  od:
  for j from i+1 to 4
   for k from i to 4 do
    A[j,k]=A[j,k]-A[j,i]*A[i,k]
   od:
   b[j,1]=b[j,1]-A[j,i]*b[i,1]
  od:
 fi:
od:


I definited matrix A and b, but this for loop doesn't work.

 

Thank you for your help.

I worked on a document about 2 hours ago. And now when I try to open it, it is empty. I saved it in MapleCloud, and I have had it saved before. So today I opnened the saved file from MapleCloud, but now it is gone. How can I get it back!!? It happend to two of my most important files..

Hi all,

I found some strange behavior while usings tensors from Physics; I wanted to make sure I wasn't missing something here.

It seems that changing the metric (for instance, to +++-) causes raising and lowering problems. As an example:

with(Physics):
Setup(metric=`+++-`):

# Define our system of equations
Coordinates(X):

# Define tensors
{U[~mu] = [u(X),0,0,1],
A[~mu]=[0,0,0,n(X)]}:
Define(op(%)):

F[mu,nu]=d_[mu](A[nu]) - d_[nu](A[mu]):
Define(%):

# Multiply tensors
TensorArray(F[~0,~mu].U[mu]);

This produces

-diff(n(X),x1)*u(X)-2*diff(n(X),x4)

However, only the first term should be present. It seems that changing the mulitplication to F[0,~mu].U[mu] produces the correct output, as does removing the Setup call. Also, manually defining F produces the expected output; only defining it via A seems to generate the discrepancy.

Any idea if this is a bug or a feature?

Thanks!

It post can be called a continuation of the theme “Determination of the angles of the manipulator with the help of its mathematical model. Inverse  problem”.
Consider  the use of manipulators as multi-axis CNC machines.
Three-link manipulator with 5 degrees of freedom. In these examples  one of the restrictions on the movement of the manipulator links is that the position of the last link coincides with the normal to the surface along the entire trajectory of the working point movement.
That is, we, as it were, mathematically transform a system with many degrees of freedom to an analog of a lever mechanism with one degree of freedom, so that we can do the necessary work in a convenient to us way.
It seems that this approach is fully applicable directly to multi-axis CNC machines.

(In the texts of the programs, the normalization is carried out with respect to the coordinates of the last point, in order that the lengths of the integration interval coincide with the path length.)
MAN_3_5_for_MP.mw

MAN_3_5_for_MP_TR.mw

First 810 811 812 813 814 815 816 Last Page 812 of 2217