Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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

Hello Everybody,

For a numerical evaluation of the inverse Laplace transform, the Gaver-Stehfest Method generally works well for quite many usual functions. However, the function of interest stated below, which results from solving a mathematical physical problem, seems to pose severe problems using this algorithm. Ths solution is found to be strongly oscillating and non converging.

>> I was wondering whether someone here could try to help a bit to invert numerically the following complicated function.

Thank you

Fede

 

1/(s^2*(1+(1-1/(2+2*s))/s)*(1+tan((1/2)*Pi/sqrt((1-1/(2+2*s))/s))/sqrt((1-1/(2+2*s))/s)))


 

restart

Eq3 := lambda*((1/2)*cos(mu*xi)^(2*beta)*a*lambda+(-beta^2*mu^2-c)*cos(mu*xi)^beta+mu^2*beta*(beta-1)*cos(mu*xi)^(beta-2))

lambda*((1/2)*cos(mu*xi)^(2*beta)*a*lambda+(-beta^2*mu^2-c)*cos(mu*xi)^beta+mu^2*beta*(beta-1)*cos(mu*xi)^(beta-2))

(1)

NULL


 

Download mapleprime2.mw

Please help me with the following worksheet containg a sample Equation. I need to equate the exponent and co-efficents of the cosine function

 

Please explain a method (including corresponding commands) to find first positive real root(s) of a large matrix determinant, briefly. Since each entry or element of the matrix involves with the large formula, probably Newton Iterative method is suitable. The main question is, how it is possible to define some matrices like the Hessian or gradient matrices, when calculating parametric solution of determinant is a very time consuming procedure.

Let assume that only one independent variable exists. After evaluating matrix value at a certain amount of independent variable, the determinant can be calculated swiftly. The problem is that the derivative of determinant in each step will be calculated slowly. How one can rectify this deficiency in Newton Iterative method? For example, is there another iterative method to find derivative of determinant at a certain amount of independent variable to use it in the Newton iterative method?

 

Hello dear users!

I have a problem, that I can not explain, and solve by myself. I have a function. It is an integral function, looks like this:

If I looking for a value such as LL(4) or LL(5) I got different value what i except from the plot of the function:

while, for example: evalf( LL(3))=1.6829

 

Can somebody explain to me, what is going on?

 

Also, if i want to solve the functiuon backwards with fsolve (so im looking for the phi values with the added LL(phi) value, sometimes I got results and sometimes not. (and not where the distruption is, because I know there the values go from -infinity to infinity). Can somebody help me in this too?

Thank you very much!

 

 

Hello

I have a question respective to the display of calculated numbers.

Is there a way to display the "correct" value of a calculated float or absurd fraction?

I tried it with evalf(), convert(rational) but without success.

 

To be concrete I calculate the Given Rotation matrices of

A := Matrix(3, 3, [[-3, 32/5, 4], [4, 24/5, 3], [5, 6*sqrt(2), 5*sqrt(2)]])

G := Matrix(3, 3, [[-3/5, 4/5, 0], [-4/5, -3/5, 0], [0, 0, 1]])

which results in the followin (correct) matrix

Matrix(3, 3, {(1, 1) = 5, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = -8, (2, 3) = -5, (3, 1) = 5, (3, 2) = 6*2^(1/2), (3, 3) = 5*2^(1/2)})

 

But using the method

Given1 := GivensRotationMatrix(A[1], 1, 2);

I get following weird approximated matrix

Matrix(3, 3, [[-(15/1249)*sqrt(1249), (32/1249)*sqrt(1249), 0], [-(32/1249)*sqrt(1249), -(15/1249)*sqrt(1249), 0], [0, 0, 1]])

Just look at the the cell a11 which should be -3/5 but with GivensRotationmatrix() I get this totaly

weird fraction -15*sqrt(1249)*(1/1249). I tried simpliefed, evalf, convert(ration) but never get the result of -3/5.

Maybe someone can help me? :)

 

EDIT

Writing maple code in this editor is a pain in the ass.

Isnt "Maple Math" wortking?!

I am trying to get Maple to understand, and evaluate the following integral analytically AND numerically.  
The original integrand to be evaluated is given by 

(w + m2)(1/4) (p2 + mu)(1/4) / ( (w2 +a2)2 (p2 +a2) (q2 + b2 2)2 ((p - q + w)2 + b12) )

which is to be integrated simultaneously with respect to dw dp dq (where w, p, q are 3-d vectors).  
Limits of integration are (in cartesian co-ordinates) from -Infinity to + Infinity

All variables contained in the integrand are Real and >0.
a, m, mu, b1, b2 are constants and >0.  
dp = d3p, dq = d3q, dw = d3w
p2=p2, w2=w2, q2=q2

It is of course possible to help Maple along by noting that 
(p - q + w)= p2 + q2 + w2 - (2 p q Cos(\theta_pq) ) + (2 p w Cos(\theta_pw) ) - (2 q w Cos(\theta_wq) ) + b12 
where \theta_pq is the angle between vectors p and q, theta_pw is the angle between vectors p and w, etc. 

However, using the expanded form of (p - q + w)2 would imply that the integral would now need to be written out in tems of 
dwradial, dqradial, dpradial, d\theta_w, d\theta_q, d\theta_p, and d\phi_w, d\phi_q, d\phi_p.
Now, the integral in spherical co-ordinates would be given by the pseudocode below (note that now there are no longer any vector symbols, and the limits of integration have changed)

int ( Sin(\theta_w) d\theta_w Limits {0, pi}) int ( w2 dwradial Limits:{0, Infinity} )
int ( Sin(\theta_p) d\theta_p Limits {0, pi}) int ( p2 dpradial Limits:{0, Infinity} )
int ( Sin(\theta_q) d\theta_q Limits {0, pi}) int ( q2 dqradial Limits:{0, Infinity} )

where we have omitted the integration over \phi_w, \phi_p, \phi_q, assuming that there is no dependence on the \phi angles, resulting in all the \phi angles being integrated over, with the result being a constant multiplied to the rest of the remaining integrals. No additional information on the vectors is available, e.g. the angle between p and q, p and w, q and w, are not specified, the magnitude of the vectors is not specified. 

Any ideas if Maple can understand and execute the integral with p, q, w are input as vectors in the integrand directly, as shown earlier?
If it's easier for Maple to evaluate the integral in spherical co-ordinates, any suggestions on setting up the input, i.e. set up that the variables and constants are real, setup the limits of the theta and radial components etc. would also be appreciated. 

Supposing I have a n x n matrix and I want to convert it from linear to subscript indices

I have this expression which I want to integrate numerically, but it is exponentially slow. I tried methods like _d01ajc but it does not help.

 

restart;

f2 := proc (m) options operator, arrow;

evalf(Int(exp(-(2*m-4)*exp(t)+t*(m+1))*(t-2*exp(t)), t = 0 .. infinity))

end proc;

 

plot([f2], 3 .. 10)

Good day all, I have a yet challanging integration problem. The problem is to find the numerical solution of the problem:
Eq1 := x(t) = x(b)+c*t+k*x(b)*t-k*(int((t-s)*x(s), s = 0 .. t))+2*(int(sqrt(t-s)*x(s)^3, s = 0 .. t))/sqrt(Pi)

I differentiated Eq1 wrt x as follows:Eq2 := diff(Eq1, t)

Lastly, on typing sol := dsolve({Eq2, x(0) = x(b)}, x(t), numeric)

I got an error messag. Please all the valuable suggestions given to me on a similar problem could not solve this one as this appears to be a little complex when compared to my previous question. Please I need your help. Thanks

 

 

First 770 771 772 773 774 775 776 Last Page 772 of 2219