Kitonum

21450 Reputation

26 Badges

17 years, 47 days

MaplePrimes Activity


These are answers submitted by Kitonum

Maple can not solve your equation  deq=3  for  , since the explicit dependence of  y(x)  is unknown. Here is a workaround:

restart:
eq:=4*x^2+2*y(x)^2=32.5625:
deq:=solve(  diff(eq,x), diff(y(x),x) );
deq=3;
y(x)=solve(deq=3, y(x));
x=solve(subs(y(x)=y, deq=3), x);


RootOf(2*_Z+3*y(_Z))  is a formal representation of the root of the equation  2*_Z+3*y(_Z)=0  with respect to  _Z

I corrected all the syntax errors. We see that the integrand is actually a scalar function.  But Maple does not cope with this integral even for finite intervals. I think that the reason is in a large number of parameters (8 parameters).


 

restart

with(Physics[Vectors]); Setup(mathematicalnotation = true)

p_ := _i*px+_j*py+_k*pz

_i*px+_j*py+_k*pz

(1)

``

q_ := _i*qx+_j*qy+_k*qz

_i*qx+_j*qy+_k*qz

(2)

``

w_ := _i*wx+_j*wy+_k*wz

_i*wx+_j*wy+_k*wz

(3)

``

K := (`#mover(mi("p"),mo("→"))`.`#mover(mi("p"),mo("→"))`)/((`#mover(mi("p"),mo("→"))`.`#mover(mi("p"),mo("→"))`+a^2)^2*((`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`).(`#mover(mi("p"),mo("→"))`-`#mover(mi("q"),mo("→"))`+`#mover(mi("w"),mo("→"))`))+b1^2)

(px^2+py^2+pz^2)/((a^2+px^2+py^2+pz^2)^2*((px-qx+wx)^2+(py-qy+wy)^2+(pz-qz+wz)^2)+b1^2)

(4)

``

8*(int(K, [px = 0 .. 1, py = 0 .. 1, pz = 0 .. 1]))

Warning,  computation interrupted

 

``

`minus`(indets(K), {px, py, pz})

{a, b1, qx, qy, qz, wx, wy, wz}

(5)

``


You can try to calculate your integral by specifying the values of these parameters.

Edit.

Download Integration-Vec-Example_new.mw

restart; 
with(Physics):
Setup(mathematicalnotation = true);                
Setup(signature = `-+++`);                    
Coordinates(M = [t, rho, z, phi]);
ds2 := -exp(2*psi(rho, z))*dt^2+exp(2*gamma(rho, z)-2*psi(rho, z))*(drho^2+dz^2)+exp(-2*psi(rho, z))*(rho^2)*(dphi^2);  
Setup(metric = ds2);

 


 

restart;
F := [q2, q2^2/q1+(gamma-1)*(q3-q2^2/(2*q1)), q3*q2/q1+(gamma-1)*(q3-q2^2/(2*q1))*q2/q1];
Q := [q1, q2, q3];

with(VectorCalculus):
A := Jacobian(F, Q);

A := subs(q1 = rho, q2 = rho*u, q3 = rho*e, A);
A := subs(e = P/(rho*(gamma-1))+(1/2)*u^2, A);
A := subs(P = rho*c^2/gamma, A);
A := simplify(A);
with(LinearAlgebra):
evalsA := simplify(Eigenvalues(A));

evecA1 := Eigenvectors(A);
B:=solve(rho*c^2/(gamma-1)*(1/rho)+(1/2)*u^2 = H, c^2);

subs~(c^2=B, evecA1[2]);
simplify(%);

F := [q2, q2^2/q1+(gamma-1)*(q3-q2^2/(2*q1)), q3*q2/q1+(gamma-1)*(q3-q2^2/(2*q1))*q2/q1]

 

Q := [q1, q2, q3]

 

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -q2^2/q1^2+(1/2)*(gamma-1)*q2^2/q1^2, (2, 2) = 2*q2/q1-(gamma-1)*q2/q1, (2, 3) = gamma-1, (3, 1) = -q3*q2/q1^2+(1/2)*(gamma-1)*q2^3/q1^3-(gamma-1)*(q3-(1/2)*q2^2/q1)*q2/q1^2, (3, 2) = q3/q1-(gamma-1)*q2^2/q1^2+(gamma-1)*(q3-(1/2)*q2^2/q1)/q1, (3, 3) = q2/q1+(gamma-1)*q2/q1})

 

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -u^2+((1/2)*gamma-1/2)*u^2, (2, 2) = 2*u-(gamma-1)*u, (2, 3) = gamma-1, (3, 1) = -e*u+((1/2)*gamma-1/2)*u^3-(gamma-1)*(rho*e-(1/2)*rho*u^2)*u/rho, (3, 2) = e-(gamma-1)*u^2+(gamma-1)*(rho*e-(1/2)*rho*u^2)/rho, (3, 3) = u+(gamma-1)*u})

 

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -u^2+((1/2)*gamma-1/2)*u^2, (2, 2) = 2*u-(gamma-1)*u, (2, 3) = gamma-1, (3, 1) = -(P/(rho*(gamma-1))+(1/2)*u^2)*u+((1/2)*gamma-1/2)*u^3-(gamma-1)*(rho*(P/(rho*(gamma-1))+(1/2)*u^2)-(1/2)*rho*u^2)*u/rho, (3, 2) = P/(rho*(gamma-1))+(1/2)*u^2-(gamma-1)*u^2+(gamma-1)*(rho*(P/(rho*(gamma-1))+(1/2)*u^2)-(1/2)*rho*u^2)/rho, (3, 3) = u+(gamma-1)*u})

 

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -u^2+((1/2)*gamma-1/2)*u^2, (2, 2) = 2*u-(gamma-1)*u, (2, 3) = gamma-1, (3, 1) = -(c^2/(gamma*(gamma-1))+(1/2)*u^2)*u+((1/2)*gamma-1/2)*u^3-(gamma-1)*(rho*(c^2/(gamma*(gamma-1))+(1/2)*u^2)-(1/2)*rho*u^2)*u/rho, (3, 2) = c^2/(gamma*(gamma-1))+(1/2)*u^2-(gamma-1)*u^2+(gamma-1)*(rho*(c^2/(gamma*(gamma-1))+(1/2)*u^2)-(1/2)*rho*u^2)/rho, (3, 3) = u+(gamma-1)*u})

 

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = (1/2)*u^2*(gamma-3), (2, 2) = -gamma*u+3*u, (2, 3) = gamma-1, (3, 1) = -(2*(-(1/2)*gamma^2+(3/2)*gamma-1)*u^2+2*c^2)*u/(2*gamma-2), (3, 2) = ((-2*gamma^2+5*gamma-3)*u^2+2*c^2)/(2*gamma-2), (3, 3) = gamma*u})

 

Vector(3, {(1) = u, (2) = -c+u, (3) = c+u})

 

evecA1 := Vector(3, {(1) = c+u, (2) = -c+u, (3) = u}), Matrix(3, 3, {(1, 1) = (2*gamma-2)/(2*c*gamma*u+gamma*u^2+2*c^2-2*c*u-u^2), (1, 2) = -(2*gamma-2)/(2*c*gamma*u-gamma*u^2-2*c^2-2*c*u+u^2), (1, 3) = 2/u^2, (2, 1) = (2*gamma-2)*(c+u)/(2*c*gamma*u+gamma*u^2+2*c^2-2*c*u-u^2), (2, 2) = (2*gamma-2)*(c-u)/(2*c*gamma*u-gamma*u^2-2*c^2-2*c*u+u^2), (2, 3) = 2/u, (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

 

Warning, solving for expressions other than names or functions is not recommended.

 

B := -(1/2)*gamma*u^2+H*gamma+(1/2)*u^2-H

 

Matrix(3, 3, {(1, 1) = (2*gamma-2)/(2*c*gamma*u+2*H*gamma-2*c*u-2*H), (1, 2) = -(2*gamma-2)/(2*c*gamma*u-2*H*gamma-2*c*u+2*H), (1, 3) = 2/u^2, (2, 1) = (2*gamma-2)*(c+u)/(2*c*gamma*u+2*H*gamma-2*c*u-2*H), (2, 2) = (2*gamma-2)*(c-u)/(2*c*gamma*u-2*H*gamma-2*c*u+2*H), (2, 3) = 2/u, (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

 

Matrix(%id = 18446746571555804334)

(1)

 


 

Download subs.mw

You do not need  Logic  package for this:

a:=[false$4,true$4];
b:=[false$2,true$2,false$2,true$2];
c:=[seq(op([false,true]),i=1..4)];
A:=plot(piecewise(seq(op([x>n-1 and x<n,`if`(a[n]=false,0+7,1+7)]), n=1..8), undefined), x=0..8):
B:=plot(piecewise(seq(op([x>n-1 and x<n,`if`(b[n]=false,0+5,1+5)]), n=1..8), undefined), x=0..8):
C:=plot(piecewise(seq(op([x>n-1 and x<n,`if`(c[n]=false,0+3,1+3)]), n=1..8), undefined), x=0..8):
F:=plot(piecewise(seq(op([x>n-1 and x<n,`if`((a[n] and b[n] or c[n])=false,0+1,1+1)]), n=1..8),undefined), x=0..8, thickness=3):
T:=plots:-textplot([[-0.5,1.5,"F"],[-0.5,3.5,"c"],[-0.5,5.5,"b"],[-0.5,7.5,"a"]], font=[times,bold,16]):
plots:-display(A,B,C,F,T, view=[-0.7..8,0..8], tickmarks=[default,[seq(op([k=0,k+1=1]), k=1..7,2)]], labels=[``,``], scaling=constrained);

This post  https://www.mapleprimes.com/posts/207840-Combinations-Of-Multiple-Animations  will be interesting for you.

It works in Maple 2015.2:

restart;
with(plots):
A:=animate(plot, [[cos(t), sin(t), t=0..a]], a = 0 .. 2*Pi,  frames = 50):
B:=animate(pointplot, [[t,sin(t)], color = blue, symbol = circle, symbolsize = 18], t = 0 .. 2*Pi, frames=50, background = plot(sin(x), x = 0 .. 2*Pi)):
display([A, B], scaling = constrained, size=[1000,300]);


Addition. For those who like more compact codes, this animation can be written in one line, calling only  animate  command from  plots  package:

restart;
plots:-animate(plot, [[[cos(t), sin(t), t=0..a],[[a,sin(a)]]],style=[line,point],color = [RGB(0.47,0.,0.055),blue],symbol = circle, symbolsize = 18], a = 0 .. 2*Pi,  frames = 50,background = plot(sin(x), x = 0 .. 2*Pi), scaling=constrained, size=[1000,300]);


 

The final result:

See corrected file for details

how_to_draw_the_dashline_part_new.mw

Use  solve  instead of  simplify :

solve(F*R=(1/2*M*R^2)*(a/R), F);

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;

sol:=pdsolve(sys[1]);
w[1] := unapply(eval(w[1](y,z), sol), y,z);

# Examples of use
w[1](y, z);
w[1](1, 2);
plot3d(w[1], 0..1, 0..Pi);

 

Here is the solution with your data:

The code in 1d-math:

restart; 
rho := phi->chi/(1-e*cos(2*phi)):
e := 0.29:
chi := 0.5:
L := phi->Int(sqrt(rho(t)^2+(diff(rho(t), t))^2), t = 0 .. phi): 
plot(L(phi), phi = 0 .. 2*Pi); 
evalf(L(4)); 
evalf(L(5)); 
phi = fsolve(L(phi) = 50); 
plot(rho(phi), phi = 0 .. 2*Pi, coords = polar, scaling = constrained);

 

Download probléma_new.mw  # The code in 2d-math

 

Here are 2 more ways: 

# It does not even need in  simplify  command
eq1:=exp(I*phi);
conjugate(eq1)*eq1 assuming real;

# evalc command works under the assumption that all parameters are real
eq1:=exp(I*phi);
simplify(evalc(conjugate(eq1)*eq1));

 

restart;
interface(rtablesize=100):
for k from 1 to 10 do
A[k]:=<k,k^2; 2*k,2*k^2>;
od:
LinearAlgebra:-DiagonalMatrix([seq(A[k], k=1..10)]);

Probably you made syntax errors in  Rpm(Rpp(Psi00)) . For example, instead  e^(I*phi)  should be exp(I*phi) . e  is just a symbol in Maple.

Try the code below. And from now on, send a code in text form (which can be easily copied and then pasted into the Maple worksheet), not as a picture.

restart;
exp(-I*phi)*(-I*(2*I*exp(I*phi)*sqrt(1/Pi)*exp(-r^2/2)-2*I*exp(I*phi)*sqrt(1/Pi)*r^2*exp(-r^2/2))+2*exp(I*phi)*sqrt(1/Pi)*r*exp(-r^2/2)/r/(2*I*exp(I*phi)*sqrt(1/Pi)*r*exp(-r^2/2)))-2*r^2*exp(-I*phi)*exp(I*phi)*sqrt(1/Pi)*exp(-r^2/2);

simplify(%);
 

To find the global extrema in said region do:

f:=cos(x*y)*(x^2+y^2)^0.5:
minimize(f, x=0..1, y=0..1, location);
maximize(f, x=0..1, y=0..1, location);
plot3d(f, x=0..1, y=0..1);  
# Visualization
 

Trunc := proc (eq::{polynom, procedure}, odr::nonnegint := 2, v::list := [x, y, z])
local a, b, q;
description " Truncates an algebraic equation to required degree";
a := eq; b := v;
map(select, q->evalb(degree(q, b) <= odr), `if`((eval(a))::procedure, a(b[]), a))
end proc:

First 110 111 112 113 114 115 116 Last Page 112 of 290