Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi

How to associate the Pi curve with its Qi name, ( for example P1 is the name of the curve Q1) starting from the RandomTools random command

Thanks for ideas

Question.mw

 

I have the first and second fundamental forms of a surface. The Bonnet theorem tells me that this is enough to determine a surface in Euclidean space. Has this theorem been implemented in Maple?

Dear friends, please, I would like to ask for your help with the following problem. 

When I try to compile a code like the following 

P:= proc(n)
m:= floor(log[10](n));
A:= Array(1..m);
end proc:

I get the error "Error, (in CodeGeneration:-IssueError) cannot analyze non-integer range boundary m". 

Could you please assist me in overcoming this problem? Many thanks in advance. 

This is my first time using Maple and I want to use Maple to check the exact solution to a pde.

My pde is  -e(u_xx + u_yy) + a*u_x = x(1-p^2 *x)*sin(ly) and the exact solution is u(x,y) = (Ax^2 + Bx +C)*sin(ly)

where A = -p, B = (1-2aA)/p, C = (2eA - aB) and p = el^2

I tried the following in Maple,

pde := -e*(diff(u(x, y), x, x) + diff(u(x, y), y, y) )+ a*diff(u(x, y), x) - x*(-p^2*x + 1)*sin(l*y) = 0

and i get the result below which I don't understand.

How do I do the right thing in order to check my exact solution.

 

Thanks

 

1. Write a procedure that enables to compute the volume of a cone. Remember that a cone volume can be calculated using the following equation:

𝑉𝑜𝑙𝑐𝑜𝑛𝑒 =1/3𝜋𝑟2ℎ
with r and h generated randomly, both in the range from -100 to 100.

If Maple returns negative figures for r and h, ask it to replace these values with their absolute values.

If Maple returns 0 for r and h, Maple asks directly the user to input desired values.


2) With reference to point 2, you have the following matrix:

[
−65 1 32
1 −12 3

12 −2 2
]
Write a procedure that chooses randomly two numbers from the above matrix and assigns them to r and h. Then, it compares the two cone volumes and returns the largest value.

I was plotting some 3d stuff and wanted to animate it. I used orientation in the plot3d to get the orientation I wanted. When trying to animate them the orientation is ignored.

Specifically though I'm suing Pk = plot3d(...);
then animate(display, [P1, ..., Pn]);
 

(more or less, my real code is more complex but that is the idea).

Where can I tell animate to use a specific orientation? I tried adding it to the options of display but it didn't work either. Seems animate and display completely ignore orientation.

 

 

 

How can I remove the extra whitespace around a 3D plot and also scale it so it takes up quite a bit of the window so I can see more detail?

If I use a density plot then I can set the size using

_SP := proc(P,sz::[posint,posint] := [1200,500])
  op(0,P)(remove(type,[op(P)],'specfunc(ROOT)')[],
          ROOT(BOUNDS_X(0),BOUNDS_Y(0),
               BOUNDS_WIDTH(sz[1]),BOUNDS_HEIGHT(sz[2]))):
end proc:

 

to get exactly what I want. With 3D plot there is a lot of whitespace. I'd rather use plot3d since it is more confirgurable but I need to be able to remove all that additional whitespace(which I guess has to do with rotation in 3D, but here I'm not rotating it, although I might want to in some cases).

 

I am trying to solve a differential equation numerically. But I am facing some difficulties. It is saying that ODE system has a removable singularity at r = 0. How can I remove the singularity?  Please check the attached figure and try to help.

hello i am trying to remove "[ ]" from an expression so it can be used inside a solve function.

the problem is (eqs) has an "[ ]" outside the expression so it lookslike this "[a = c, a = d, 4*a = e, b = 2*e, b = c + 2*d + 2*f]"

how can i remove [] from this expression?

 

code

eq := a*(K + Mn + 4*O) + b*(H + Cl) = c*(K + Cl) + d*(Mn + 2*Cl) + e*(2*H + O) + 2*f*Cl;
elems := [K, Mn, O, H, Cl];
eqr := collect(expand(rhs(eq)), elems);
eql := collect(expand(lhs(eq)), elems);
eqs := zip(`=`, map2(coeff, eql, elems), map2(coeff, eqr, elems));
solve([eq, eqs, a = 1]);

 

thanks

An ellipse of focus F1 and F2 is considered in which the focal length F1F2=2c is equal to the length 2b of the short axis; the length of the long axis is 2a. M being any point of this ellipse, calculate the lengths MF1=x and MF2=y according to a and angle F1MF2 = alpha. What is the maximum value of alpha? Thank you for your help.

When translating initial conditions, for derivatives, to Latex, the output is not easy to read, and was wondering how to make it more standard.

For example, let say initial conditions for second order ODE are [y(0)=0,D(y)(0)=3] in Maple syntax.  I convert these to Latex using

restart;
ic:=[y(0)=0,D(y)(0)=3];
Physics:-Latex(ic)

which gives

               [y \left(0\right) = 0, D\left(y \right)\left(0\right) = 3]

The problem is with derivatives. They are hard to read, unless someone knows Maple. The above renders are

I'd like to get the above to standard form 

Which more easily understood and is the standard in textbooks and papers.

This issue does not show up in Mathematica, because in Mathematica initial conditions can be entered as  {y[0]==0,y'[0]==3} and this translates directly as is

Which renders a

I know in Maple document mode, 2D math input, one can also enter the IC the same as with Mathematica, which is easier, but the Latex translation still the same as with the worksheet 1-D math.

Going back to Maple, I could enter the initial conditions instead as follows

restart;
ic:=[y(0)=0,eval(diff(y(x),x)=3,x=0)];
Physics:-Latex(ic)

And now the latex generated renders as

Which might be more understandble but too heavy weight compared to the simpler form y'(0)=3 and I remember reading that use eval() as above is not as safe as using the D(y)()... notation for initial conditions.

Are there any other tricks that would allow the latex of derivative to show in the standard form to make it easier to read?

Is it possible for Physics:-Latex to automatically detect the form D(y)(x0)=y0 and generate y'(x0)=y0 for its Latex? This will be the ideal solution. This will apply to higher derivatives as well. For example 

Physics:-Latex( (D@@2)(y)(0)=3)

Now gives

         D^{\left(2\right)}\left(y \right)\left(0\right) = 3

which renders as

While a much better output would be the standard

This will go a long way towards improving the Latex generated by Maple.

Any suggestions?

 

 

Hi!

What could be a fast procedure to cancel uncommon factors of terms in such following sets (list) and simplify:

Starting with:

{a*x,b*x, c*(x+y)}

(where a, b and c are numbers or in set of specified variables as well as x and y), I would like as a result:

{x,x+y}

 

Many thanks.

 

Jaqr

Here is my code (will attach a screenshot below with the errors, since the formatting gets wonky if I try to paste it as text)

What might be the problem here? I seem to have proc and end proc, but Maple seems to be dividing my code into two sections, and evaluating them separately

https://imgur.com/a/npbF9NG

Hello again,

I want to maximize a function u(k,x) with the following form

u := (k, x) -> (1 - theta(sP, sL))((p + sP)*q(x) - w(k)*x + sL) + theta(sP, sL)*b(k)

where theta, q, b, w have previously being defined and (sP,sL) are parameters. I want to maximize u and therefore,

with(Optimization):
Maximize(u(k, x), variables = {k, x}, k = 0 .. 1);

My question is how to tell Maple that I want my optimal solution, (k*,x*) to be expressed as a function of (sP,sL)?

 

First, I want to find the set of solutions of this system and then find the steady state vector.

I know that I can find an approximation of the steady state vector ''directly'' if I calculate Pfor big k values (one column of Pk will give me an approximation), but it's not what I want to do. I need the complete set of solutions with a free parameter.

LinearSolve() doesn't give me the set of solutions. See the picture below. Here Q is the transition matrix.

I hope my question is clear (:

First 476 477 478 479 480 481 482 Last Page 478 of 2217