vv

13805 Reputation

20 Badges

9 years, 313 days

MaplePrimes Activity


These are answers submitted by vv

The system has infinitely many solutions:

Sys:=lhs~(sys):
Groebner:-IsZeroDimensional(Sys);  # ==> false

To see some of them:

solve(sys, maxsols=10);

 

Somehow the names of the parameters returned by dsolve are local

 

sol:=dsolve( {diff(x(t),t)=a, x(0)=1}, numeric, parameters=[a]): # x(t)=a*t+1

type(a, `local`);

false

(1)

sol(parameters);

[a = undefined]

(2)

aa:=lhs(%[]);

a

(3)

type(aa,`local`); # !!

true

(4)

sol(parameters=[a=3]); # Works

[a = 3.]

(5)

sol(10)

[t = 10., x(t) = HFloat(31.000000000000007)]

(6)

sol(parameters=[aa=5]); # the locals not accepted

Error, (in dsolve/numeric/process_parameters) parameter(s) {a} are specified, but are not defined for the problem

 

 

 

I don't see this as a real (annoying) bug, because sol(parameters)  and sol(parameters=...) is supposed to be used only for display purposes.

Here are two working solutions.

1. Create a file A.mpl and use $include

module A()
$include "B.mpl";
export foo:=proc()
  0;
 end proc;
end module;

and in the worksheet use
read "A.mpl"

2. Remove the export from B.mpl, i.e. it will contain 

boo:=proc()
return 0;
end proc; 

and use in the worksheet:

module A()
export boo,foo;
read "B.mpl";

foo:=proc()
  0;
 end proc;
end module;


 

You cannot, because they differ by a constant.

The transform seems to be conformal. The picture was copied from https://en.wikipedia.org/wiki/Conformal_map  but the aspect ratio is not the same, so, the angles are not exactly preserved.

A projective transformation does not preserve the angles but preserves the lines.

And yes, of course, plottools:-transform command can be used.

 

restart;

N:=15:

# f:=(x,y) -> (Re,Im)(sin(x+I*y):

f:=(x,y) -> (Re,Im)(ln(1+I*(1+x+I*y)^2/9)):

P:=plot([seq([x,y,x=0..1],y=0..1,1/N), seq([x,y,y=0..1],x=0..1,1/N)]);
plot([seq([f(x,y),x=0..1],y=0..1,1/N), seq([f(x,y),y=0..1],x=0..1,1/N)],scaling=constrained);

 

 

# Using plottools:-transform
with(plottools):with(plots):
F := transform((x, y) -> [f(x,y)]):

plots:-display(<P|F(P)>, scaling=constrained); # Not executed, to be accepted by mapleprimes.

 

 

The RootOf function is used to represent (not to compute) algebraic numbers (and other numbers). It will be used by many Maple commands, so, a compact and uniform representation is essential and the _Z notation seems to be convenient.
Commands like limit and sum are used in general to compute, not to represent expressions.
Anyway, a beginner seldom uses RootOf in input; he/she will see it only as a result of a computation (in solve, int etc) and any tutorial should mention this.
 
P.S. I was always puzzled by another unique Maple notation for a function name: GAMMA, instead of Gamma, the only one with all the letters capitalized.

Why dou you think that the integral can be expressed in terms of known functions?
Note that even int(sqrt(cos(t)^2+cos(2*t)^2),t)  has a complicated form and int(sqrt(cos(t)^2+cos(3*t)^2),t)  is already too much! 

1. The parantheses are not ignored; they are not displayed, being superfluous in this case, similar to a + (b*c), due to the order of precedence of the Maple operators.

2. Unfortunately Maple does not simplify the set operators; they are used mainly for explicit sets.
If you need to check or simplify expressions in set theory, you can use the Logic package because it works practically in a Boolean algebra.

If you want the general form of a vector in the kernel, try

B := <<6,3,0>|<4,2,0>|<10,5,0>>:
K := LinearAlgebra:-NullSpace(B):
add(alpha[i]*K[i],i=1..nops(K));

(alpha[i] being arbitrary scalars.)

xodephi := {diff(x(t), t) = 16250.25391*(1 - (487*x(t))/168 + 4*Pi*x(t)^(3/2) + (274229*x(t)^2)/72576 - (254*Pi*x(t)^(5/2))/21 + (119.6109573 - (856*ln(16*x(t)))/105)*x(t)^3 + (30295*Pi*x(t)^(7/2))/1728 + (7.617741607 - 23.53000000*ln(x(t)))*x(t)^4 + (535.2001594 - 102.446*ln(x(t)))*x(t)^(9/2) + (413.8828821 + 323.5521650*ln(x(t)))*x(t)^5 + (1533.899179 - 390.2690000*ln(x(t)))*x(t)^(11/2) + (2082.250556 + 423.6762500*ln(x(t)) + 33.2307*ln(x(t)^2))*x(t)^6)*x(t)^5, diff(xphi(t), t) = 5078.204347*x(t)^(3/2), x(0) = 0.03369973351, xphi(0) = a}:  #xphi(10.92469316) = 0}:

sol := dsolve(xodephi, parameters=[a], numeric):

ff:=proc(A)
  sol(parameters=[A]);
  eval(xphi(t), sol(10.92469316))
end:

A:=fsolve(ff);
sol(parameters=[A]);
sol(10.92469316);

-467.1843838

 

[a = -467.1843838]

 

[t = 10.92469316, x(t) = HFloat(0.061040830524973895), xphi(t) = HFloat(1.6909911249030074e-9)]

(1)

plots:-odeplot(sol, [t,xphi(t)], t=0..11);

 

plots:-odeplot(sol, [t,x(t)], t=0..11);

 

 

 

The term "generalization"  is not always the right one. This happens in maths too. E.g. the Lebesgue integral is a "generalization" of the Riemann integral. However, int(sin(1/x)/x, x=0..1) does not exist  in the Lebesgue sense, but it exists as a Riemann (improper)  integral, and Maple computes it.

restart;

f maps the unit square onto the quadrilateral; ek = ellipses tangent to the unit square.

Ellipses:=proc(P::listlist(realcons), t::name, k::name)
local a1,b1,c1,a2,b2,c2,b0,c0,ek,
      f:=(x,y)->[a1*x+b1*y+c1,a2*x+b2*y+c2]/~(x+b0*y+c0);
ek:=1/2+k/2*cos(t)-sqrt(1-k^2)/2*sin(t), 1/2+sqrt(1-k^2)/2*sin(t)+k/2*cos(t);
solve(op~([f(0,0)=~P[1], f(1,0)=~P[2], f(1,1)=~P[3], f(0,1)=~P[4]]));
eval([f(ek)[], t=0..2*Pi], %)
end proc:

# Example

P:=[[0,0], [5,0], [4,3], [1,2], [0,0]]: # quadrilateral

Ell:=Ellipses(P, t, k);

[(-4-4*k*cos(t)+(-k^2+1)^(1/2)*sin(t))/(-2-(-k^2+1)^(1/2)*sin(t)), (-3-3*(-k^2+1)^(1/2)*sin(t)-3*k*cos(t))/(-2-(-k^2+1)^(1/2)*sin(t)), t = 0 .. 2*Pi]

(1)

plots:-display(plot(P,color=blue, thickness=4),
seq(plot(Ell, color=COLOR(HUE,k)), k=0..1,0.05), scaling=constrained, size=[800,800]);

 

plots:-animate(plot, [Ell], k=0..1, background=plot(P,color=blue, thickness=4), scaling=constrained);

 

 

 

 

Yes, in the implementation of series for JacobiTheta3 and JacobiTheta4, the term 1 is missing.

 

restart;

FunctionAdvisor(definition, JacobiTheta3);

[JacobiTheta3(z, q) = Sum(2*q^(_k1^2)*cos(2*_k1*z), _k1 = 1 .. infinity)+1, abs(q) < 1]

(1)

FunctionAdvisor(series, JacobiTheta3);

series(JacobiTheta3(z, q), z, 4) = series(2*(Sum(q^(_k1^2), _k1 = 1 .. infinity))-(4*(Sum(q^(_k1^2)*_k1^2, _k1 = 1 .. infinity)))*z^2+O(z^4),z,4), series(JacobiTheta3(z, q), q, 4) = series(1+(2*cos(2*z))*q+O(q^4),q,4)

(2)

 

 

I always prefer to change myself the coordinates. This way I avoid the two distinct conventions used by Maple for spherical.
As a bonus, I type less!

int(eval((x^2 + y^2)*z, [x=sin(u)*cos(v), y=sin(u)*sin(v), z=cos(u)]) * sin(u), u = 0 .. Pi/2, v = 0 .. 2*Pi);

        Pi/2

 

if type(lhs(ode),`*`) and rhs(ode)=0 then 
  ODE:=select(has, lhs(ode), diff) = 0
fi;

If lhs has a factor depending on y, but has not diff, you may keep it, or solve it for y.

First 33 34 35 36 37 38 39 Last Page 35 of 120