Kitonum

21685 Reputation

26 Badges

17 years, 186 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Hoovernent  Probably it can be done, but it will not be a fully automatic solution. You need to look in the literature how to solve such equations, and then try to automate it in Maple. Unfortunately, I am not familiar with the theory of such equations and therefore I can not give you a more specific answer.

I can only say that  Typesetting  package is poorly documented.

If you want Maple to print  2 + 2=4  then can do so:

2 %+ 2=2+2;

@assma

seq(-x..x, h)  means the sequence of the numbers from  -x  to  x  with the step  h

For example:

seq(-12..12, 3);
                                 
 -12, -9, -6, -3, 0, 3, 6, 9, 12


You yourself must choose a sequence in order for the curves to look the best. For example, for your example, you can do this:

plots:-contourplot(-3.392318438*exp(-4.264628895*x)*sin(6.285714286*y), x = -1/2 .. 3/2, y = -1/2 .. 3/2, contours=[-12,-9,-6,-3,-1,-0.2,-0.01,0,0.01,0.2,1,3,6,9,12], size=[800,500], numpoints=10000);

     

@Rouben Rostamian  

Compare:

A:=<1,2; 3,4>:
seq(seq(A(i,j), j=1..2), i=1..2);
seq(seq(A[i,j], j=1..2), i=1..2);

 

@Hoovernent

1. This is allowed in the  local  line to use assignment operation,  the code will be more compact.

2. Your option also works if you specify the delimiters correctly. Should be

Do := proc( F::list(procedure) , Q::list(list))
local n, m;
n:=nops(F); m:=nops(Q);
if n<>m then error "Should be nops(F)=nops(Q)" fi;
seq(F[i]~(Q[i]), i=1..n);
end proc:

 

@Preben Alsholm 

In this case, it may be more appropriate to use  view  option:

restart;
ode:=diff(x(t),t)=x(t)*(0.1-x(t));
res:=dsolve({ode,x(0)=0.1},numeric);
plots:-odeplot(res,[t,x(t)],0..10, view=[0..10,0.09..0.11]);

                     

@jnjn0291  The code for finding all the roots of your polynomial can be written as a procedure with parameters. This procedure is convenient to use both for finding all the roots for given  x  and  y, and for plotting the corresponding graphs.

restart;
AllRoots:=proc(x,y)
local P;
P:=_Z^9-28*_Z^8+328*_Z^7-2088*_Z^6+(-2*cos(y)-2*cos(x)+7852)*_Z^5+(28*cos(y)+28*cos(x)-17768)*_Z^4+(-152*cos(y)-152*cos(x)+23632)*_Z^3+(408*cos(y)+408*cos(x)-17232)*_Z^2+(-12*cos(x)*cos(y)-540*cos(y)-540*cos(x)+5844)*_Z+32*cos(x)*cos(y)+256*cos(y)+256*cos(x)-544:
[fsolve(P, _Z)];
end proc:


Examples of use :

AllRoots(Pi/4, Pi/3);
AllRoots(Pi/6, 3*Pi/4); 

[0.05089860293, 1.023835350, 1.201326046, 1.545691777, 3.227658869, 4.455425609, 4.824850865, 4.977561899, 6.692750982]
[0.1371952453, 0.8165646504, 1.224987212, 1.668481043, 3.169288944, 4.368210397, 4.791342053, 5.189228029, 6.634702427]

The plots of the first 4 eigenvalues:

plot3d([(x,y)->AllRoots(x,y)[1], (x,y)->AllRoots(x,y)[2], (x,y)->AllRoots(x,y)[3], (x,y)->AllRoots(x,y)[4]], 0..2*Pi, 0..2*Pi, color=[yellow,red,blue,green]);
 

       

 

      

@assma 

1. Did you try those options that I suggested?

2. Submit your code here, which leads to the error.

@Hoovernent  It depends on how many variables the function has you want to plot. If the function depends on one variable, then use  plot  command, if on two variables, then  plot3d  command. You can also build several functions on one plot.  See help on these commands

@Muhammad Usman 

Expr:=(A^2/nu)^(1/3)*g*beta*q2[w]*sqrt(nu^2/A)*T(y, t)/((nu*A)^(1/3)*k)+(A^2/nu)^(1/3)*g*beta*T[infinity]/(nu*A)^(1/3)-(A^2/nu)^(1/3)*g*beta*V[infinity]/(nu*A)^(1/3)+(A^2/nu)^(1/3)*g*beta1*C(y, t)/(nu*A)^(1/3)-(A^2/nu)^(1/3)*g*beta1*C[infinity]/(nu*A)^(1/3);
simplify(Expr) assuming A>0, nu>0;
expand(%);

@torabi  I did not understand what this graph means.

If you want to plot  y(t) vs A  with a horizontal A-axis , then you need to go into 3-d space. You will have a surface such that its section with a plane  A=const  will be the corresponding plot of  y(t) :

restart;
P:=proc(A)
local omega, mu, B, eq1, eq2, eq3, dsys3;
omega := -2.667; mu := 10; B := 1;
eq1 := diff(x(t), t) = omega*x(t)-y(t)^2;
eq2 := diff(y(t), t) = mu*(z(t)-y(t));
eq3 := diff(z(t), t) = A*y(t)-B*z(t)+x(t)*y(t);
dsys3 := {eq1, eq2, eq3, x(0) = 10, y(0) = 10, z(0) = 10};
dsolve(dsys3, numeric);
end proc:

plot3d([(A,s)->A, (A,s)->s, (A,s)->eval(y(t),P(A)(s))], 1..10, 0..3, labels=[A,t,y(t)], labelfont=[times,16], numpoints=10000, axes=normal);

                

@torabi  In this case, what do you want to match A for each A?

@assma It is necessary to remove the square brackets and put the  multiplication sign where it was missed:
restart;
f:=(x,y)->exp(-0.96374054*x)*sin(2*Pi*y)*((-0.96374054)^2-4*Pi^2)/(2*Pi);
plots:-contourplot(f(x,y), x=-0.5..1.5, y=-0.5..1.5, numpoints=10000);

 

@Markiyan Hirnyk 

1. The same can be done simplier:

solve([x^3+x^2-y^2, -y+2*x+1], [x, y], explicit);

2.  I changed the head.

@Markiyan Hirnyk  @Carl Love  I do not understand why such intricate ways, when  RootFinding:-Isolate command  immediately gives the desired result:

restart;
with(RootFinding):
sol := Isolate([x^3+x^2-y^2, -y+2*x+1], [x, y]);  
 
Addition.  To solve this system, we can do without calling  RootFinding  package, applying  solve  command, but we will have to tinker to get rid of imaginary parts that are actually 0 :

restart;
sol := simplify(fnormal(evalf(solve([x^3+x^2-y^2, -y+2*x+1], [x, y], explicit))), zero);         

First 56 57 58 59 60 61 62 Last Page 58 of 133