Kitonum

21550 Reputation

26 Badges

17 years, 122 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
a:=3: R:=7: z:=sqrt(R^2-(r-a+R)^2):
plot3d([[r,phi,z],[r,phi,-z]], phi=0..2*Pi, r=2..3, coords=cylindrical, scaling=constrained);

                               


The formula  sqrt(R^2-(r-a+R)^2)  was obtained by elimination  phi  from the system  { z=R*cos(phi), r=a-R*(1-sin(phi))

Edit. I added the option  scaling=constrained so that you can watch the form change depending on the parameters change.

 

 

In my opinion the simplest way is to use a triple for-loop:

restart;
C := y^2*z + y*z^2 = x^2:
for x in {0,1} do
for y in {0,1} do
for z in {0,1} do
if C then print(['x','y','z']=[x,y,z]) fi;
od: od: od:

                                      

 

To plot a 3-variable equation, you must use  plots:-implicitplot3d  command. To get the best quality we can first express  z  through  x  and  y and then plot:

restart;
eq:= x^2-y^2*z-y*z^2;
plots:-implicitplot3d(eq,x=0..1,y=0..1,z=-7..7, style=surface, grid=[40,40,40]);
solve(eq, z);
plot3d([%], x=0..1,y=0..1, style=surface);


Edit. A more interesting picture is obtained if we increase the ranges for  x  and  yx=-1..1, y=-1..1. It is worth noting one drawback of  plot3d  command in this example: Maple does not draw a surface near z-axis. This is due to the fact that for small values of  y , the value of  z  tends to infinity. The use of  plots:-implicitplot3d  command does not have this drawback. We get good quality when used together  plot3d  and  plots:-implicitplot3d :

restart;
eq:= x^2-y^2*z-y*z^2;
A:=plots:-implicitplot3d(eq,x=-1..1,y=-1..0.01,z=-5..5, style=surface, grid=[50,100,50]):
Sol:=solve(eq, z);
B:=plot3d([Sol], x=-1..1,y=-1..1, view=-5..5, style=surface, axes=normal, grid=[500,500]):
plots:-display(A,B, view=[-1..1,-1..1.2,-5..5]);

                       

Let's help Maple a little. If  t^2 - 4 = s^2 - 4  and  t<>s  then  s = -t . Below we get that there will be infinitely many double points:

restart;
x:=t->sin(t): y:=t->t^2-4:
solve({sin(t)=sin(s),s=-t}, AllSolutions);
eval(%, _Z1=k);
[x,y]=eval([x(t),y(t)], %) assuming k::posint;  # All the double points
# k = 1, 2, 3, ...

                               [x, y] = [0, Pi^2*k^2-4]


The numerical solution:

restart;
x:=t->sin(t): y:=t->t^2-4:
Sys:=[x(t)=x(s),y(t)=y(s)]:
plots:-implicitplot(Sys, t=-10..10,s=-10..10, color=[red,blue], gridrefine=3);
fsolve(Sys, {t=-4..-1,s=1..4});
fnormal(eval([x(t),y(t)], %));

                                    [0., 5.869604404]

Because there are many solutions, then the plot is needed to isolate the root.

With local, you made a new name (it's not clear why?) from the command  pdetest . Just replace the line local pdetest := (ans, de1)  with the line  test := pdetest(ans, de1)

restart;
did:=D^14+23*D^13+144*D^12-30*D^11;
subsindets(did,symbol^integer,t->(D@@degree(t))(y)(x));
convert(%, diff);

            

 

 

 

You can use a common  if ... fi:  for this:

restart;
str:="A";
x:=10;
if x=10 then str:=cat(str," it was 10"); x:=11 else
str:=cat(str," it was not 10"); x:=9 fi;


Edit.

See help on the  evala  command. Also the  Algebraic  package may be useful for you.

You forgot to call the package  plots . Insert  with(plots):  at the beginning of your worksheet.

Replace in the code the dot  .  with the multiplication sign  * .

The corrected file 

test1_03_new.mw

The error you receive says that Maple does not have the  FourierSeries  package.

You can freely download the  OrthogonalExpansions  package from the Maple Application Center. This package contains a number of commands for working with Fourier series.

https://www.maplesoft.com/applications/view.aspx?SID=33406

(rhs@op)~([rootsq0]);

 

There will be infinitely many positive solutions too. Below we find the smallest:

restart;
eq := 61*x^2 + 1 = y^2;
[isolve(eq)];
map(t->eval([x,y],t),%);
map(t->expand(eval(t,_Z1=1)), %);
[x,y]=~select(t->t[1]>0 and t[2]>0, %)[];

                     [x = 226153980, y = 1766319049]


Edit. It is convenient to find the desired solutions using the procedure:

restart;
Eq := 61*x^2 + 1 = y^2:
Sol:=n->subsindets(eval(isolve(Eq)[4],_Z1=n),realcons,expand):

# Examples of use:
Sol(1);
Sol(2);

                      

 

In fact, your example is on optimization with a parameter  a . The commands of simbolic optimization  minimize  and  maximize  can solve such examples only in very simple cases, for example  minimize(a*x+3, x=0..1);  , a little more difficult   minimize(x^2+a*x+3, x=0..1);   - it already fails. Below is a solution using a procedure  Min  that returns the result for each specific  a :

restart;
local f;
Min:=proc(a)
uses Optimization;
f:=a*x + log10(3+4.2^x +2.2^(2*x));
if a>=0 then return [evalf(eval(f,x=0)),[x=0]] else
Minimize(f, x=0..1) fi;
end proc:

# Examples:
Min(2);
Min(-2);
Min(-0.3);

                 


You did not specify the base of the logarithm, I took it equal to  10 .


This is not an integral equation, but simply a numerical calculation of a definite integral with the parameter  t :

restart; 
rho := 1/4: mu := 1/4: T := (t-x)^rho: 
E := add(T^k/GAMMA(k*rho+mu), k = 0 .. 5);
h :=unapply(int(E*(8*x^(3/2)/(3*sqrt(Pi))+x^2+(1/2)*exp(-x)-8/3)/(t-x)^.75, x = 0 .. 1, numeric), t):

# Examples:
h(1.5);
plot(h, 1..2, labels=["t","h(t)"]);

                      

 

First 37 38 39 40 41 42 43 Last Page 39 of 290