Maple 18 Questions and Posts

These are Posts and Questions associated with the product, Maple 18

hello
i have a problem that you could help me
i have an expression that i want convert it to an expression according to the expression q[d] with maple
i have bellow expressions
B[d]:=(-d*w[1]+w[3])/(((-2*w[1]+w[3])^2)-((-d*w[1]+w[3])^2))
B[o]:=(-2*w[1]+w[3])/(((-2*w[1]+w[3])^2)-((-d*w[1]+w[3])^2))
A[o]:=w[1]*(alpha[o]-c[o]-t[o])+2*w[2]*e[o]
A[d]:=w[1]*(alpha[d]-c[d]-t[d])+2*w[2]*e[d]
q[o]:=B[o]*A[o]-B[d]*A[d]
q[d]:=B[o]*A[d]-B[d]*A[o]
i want simplify expression U[d] such as this one
U[d]:=w[1]*(q[d]*(alpha[d]-q[d]-d*q[o]-c[d]-t[d])-C)+w[2]*(e[d]*q[d]+e[o]*q[o])+w[3]*((1/2)*(q[d]+q[o])^2)
I'm looking to simplify U[d] according to the expression q[d]
please please help me

Hey,

Basically the problem is that when I try to derive a variable L, which is defined by a very big equation, Maple does not do the maple. But if I copy and paste the big equation it calculates everything perfectly. Could I get any insight on why is that?

The copy paste method is very space consuming.

Thanks in advance.

I have a system of pdes and solved numerically using pdsolve (numeric) command.

The system consists of four first order partial differentia equations.

for example u(x,t), R(x,t)....

what command should I give to the Maple and get the graph of u(x,t) at a specific point x_0?

For example, I need a plot for u(30,t).

Is it possible with the maple plot?

I really appreciate your help.

Thank you for reading this post. :)

 

Dear community,

The VectorCalculus package in Maple 18 exhibits some rather odd behaviour when calculating an integral over a 3D-domain (an elipsoid centered at (0,0,1) with length of semi-axes 2, 2, and 1) given by a 'Region'. It also reports an incorrect result when calculating the flux of a vector field through the surface of this ellipsoid.

See below for a minimal working example:

 

// integrate several functions over ellipsoid

int(2*x+2*y, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: 0

int(2*z, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: 32*Pi/3

int(2*x+2*y+2*z, [x, y, z] = Region(-2 .. 2, -sqrt(-x^2+4) .. sqrt(-x^2+4), -sqrt(1-(1/4)*x^2-(1/4)*y^2)+1 .. sqrt(1-(1/4)*x^2-(1/4)*y^2)+1));    ---- output: -32*Pi/3

 

Why does the integral change sign?

 

// Calculate flux of vector field over surface of ellipsoid

F2 := VectorField(`<,>`(x^2, y^2, z^2));

S2 := Surface(`<,>`(2*sin(t)*cos(s), 2*sin(t)*sin(s), 1+cos(t)), s = 0 .. 2*Pi, t = 0 .. Pi);

Flux(F2, S2, 'outward');   ---- output: -32*Pi/3

 

However, since 'z' is positive over the entire ellipsoid, by the Divergence Theorem we know the result should be positive (in fact, equal to +32*Pi/3). Changing 'outward' to 'inward' does not change the sign, by the way.

 

Is this a bug inside the VectorCalculus package which appears more often, or have I done something wrong?

Thank you for responding and apologies if a similar question has already been answered in another thread.

Best wishes,

QQ

I have drawn a 3d plot of a sphere in maple, but when I try to export this one in an .eps file, only the coordinate system of the plot is shown, but not the colourful plot. The export works if I use jpg and similar file types, but not with .eps, does anybody know if there is a way out of this problem?

I have a problem solving a system of PDEs.

The system of PDEs are

PDE01 := -(l^2+1^2)*(diff(v(l, t), t))+(l^2+1^2)*(diff(R(l, t), l, l))+4*l*(diff(R(l, t), l))+4*l*v(l, t)/(l^2+1^2)^(1/4)-6*R(l, t)/(l^2+1^2)+(l^2+1^2)^(1/2)*(-1.1+sqrt(.1))^2*sqrt(24)*u(l, t) = 0

PDE02 := diff(R(l, t), t) = v(l, t)

PDE03 := diff(u(l, t), t)-sqrt((1.1^2-1)/1.1^2)*(diff(u(l, t), l))-2*l*sqrt(1.1^2-1)*u(l, t)/(l^2+1^2) = 0

the initial condisions are

v(l, 0) = 0, R(l, 0) = 0, u(l, 0) = sqrt((l^2+1^2)^(1/2))*10^(-5)*exp(-(l-10)^2/.5^2)

and the BCs are

bdry00 := {((30^2+1^2)/30^2)^(1/4)*v(-30, t) = -((30^2+1^2)/30^2)^(1/2)*(D[1](R))(-30, t), ((30^2+1^2)/30^2)^(1/4)*v(30, t) = -((30^2+1^2)/30^2)^(1/2)*(D[1](R))(30, t), u(-30, t) = sqrt(30^2+1^2)*10^(-5)*exp(-40000), u(30, t) = sqrt(30^2+1^2)*10^(-5)*exp(-10000)}

to solve the system,

I enter

pde := pdsolve({PDE01, PDE02, PDE03}, {bdry00, init00}, time = t, numeric, range = -30 .. 30, timesstep = 1/60, spaceste = 1/254)

then, I failed to get the result constantly.

I tried several cases changing the initial conditions...

Can you let me know what I am doing wrong?

 

I have a problem with IsMatrixShape. I have in my part of formulation this matrix expression: QTIbQ

While Ib is a symmetric matrix, this matrix expression is clearly symmetric. However, when I try to check this issue with IsMatrixShape command, it returns false. I am extremely confused. Can anyone help me? Thanks in advance.

I'm attempting to plot the Nyquist plot for a complex system such that Maple cannot determine the frequency limits automatically, and suggested I use 'range' to specify the frequency limits. How do you do this? For example if you have a system G=1/(s+1), how do you plot the Nyquist plot in the frequency range 0 to 1rad/s?  Thanks

Write a Maple code that performs the Gaussian elimination for an nxn matrix, converting it to an upper triangular matrix. 

(Hint: you will need to use three for .. do loops.)

Write a recursive Maple procedure, called “decToBin”, that converts an integer from decimal (base 10) to binary (base 2). Ensure that only integers are allowed as arguments to the procedure. Passing a negative integer should result in no output. Test your procedure by outputting the result of the following:
decToBin(10)
decToBin(163)
decToBin(213)
decToBin(-1)
decToBin(“A”) # should result in an “invalid input” error

Hello everyone,

 

I am working on a program in Maple and got stuck in exchanging limits for integrals. For example, if I have an expression of following type.

Eq:=4*Int(f(x), x=0..1/3)+Int(x*f(x), x=0..2/3);

I want to convert it in to an expression of form

4*Int(f(x),x=0..x)-4*Int(y,x=1/3..x)+ Int(x*f(x), x=0..x)- Int(x*f(x), x=2/3..x)


In short, I want to split both the integral at x but flip in limits in the second integral. I tried as follows which did not work

applyrule(Int(f::anything,y=c::numeric..d::numeric)=Int(f,y=c..x)-Int(f,y=c..x), Eq)

Please, help me!

Thank you for your time.

Hey people,

 

I am trying to get the following code to run, but it keeps returning an error about too many arguments

 

restart:with(plots):with(PDEtools):
alpha_const := 0.5:gamma_const := 2.5: D1 := 0.05: D2 := 0.002:
A := diff_table(a(x,t)):B := diff_table(b(x,t)):
Selkov[1] := A[t] = 1 - A[]*B[]^(gamma_const) + D1*A[x,x]:
Selkov[2] := B[t] = alpha_const * ( A[]*B[]^(gamma_const) - B[]) + D2 * B[x,x]:

bc[1] := D[1](a)(0,t)=0: bc[2] := D[1](b)(0,t)=0: bc[3] := D[1](a)(4*Pi,t) = 0: bc[4]:=D[1](b)(4*Pi,t)=0:

ic[1] := eval(A[],t=0)=a_0:ic[2] := eval(B[],t=0)=b_0:
case1 := eval(ic,[a_0=1,b_0=1]):
case2 := eval(ic, [a_0=piecewise((x<2*Pi+1) and (x>2*Pi-1), 0.99, 1), b_0=piecewise((x<2*Pi+1) and (x>2*Pi-1), 0.99, 1)]):

Case1Default := pdsolve({Selkov[1],Selkov[2]},{bc[1],bc[2],bc[3],bc[4],case1[1],case1[2]},numerical);


Error, (in pdsolve/sys) too many arguments; some or all of the following are wrong: [{a(x, t), b(x, t)}, {a(x, 0) = 1, b(x, 0) = 1, (D[1](a))(0, t) = 0, (D[1](a))(4*Pi, t) = 0, (D[1](b))(0, t) = 0, (D[1](b))(4*Pi, t) = 0}, numerical]

 

My code worked just earlier today, and now it wont. If i try to run pdsolve({Selkov[1],Selkov[2]}) it says that there is an error with general case of floats. 

 

You help is greatly appreciated!

I want to translate my maple code with matrice multiplication  to C code. But the command  "Multiply" cannot be translated. So I want to edit the function translation by myself. I use "AddFunction" command to create a new function  "Multiply" and want to specify its corresponding C code.

 


f := proc ()
local x,y;
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a,b;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

 

But when I run it, the "Multiply" function cannot be translated.  The result is:

 

Warning, type signature [CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions()), CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions())] for function Multiply is not recognized
void f (void)
{
  int x[2][2];
  int y[2][2];
  x[0][0] = 1;
  x[0][1] = 2;
  x[1][0] = 3;
  x[1][1] = 4;
  y[0][0] = 1;
  y[0][1] = 3;
  y[1][0] = 4;
  y[1][1] = 2;
  Multiply(x, y);
  ;
}

I don't know why "Multiply(x,y)" cannot be translated.

If I put two "Multiply(x, y)" in the procedure, like this:


f := proc ()
local x,y;

Multiply(x, y);
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

THe result is:

Warning, cannot resolve types, reassigning x's type
Warning, cannot resolve types, reassigning y's type
Error, (in CodeGeneration:-IssueError) type 'Matrix' cannot be translated to target language

I don't know why type 'Matrix' cannot be translated.

 

 

how to customize/invert the foreground/background color scheme in Maple?

 

The black on white is killing my eyes and also wasting energy, white on black is much better on the eyes and conserves energy (pixel brightness), imho

 

thanks in advance!

 

 

hello,

when i type a code to display an image of a function, maple just outputs my code in blue...what is that mean?

 

thank you

First 61 62 63 64 65 66 67 Last Page 63 of 86