MaplePrimes Questions

Dear Primers,

 

I am new to Maple and want to ask how to merge two point plots. Suppose, I have two different point plots with same x coordinates but varying y coordinates. How can I merge them just like you would merge two different line plots on a single graph?

 

Please keep it simple thanks.

Find the points (both x and y coordinates) of intersection y=cosh(x) and y=x^2. Give the answers in numeric form. To find the y-coordinates define one of the functions as f(x) and use f(?).

Is it possible to display each element of a sequence on a new line?

The default behaviour, obviously, is to display each element on the same line separated by commas, and wrapping to a new line as required by screen space. This is somewhat unsightly when the elements of the sequence contain long equations or expressions, and impacts readability because the commas don't stand out as effective separators between elements.

For example:

B := b=2;

C := c=3;

A := B,C;

>A

b=2, c=3

 

Is there a way to display each element on a new line?

For example:

>A

b=2,

c=3

 

Is there another data type or a simple expression that could achieve this effect?

Hi,

I'm currently writing a programme for synchronising automatas, its creates an array and adds words or matrices to the array that aren't already in. I am currently getting an error when i try and run my procedure though and i'm unsure of the problem, any help would be appreciated, here is my code so far.

Thanks!

proc_cerny1:=proc(A::Matrix,B::Matrix,C::Vector[row],N)
local x, S, i, j, T, R, y, found;
x:=2^N;
S:=Array(0..(x-1));
S[0]:=C;
i:=0;
j:=1;
found:=false;

while (i<(x-1) and i<>j) do
T:=S[i].A;
for y from 0 to j do
if LinearAlgebra:-Equal(S[y],T) then
found:=true;
if (found=false) then
S[j]:=T;
j:=j+1;
end if:
end if:
od:

R:=S[i].B;
for y from 0 to j do
if LinearAlgebra:-Equal(S[y],T) then
found:=true;
if (found=false) then
S[j]:=R;
j:=j+1;
i:=i+1;

end if:
end if:
od:
od:
print(S);
end proc:

 

The error i'm getting is when i input this:

proc_cerny1(Matrix([[1,0,0],[1,0,0],[1,0,0]]),Matrix([[0,1,0],[0,0,1],[0,0,1]]),Vector(1..3,1,orientation=row),3);

and the error is:

Error, (in LinearAlgebra:-Equal) invalid input: LinearAlgebra:-Equal expects its 1st argument, X, to be of type {Matrix, Vector} but received 0

 

Is there a simple way, given a functional equation satisfied by a formal power series, to obtain the explicit form (the Taylor expansion) of this formal power series? For example, my input is "f(x)=1+x*f2(x)", and I want to have as the output: "1+x+2x2+5x3+O(x4)".

Many thanks!

 

 

 

I have equation like :

 

 

 

Now I compute second derivative of F respect to x( u and w are functions of x,y):

 

 

 

I must change variables x and y so define them as function of r and s:

 

 

 

And my problem is I want change partial derivative of F respect to x to partial derivative of f respect to r and s. Can anybody help me ?

 

How to calculate category theory in maple?

Expect to draw commutative diagram for asso property, distributive property and

 to calculate hom, disjoint union, adjoint, closure.

In a trivial example of where x goes from 0 to 1 of d n(x)/dx =a, where n(0)=1, n(1)=2, so that the integral is solved easily, how can i do this in maple however I can only solve an eqation with the initial condition, if i try anything else then i get errors such as, 

fx := diff(n(x), x)-a

A := rhs(dsolve({fx, x = 0 .. 1, n(0) = 1, n(1) = 2}, n(x)));

Error, (in dsolve) invalid terms in sum: 0 .. 1

 

 

 

Hello, Mapleprimes' users.

 

I am using spline to fit a function to a given data (instead of polynomial). I created two examples with data of y=cos(x). 

The first example has a domain X=0..10 and its result is satisfactory.

Ths second example has a larger domain, X=0..15, but I couldn't plot the spline function. The function fits well, but its line ends at X=~10.

Then I ckecked this spline assigning several values of X, and all the results are correct. The problem is on the plot step.

My mw file is:

> restart;
> with(plots);
> with(CurveFitting);
> plotsetup(default);

First Exemple Data (Y=cos(X)):
> X := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
> Y := [1, .54, -.41, -.99, -.65, .28, .96, .75, -.14, -.91, -.83];
> Piece1 := spline(X, Y, x, 2);
> fig1 := plot(Piece1, view = [0 .. 15, -1 .. 1]);
> fig2 := pointplot(X, Y);
> display(fig1, fig2);
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Second Example Data (Y=cos(X))::
> X := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
> Y := [1, .54, -.41, -.99, -.65, .28, .96, .75, -.14, -.91, -.83, 0., .84, .91, .13, -.76];
> Piece2 := spline(X, Y, x, 2);
> fig3 := plot(Piece2, view = [0 .. 15, -1 .. 1]);
> fig4 := pointplot(X, Y);
> display(fig3, fig4);
> test := unapply(Piece2, x);
> test(15);

    test(15)=-0.76    #correct value!
 

 

My actual problem involves data from X=0 to X=300, and I have the same issue in this case.

Thanks.

A linear homogenous ODE with constant real coefficients has a partial solution
y := t-> 3*t^7*cosh(5*t)*sin(2*t).
What can be its minimal order? How to determine that with Maple?

Hi,

I have a system of differential equations with boundary conditions:

diff(S(t), t) = -K(t)*S(t)/N, diff(K(t), t) = K(t)*S(t)/N, where S(T)=10, K(T)=20; If I would like to solve this system backward in time, is it right to re-write the system of original diff. equations in the following way:

diff(S(t), t) = K(t)*S(t)/N, diff(K(t), t) = -K(t)*S(t)/N and S(0)=10, K(0)=20 ( I simply changed the sign of the right hand of the equations and changed the boundary conditions to the inotoal ones).

Thanks,

Dmitry

 

 

Hi everyone,

restart:with(plots):

lambda1:=(S+sqrt(S^2+4*alpha))/(2);

lambda2:=(S-sqrt(S^2+4*alpha))/(2);

plot3d({lambda1,lambda2}, S=-10..10, alpha=-5..5, contours=50,grid=[100,100]);

plot([subs(alpha=-5,lambda1),subs(alpha=-4,lambda1),subs(alpha=-3,lambda1),subs(alpha=-2,lambda1)

,subs(alpha=-1,lambda1),subs(alpha=-0.5,lambda1),subs(alpha=0.0,lambda1),subs(alpha=0.5,lambda1)

,subs(alpha=1,lambda1),subs(alpha=2,lambda1),subs(alpha=3,lambda1),subs(alpha=4,lambda1)

,subs(alpha=5,lambda1),subs(alpha=-5,lambda2),subs(alpha=-4,lambda2),subs(alpha=-3,lambda2)

,subs(alpha=-2,lambda2),subs(alpha=-1,lambda2),subs(alpha=-0.5,lambda2),subs(alpha=0.0,lambda2)

,subs(alpha=0.5,lambda2),subs(alpha=1,lambda2),subs(alpha=2,lambda2),subs(alpha=3,lambda2)

,subs(alpha=4,lambda2),subs(alpha=5,lambda2)],S=-10...10,axes=box,color=[red,green]);

contourplot({lambda1,lambda2}, S=-10..10, alpha=-5..5, contours=50,grid=[100,100]);

 

 

How to minimize the disconnect in the 3d plot and countourplot to get a smooth plot?

 

I am trying to illustrate the chain rule for multivariet functions

 

diff(f(u(x,y),v(x,y),x)

 

The Maple responce is D1(f)(u(x,y),v(x,y)*(partial of u(x,y) wrt x) +..etc

 

I would like to replace the D- notation with the standard notation for the "partial of f wrt u" for obvious reasons - this is what students are familar with. The convert cmnd Doe Not Work in this case.

 

Similarly the cmnd diff(u(x,y),v(x,y),x,x) gives rise to D1,D11, D12 symbols which I would likee to convert to standard partial notation.

 

All this is a BIG DEAL when trying to illstrate the chain rule in Cal III.

 

Joe Salacuse

Mathematics

Kettering University

I need to get rid of the type "constant" for gamma. In Maple, gamma is defined as Euler's constant by default. While it is easy enough to unprotect(gamma) and then get rid of its value, Maple will refuse to solve an equation for gamma, as it remains of type constant even after deassigning it. So I need to regain gamma as a variable.

Some may feel this is an unwise thing to do. But it actually is not: I am writing a document involving physics, and gamma is the accepted symbol for the relativistic energy. I cannot avoid using that, lest mass confusion ensues (this involves students). I really don't want to write gammar instead. Euler's constant, otoh, does not figure at all in my document.

Note that I need a solution that works in Maple 15 and later as I am working in a heterogeneous environment as far as Maple versions are concerned.

Thanks in advance,

Mac Dude

 

Obviously, that  f:=x->x^3  is the same function as  g:=t->t^3 . But

f:= x-> x^3;  g:= t-> t^3;

is(f=g);

 

Worse yet

f:= x-> x^3;  g:= x-> x^3;

is(f=g);

First 1467 1468 1469 1470 1471 1472 1473 Last Page 1469 of 2426