MaplePrimes Questions

I have this list

L := {a = b, e = f};

I want to extract b and f

How can i do it ?

Hi there,

I am looking at the system of equations

0=2*r*(H*(2-H)-3*sin(theta)^2)

0=-3*sin(2*theta)

with

H=sqrt(1-2*r*cos(theta))

Using the solve command with the assumption r >= 0 gives the solutions [r=0, theta=0], [r=1/2, theta=0] and [r=3/2, theta=pi].

However [r=0, theta=pi/2] is also a solution, which the solve command doesn't give me. Why not, and why doesn't if even give a warning that there are more solutions, which are not given?

Cheers!

 

Hi there,

Guess the title is already the full question. I want to write mathematical expressions in 2D math within a text segment of my Maple 15 document, but it should not be recognised as an execution group. How can I do this?

Cheers!

with(Logic):

logic := a &xor b

Then I get 'Error, invalid neutral operator'.

However the other &xxx operators in Logic do not error.

What am I doing wrong, or is it a bug?

the standard xor operator does work though.

I do remember copy and pasting

thoughts and answers please. At the moment I have resorted to the form without the '&'

 

 

Hi all.

Is there a kind soul who can enligthen me on the where abouts of the "print preview" feature in maple 2018?

It does not appear under the "file" -> "print" nor under "file" -> "page setup"

Macbook pro 2018

How do I create a timing diagram simular to

Image result for timing diagram

I do the following:-

1. 

2. TTdf := TruthTable(logic, form = MOD2)

I have tried the statistics package and the timing package. The problem is I get something like

Convert to matrix and add first column to indicate time, e.g 

Where we get an angle rise instead of a vertical rise.

I have also tried it in statistics. The best graph I can get is 

Also tried with no fill and with boarder around the columns, but still cannot get it to look right.

Help much appreciated. Really the Timing Graph should really be available in the Logic Package

Really I want to be able to split the Dataframe into seperate line graphs with a vertical rise and not a angle rise.

Any help would be much appreciated.

P.S I am still learning Maple. I have Maple 2018

Is there a way to put the 2 following animations together and synchronize them?

Maplesoft Help has an example of how to create the animation.  See last example on
https://de.maplesoft.com/support/help/maple/view.aspx?path=plots%2fanimate

but I couldn't get it to work on my Maple version 2015.

plots[animate](plot, [[cos(t), sin(t), t = 0 .. A]], A = 0 .. 2*Pi, scaling = constrained, frames = 50)

with(plots);
BACK := plot(sin(x), x = 0 .. 2*Pi);
oneFrame := proc (t) options operator, arrow; pointplot([t, sin(t)], color = blue, symbol = circle, symbolsize = 18) end proc;
animate(oneFrame, [t], t = 0 .. 2*Pi, background = BACK);

WC23_Unit_circle_and_sinewave_together.mw

I am rather new to using maple so I'm not super familiar with the syntax and sometimes get confused with some of my output. With that said, I am trying to derive some equations symbolically that can later be computed in Fortran. This requires that I find the Eigenvectors of a symbolic 5×5 matrix. I computed the eigenvalues with little problem, however, I cannot seem to compute the Eigenvectors with Maple (not sure if its a syntax issue or what). Here is my code where I am trying to determine the Eigenvectors of A. Any help and advice is appreciated.

E := [q2, q2^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q2*q3/q1, q4*q2/q1, q5*q2/q1+q2*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q2/q1]

F := [q3, q2*q3/q1, q3^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q4*q3/q1, q5*q3/q1+q3*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q3/q1]

G := [q4, q4*q2/q1, q4*q3/q1, q4^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q5*q4/q1+q4*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q4/q1]

Ebar := expand(E*xi_x+F*xi_y+G*xi_z)

U := [q1, q2, q3, q4, q5, q6]

with(VectorCalculus);
A := subs(q1 = rho, q2 = rho*u, q3 = rho*v, q4 = rho*w, q5 = rho*e, q6 = rho*nu, Jacobian(Ebar, U));

A := subs(e = P/((gamma-1)*rho)+(1/2)*u^2+(1/2)*v^2+(1/2)*w^2, A)

A := subs(P = rho*c^2/gamma, A)

A := simplify(A)

with(LinearAlgebra);
EigA := simplify(Eigenvalues(A));

with(LinearAlgebra);
EigenVectorA = Eigenvectors[A];

 

I have tried specifying which eigenvalue to take the eigenvector with respect to also with different synaxes but none seem to work. I am not claiming the last line of code should be correct, but am looking for how to make it correct. Sorry if I left out any information and thank you so much for your suggestions.

 

 

How to express the part of  unstable curve with a dashline.   Hope someone can help me achieve this.  

>  

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3*exp(I*B(t[2]))*exp(-I*B(t[2]))+((1/2)*I)*alpha[1](t[1], t[2])*A(t[2])*exp(I*B(t[2]))*exp(-I*B(t[2]))+I*(diff(A(t[2]), t[2]))*exp(I*B(t[2]))*exp(-I*B(t[2]))-A(t[2])*(diff(B(t[2]), t[2]))*exp(I*B(t[2]))*exp(-I*B(t[2]))-(1/2)*f0*exp(I*sigma*t[2])*exp(-I*B(t[2]))

(13)

combine(%, 'exp');

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3+((1/2)*I)*alpha[1](t[1], t[2])*A(t[2])+I*(diff(A(t[2]), t[2]))-A(t[2])*(diff(B(t[2]), t[2]))-(1/2)*f0*exp(I*sigma*t[2]-I*B(t[2]))

(14)

subs(I*B(t2)=I*sigma*t2-I*C(t2),B(t2)=sigma*t2-C(t2), %);

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3+((1/2)*I)*alpha[1](t[1], t[2])*A(t[2])+I*(diff(A(t[2]), t[2]))-A(t[2])*(diff(sigma*t[2]-C(t[2]), t[2]))-(1/2)*f0*exp(I*sigma*t[2]-I*(sigma*t[2]-C(t[2])))

(15)

conds := combine(%, 'exp');

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3+((1/2)*I)*alpha[1](t[1], t[2])*A(t[2])+I*(diff(A(t[2]), t[2]))-A(t[2])*(sigma-(diff(C(t[2]), t[2])))-(1/2)*f0*exp(I*sigma*t[2]-I*(sigma*t[2]-C(t[2])))

(16)

convert(conds, 'trig');

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3+((1/2)*I)*alpha[1](t[1], t[2])*A(t[2])+I*(diff(A(t[2]), t[2]))-A(t[2])*(sigma-(diff(C(t[2]), t[2])))-(1/2)*f0*(cos(C(t[2]))+I*sin(C(t[2])))

(17)

cond1 := collect(coeff(%, I, 0), [diff(A(t2), t2), cos(C(t2))]);

(3/8)*alpha[2](t[1], t[2])*A(t[2])^3-A(t[2])*(sigma-(diff(C(t[2]), t[2])))-(1/2)*f0*cos(C(t[2]))

(18)

cond2 := collect(coeff(`%%`, I, 1), [diff(A(t2), t2), sin(C(t2)), cos(C(t2))]);

(1/2)*alpha[1](t[1], t[2])*A(t[2])+diff(A(t[2]), t[2])-(1/2)*f0*sin(C(t[2]))

(19)

A(t2):= A; C(t2):=C; cond1 = 0; cond2 =0;

A

 

C

 

(3/8)*alpha[2](t[1], t[2])*A^3-A*sigma-(1/2)*f0*cos(C) = 0

 

(1/2)*alpha[1](t[1], t[2])*A-(1/2)*f0*sin(C) = 0

(20)

remove(has, cond1, cos)^2+remove(has, cond2, sin)^2 = simplify(select(has, cond1, cos)^2+select(has, cond2, sin)^2, 'trig');

((3/8)*alpha[2](t[1], t[2])*A^3-A*sigma)^2+(1/4)*alpha[1](t[1], t[2])^2*A^2 = (1/4)*f0^2

(21)

af_eq:=%;

((3/8)*alpha[2](t[1], t[2])*A^3-A*sigma)^2+(1/4)*alpha[1](t[1], t[2])^2*A^2 = (1/4)*f0^2

(22)

 alpha[1]:=0.0087;alpha[2]:=2.5871;f0:=f[0]

0.87e-2

 

2.5871

 

f[0]

(23)

 

 

 

 

##

 

 

e:='e':    f0:='f0':   alpha[1]:='alpha[1]':   alpha[2]:='alpha[2]':

cond1;

(3/8)*alpha[2](t[1], t[2])*A^3-A*sigma-(1/2)*f0*cos(C)

(24)

cond2;

(1/2)*alpha[1](t[1], t[2])*A-(1/2)*f0*sin(C)

(25)

``

linalg[jacobian]([-cond2,-cond1/A],[A,C]);

Matrix(2, 2, {(1, 1) = -(1/2)*alpha[1](t[1], t[2]), (1, 2) = (1/2)*f0*cos(C), (2, 1) = -((9/8)*alpha[2](t[1], t[2])*A^2-sigma)/A+((3/8)*alpha[2](t[1], t[2])*A^3-A*sigma-(1/2)*f0*cos(C))/A^2, (2, 2) = -(1/2)*f0*sin(C)/A})

(26)

 

``

subs(cos(C)=solve(cond1,cos(C)),sin(C)=solve(cond2,sin(C)),%);

Matrix(2, 2, {(1, 1) = -(1/2)*alpha[1](t[1], t[2]), (1, 2) = (1/8)*A*(3*alpha[2](t[1], t[2])*A^2-8*sigma), (2, 1) = -((9/8)*alpha[2](t[1], t[2])*A^2-sigma)/A+((3/8)*alpha[2](t[1], t[2])*A^3-A*sigma-(1/8)*A*(3*alpha[2](t[1], t[2])*A^2-8*sigma))/A^2, (2, 2) = -(1/2)*alpha[1](t[1], t[2])})

(27)

``

map(simplify,%):

``

linalg[charpoly](%,lambda):

``

p:=collect(%,lambda);

(1/4)*alpha[1](t[1], t[2])^2+lambda*alpha[1](t[1], t[2])+lambda^2+(27/64)*A^4*alpha[2](t[1], t[2])^2-(3/2)*A^2*alpha[2](t[1], t[2])*sigma+sigma^2

(28)

 

``

coeff(p,lambda,0);

(1/4)*alpha[1](t[1], t[2])^2+(27/64)*A^4*alpha[2](t[1], t[2])^2-(3/2)*A^2*alpha[2](t[1], t[2])*sigma+sigma^2

(29)

 

``

stab_cond:=%;

(1/4)*alpha[1](t[1], t[2])^2+(27/64)*A^4*alpha[2](t[1], t[2])^2-(3/2)*A^2*alpha[2](t[1], t[2])*sigma+sigma^2

(30)

 

``

af_eq;

((3/8)*alpha[2](t[1], t[2])*A^3-A*sigma)^2+(1/4)*alpha[1](t[1], t[2])^2*A^2 = (1/4)*f0^2

(31)

``

with(plots, implicitplot,implicitplot3d):

 

 f0 :=0.1; alpha[1]:=0.0087;alpha[2]:=2.5871;

.1

 

0.87e-2

 

2.5871

(32)

 

``

p1:=implicitplot(stab_cond,sigma = -1.2 .. 2, A = 0 .. 2,  numpoints = 20000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, A], labelfont = [SYMBOL, 16],color="Green",tickmarks=[9,12],thickness=2,linestyle=dash):

``

with(plots,textplot):    with(plots,display):

``

ps1:=textplot([0.75, 0.65, "Unstable region"], 'align' = {'above', 'right'},rotation = 0.6, font=[Times,bold,12]):

``

pu1:=implicitplot(af_eq,sigma = -1.2 .. 2, A = 0 .. 2,  numpoints = 20000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, A], labelfont = [SYMBOL, 16],color="red",tickmarks=[9,12],thickness=2):

pp1:=display({p1,ps1,pu1});

 

Like this picture.

 


 

Download how_to_draw_the_dashline_part.mw

A catenoid is the minimal surface between two 3D circles which are co-axial and parallel.

Is there a technique for finding the formula for the minimal surface if the circles are "stretched" into ellipses with proportional major and minor axes?

After a lengthy series of calculations, I would like to save all the variables and matrices I've constructed for use in a) a seperate window, and b) for a fututre session after closing and reopening maple. I don't want to have to perform the calculations each time I open maple.

 

Thanks! 

Getting undefined terms in pdsolve output. Am I expecting too much of pdsolve to be able to solve such complex systems? If so, is there another way I could go about trying to solve such a system with approximations rather than analytically.

Here is the system which produces the undefined terms when solved using pdsolve:

[-(diff(w[3](y, z), y))+cos(z)*(exp(-y)-1)*((1/2)*exp(-y)*sin(2*z)*y-(1/2)*exp(-y)*sin(2*z))-v[2](y, z)*sin(z)*exp(-y)-sin(z)*(exp(-y))^2*cos(2*z)*y-(1/2)*(exp(-y))^2*sin(2*z)*y*cos(z)-(diff(w[3](y, z), y, y)) = 0, w[3](0, z) = 0, w[3](infinity, z) = 0]

 

Get the following for w[3](y,z):

(1/8)*((y^2+4*y-1)*sin(3*z)+(y^2-4*y+3)*sin(z)+undefined)*exp(-y)-3*exp(-2*y)*sin(z)*(1/8)+(1/8)*exp(-2*y)*sin(3*z)+undefined

Code below:

restart;

with(PDEtools); umain := 1-exp(-y)+sum(A^i*u[i](y, z), i = 1 .. 5); vmain := -1+sum(A^i*v[i](y, z), i = 1 .. 5); wmain := sum(A^i*w[i](y, z), i = 1 .. 5); pde[main] := diff(vmain, y)+diff(wmain, z); pde[main[2]] := vmain*(diff(wmain, y))+wmain*(diff(wmain, z))-(diff(wmain, y$2));

sys[1] := [A*coeff(pde[main[2]], A) = 0, w[1](0, z) = sin(z), w[1](infinity, z) = 0]; pdsolve(sys[1]); w[1] := proc (y, z) options operator, arrow, function_assign; sin(z)*exp(-y) end proc; pdex[1] := diff(w[1](y, z), z)+diff(v[1](y, z), y) = 0; pdexbound := v[1](0, z) = 0; sysx[1] := [pdex[1], pdexbound]; pdsolve(sysx[1])

v[1] := proc (y, z) options operator, arrow, function_assign; cos(z)*(exp(-y)-1) end proc

for i from 2 to 3 do pde[i] := coeff(pde[main[2]], A^i) = 0; sys[i] := [pde[i], w[i](0, z) = 0, w[i](infinity, z) = 0]; pdsolve(sys[i]); assign(op(0, lhs(pdsolve(sys[i]))) = unapply(rhs(pdsolve(sys[i])), op(lhs(pdsolve(sys[i]))))); sysx[i] := [diff(w[i](y, z), z)+diff(v[i](y, z), y) = 0, v[i](0, z) = 0]; pdsolve(sysx[i]); assign(op(0, lhs(pdsolve(sysx[i]))) = unapply(rhs(pdsolve(sysx[i])), op(lhs(pdsolve(sysx[i]))))) end do

 

Hello

The problem is translate Mathematica code to Maple to find  numerical solution using int(numeric).

I have a more complicated example and here I gives a very simplified version.

I use  successive approximations to solve integral-equation with symbolic int it's easy to do,but with numeric int  I'm failed

MMA code:

func[x_, 0] := x
ifunc[0][x_] := x
func[x_?NumericQ, n_Integer] := x + NIntegrate[(x - y)*ifunc[n - 1][y], {y, 0, x}]
ifunc[j_Integer] := ifunc[j] = Interpolation[Table[{x, func[x, j]}, {x, -3, 3, 0.2}]]

Plot[{Sinh[x], ifunc[n][x] /. n -> 4}, {x, -3, 3}]


My first attempt to translate:

ifunc := proc (n, x) options operator, arrow; x end proc;

ifunc(0, x) := x;

func(x, 0) := x;

func := proc (x, n) x+int((x-t)*ifunc(n-1, t), t = 0 .. x, numeric) end proc;

T := proc (j) option remember;

Interpolation:-Interpolate([seq(x, x = -2 .. 2, .1)], [seq(func(x, j), x = -2 .. 2, .1)], method = cubic)

end proc;

plot([sinh(x), (T(4))(x)], x = -2 .. 2);

See attached file for more info.

Thanks.

test_numeric_volterra.mw

EDITED :----------------------------------------------------------

Third attempt:

func(x, 0) := x;

(ifunc(0))(x) := x:

func := proc (x, n) option remember; x+int((x-t)*(ifunc(n-1))(t), t = 0 .. x, numeric) end proc;

ifunc := proc (j) local f; option remember;

ifunc(0) := proc (t) options operator, arrow; t end proc;

f := proc (t) options operator, arrow;

CurveFitting:-Spline([seq(x, x = -3 .. 3, .1)], [seq(func(x, j), x = -3 .. 3, .1)], x, degree = 1) end proc end proc;

n := 4; plot([sinh(x), (ifunc(n))(x)], x = -3 .. 3)# for n=4 diverge !!!

Could someone explain to me why this f[+*/]ing program doesn't simplify a simple equation like this:

simplify(F*R=(1/2*M*R^2)*(a/R),symbolic,assume= positive)

 

It returns F*R=(M*R*a)/2 which obviously is wrong. (The correct output would be F=1/2*M*a)

 

How do I fix this, all the other posts I read use either symbolic or assume positive. 

I am trying to get the output of pdsolve to be assigned to the function it is being solved for but I am having issues with 'too many levels of recursion... Below is my code. Would appreciate any advice on how to get around this. I would also like any solution to eventually work within a 'for' loop.

restart; with(PDEtools);
umain := 1-exp(-y)+sum(A^i*u[i](y, z), i = 1 .. 5);
vmain := -1+sum(A^i*v[i](y, z), i = 1 .. 5);
wmain := sum(A^i*w[i](y, z), i = 1 .. 5);
pde[main] := diff(vmain, y)+diff(wmain, z);
pde[main[2]] := vmain*(diff(wmain, y))+wmain*(diff(wmain, z))-(diff(wmain, y$2));

sys[1] := [A^i*coeff(pde[main[2]], A) = 0, w[1](0, z) = sin(z), w[1](infinity, z) = 0];

for i from 2 to 5 do pde[i] := A^i*coeff(pde[main[2]], A^i) = 0; sys[i] := [pde[i], w[i](0, z) = 0, w[i](infinity, z) = 0] end do;


pdsolve(sys[1]);
w[1] := proc (y, z) options operator, arrow, function_assign; pdsolve(sys[1]) end proc;
w[1](y, z);
Error, (in w[1]) too many levels of recursion

First 781 782 783 784 785 786 787 Last Page 783 of 2427