MaplePrimes Questions

Hello. I have certain requirements for drawings. Please tell me, is it possible to implement them when plotting in Maple? Thanks.
Drawing width 15 cm
Be sure to frame and mesh. The thickness of the frame and serifs on the axes is 0.5 pt. Mesh thickness 0.25 pt. The length of the serifs is 1.2 mm.
The thickness of the graph itself is 1 pt
Axis names 10 pt

Is there a similar function as (cylinderplot) to plot convex or concave toroidal shell segments?

This type of shell is as follows.

 

 

Recently, I encountered warnings and errors when size of my list is big. Maple says use array instead of list because of ... . When the list is just a list of numbers or a list of lists of the same size, I can rewrite it as an array, but how about a list like the following?

[seq([[0,0],0],i=1..10)]

This is just an example. So the elements of this list are lists containing a vector (a point in the plane) and a number (a property of this point). One idea is to use two arrays, a two dimensional array for recording the vectors, and one 1-dimensional array for recording the numbers and keep in mind that the i-th number of the second array is related to the i-th vector (row) in the first array. But is there any possibility to have this data recorded similar to when we are using lists, i.e. similar to the above code?

How can I get the follow graph of paraboloidal surfaces (ξ=1,η=2) with the coordinate vectors ξ, η0 , φ0 as shown in the picture.

Realation between cartesian coordinates and paraboloidal :

x=1/2 (ξ2 - η2), y=ξ η cos(φ), z=ξ η sin(φ)

I wrote the following code:

Student:-VectorCalculus

S1 := PositionVector([1/2*(-eta^2 + 1), eta*cos(phi), eta*sin(phi)], cartesian[x, y, z]):

LH := PlotPositionVector(S1, eta = -2 .. 0, phi = 0 .. 2*Pi, coordcurve = [eta = -2, tangent = true, binormal = true, vectornum = 1], scaling = constrained)

S2 := PositionVector([1/2*(xi^2 - 4), 2*xi*cos(phi), 2*xi*sin(phi)], cartesian[x, y, z]):

LG := PlotPositionVector(S2, xi = -1 .. 1, phi = 0 .. 2*Pi, coordcurve = [xi = 1, tangent = true, vectornum = 1], scaling = constrained)

 

And I got the two paraboloidal surfaces with the vectors separently.How can I get only one graph with these two surfaces as shown in the picture (with ξ=1, η=2) ?

If I have a vector like u:=<-2+m,3+m> and then I put m:=5 (for exemple) when I repeat u it doesnot replace the value of m by 5,

instead repeats the initial expression. I would like to find a way to achieve this in order to automate calculations.

This website suggests that the viewer write equations containing differentials and use them to plot topographical lines.

https://mathcurve.com/courbes3d.gb/topographic/topographic.shtml

I am basically familiar with equations containing derivatives, but not with equations containing differentials.

How can one employ these to draw the lines shown in the website's various plots of surfaces?

S := proc (n) local i; for i to n do if i <= n and type(i, divisors(n)) and type(n/i, odd) then sum(i) end if end do end proc

Hello!
I solved a simple PDE numerically and found that I couldn't implement a simple thing!
For example:
restart:
PDE := diff(u(x,t),t)=1/10*diff(u(x,t),x,x);
IBC := {u(x,0)=1, u(0,t)=0, D[1](u)(1,t)=0};
pds := pdsolve(PDE,IBC,numeric);
p1 := pds:-plot(t=0): p2 := pds:-plot(t=1/10):p3 := pds:-plot(t=1/2):p4 := pds:-plot(t=1):
plots[display]({p1,p2,p3,p4});
I got some spatial dependencies for different fixed t. But I want to get opposite! How to get time dependence for fixed x?
Replacing t with x results in an error.
Update.
This equation is example, really I solve this:
PDE := diff(u(x,t),t)+v*(1+k*sin(2*Pi*f*t))*diff(u(x,t),x)=a*diff(u(x,t),x,x);
IBC := {u(x,0)=T__0,u(0,t)=sin(2*Pi*f*t),u(L,t)=T__0};
So sin makes this equation nonlinear, so I need numerical procedure.
 

I have the following function:

f:=t->862.979774+1825.011621/([1+1.54943476*e^(-677.0138344*t)]^(131537/203808))

Is there any way Maple can calculate the indefinite integral of f(t)? I have tried integrating f(t) in a range t=tmin..tmax numerically using dsolve/numeric and plotting the numeric integral and I am satisfied with the result, but I would much prefer an analytic integration so that I obtain some function y(t) that I can later use which will be the indefinite integral of f(t).

So far, I have tried unsuccessfully to obtain an indefinite integral of f(t) using int and dsolve. Thanks in advance.

Hello, 

when trying to solve equation using fsolve, it returns just what i wrote and didn't solve. Can anyone help? I tried all i know. File is attached below.

Thanks a lot.

II.01.mw

 

restart;
f:=(x,y)-> x*y^3-x^2/y^3;
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y));
lis:=[]:
for tmp in op(eq) do
    if has(tmp,alpha) then
       lis:=[op(lis),op(2,simplify(select(has,tmp,alpha)))];
    fi;
od;
lis;
PDEtools:-Solve(lis[1]=lis[2],p)

This method happend to work for this example, but it does not work in general. This is because the function can be anything. Here is a second example

restart;
f:=(x,y)-> -2/3*x+1/3*(x^2+3*y)^(1/2);
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y));

We see by inspection if p=2 then we can write the above as, by setting p=2 as 

But the Maple code I had above does not work on this

restart;
f:=(x,y)-> -2/3*x+1/3*(x^2+3*y)^(1/2);
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y));
lis:=[]:
for tmp in op(eq) do
    if has(tmp,alpha) then
       lis:=[op(lis),simplify(select(has,tmp,alpha))];
    fi;
od;
lis;

The problem is finding all powers of alpha in each term and setting up an equation to find p such that all terms have same numerical value.

So I abandoned this method as too messy to program (it works well for hand solution, this is an example where solving something by hand is easier than on the computer) and then tried solve directly, like this (on the first example)

restart;
f:=(x,y)-> x*y^3-x^2/y^3;
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^r*f(x,y)=0;

And here is where I am stuck. I need to ask Maple if it can find alpha, r that are rational numbers, such that the above equation is solved.

PDEtools:-Solve(eq,[p,r])

But we know from above that p=1/6 and r=3/2 is solution

simplify(subs([p=1/6,r=3/2],eq))

             0=0

The question is: Can Maple solve such an equation for  p,r? I remember now reading something about parameteric solver in Maple. I need to look that up to see if it helps. I tried SolveTools:-SemiAlgebraic on this, but it did not help.

Are there better methods to determine in Maple if function is isobaric and to find the index p and r?

Reference: book

Notice, some places define isobaric function as one in which we can find p such that

But this is not correct. I've seen it on 2 pages on the net. The correct definition is 

Also note: When p=1 isobaric function becomes a homogeneous function which is special case of isobaric and r is now called the degree of homogeneity 

But for isobaric, p do not have to be 1. This is the main difference.

f(x,y) will always be a function of x,y.  I will add more examples of isobaric functions to test against.

edit. Simplified question is restated below

After looking more into this. I found I actually wanted to solve the simpler problem, which is

So please ignore the general case of isobaric where r<>p-1 which is harder. 

I only need to look at this case where r=p-1 which is actually simpler. It turned out this is what I need for my solver and not the general case.

I will now give my solution to this and show where the problem I am having.

I am using Maple solve to find p. So no r any more. Only solving for one variable. But Maple solve fails sometimes. And this is the problem.

The problem is that solve can find p for many cases, but fails on some, where there is clearly a solution. I will show 5 examples below.

#example 1. WORKS
restart;
f:=(x,y)-> 3*sqrt(x*y);
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

#example 2. WORKS
restart;
f:=(x,y)-> 4*(x*y)^(1/3);
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

#example 3. WORKS
restart;
f:=(x,y)-> (-3*x^2*y-y^2)/(2*x^3+3*x*y);
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

#example 4 WORKS
restart;
f:=(x,y)-> (-(x*y)/2+sqrt(x^2*y^2-4*y)/2)*y;
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

And here is the one that does not work

#Example 5. Does not work. How to make it work?
restart;
f:=(x,y)-> -2*x/3+sqrt(x^2+3*y)/3;
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

There is a solution for this. p=2 works. Why solve did not find it? I mean, it gives RootOf, which does not help me decide if this is isobaric or not. Why it did not find the solution p=2?

simplify(subs(p=2,eq)) assuming alpha>0

                 0=0

Using Mathemtica, it found p=2 solution. How to make Maple find this solution is my question.

Sorry for the long question. I first thought I needed the general isobaric case, but found later i needed the simpler one.

 

 

Plot the wedge cut from the cylinder x²+y²=1 by the planes z=-y and z=0.

Plot the solid that lies between the cylinder z= y^2 and the xy -plane that is bounded by the planes x = 0, x =1, y = −1, y =1.

Hi, 
I want to solve a simple newsvendor problem for general Demand Probability Distribution with maple code.
let, 
Underage cost 
                              c[u]

Overage cost 
                              c[o]

Demand (
D;
) follows pdf 
f(.);
 and CDF 
F;

(.);


Decision varible is quantity 
q;


So cost function is 

TC := piecewise(q-D >= 0, c[o]*(q-D), q-D < 0, c[u]*(-q+D));
 piecewise(0 <= q - D, c[o] (q - D), q - D < 0, c[u] (-q + D))

After taking expectation of TC and derivating it w.r.t q we will get 
q;
* as critical fractile i.e.

q*= F^(-1) (
                             c[u]    
                          -----------
                          c[u] + c[o]
)      i.e. F inverse (
c[u]/(c[u]+c[o]);
)

Can someone please help me how to find q* in MAPLE using solve() or any other function?

 

Thanks in Advance!

This might be something basic. But looking at help I do not see it now.

why has(expr,sqrt) do not give true?  is something special about sqrt function?

restart;
mysol :=sin(x);
has(mysol,sin); #works

mysol :=ln(x);
has(mysol,ln);  #works

mysol :=sqrt(x);
has(mysol,sqrt);  #does not work
hasfun(mysol,sqrt);  #does not work

Just wondering why, that is all. Only this worked

hastype(mysol,sqrt)

                true

I am sure there is a good reason for this. sqrt seems to be special function.

Maple 2020.2

First 336 337 338 339 340 341 342 Last Page 338 of 2308