MaplePrimes Questions

When I create a rooted vector 

v1:=RootedVector(root=[1,Pi/4,0],[0,0,1],spherical[r,theta,phi])

and a free vector

v2:=Vector([0,2,1],cartesian[x,y,z])

and dot product them

v1.v2

it gives me 2.

But if I change v1 to 

v1:=RootedVector(root=[1,Pi/6,0],[0,0,1],spherical[r,theta,phi])

the product of v1.v2 gives me an error

"..cannot combine two rooted vectors with different points of origin"

Can anyone explain me the problem? 

Here is what I understand: 

In spherical coordinates the unit vector e_r, e_th, e_ph are functions of theta and phi. So when I call root=[1,Pi/4,0] that means r=1, theta=Pi/4 and phi=0. This uniquely defines the unit vectors in spherical coordinates and r places the vector away in the e_r direction. The [0,0,1] then attaches a vector to the point r=1, theta=Pi/4 and phi=0  with only 1 unit along the e_ph direction.

What I don't understand is the concept of origin with the free vector and the rooted vector. How changing the theta from Pi/4 to Pi/6 makes the origin "different"? 

Edit: This is part of the VectorCalculus pacakge.

Hi:

How can I solve this system with numerical method:

eq1 := diff(f_n(zeta), zeta$2)-h_n(zeta)*(diff(f_n(zeta), zeta))-f_n(zeta)^2+g_n(zeta)^2 = 0;
eq2 := diff(g_n(zeta), zeta$2)-h_n(zeta)*(diff(g_n(zeta), zeta))-2*f_n(zeta)*g_n(zeta) = 0;
eq3 := 2*f_n(zeta)+diff(h_n(zeta), zeta) = 0;
ics := f_n(0) = 0, f_n(10) = 0, g_n(0) = 1, g_n(10) = 0, h_n(0) = 0;
tnx...

Hello

Maple is dangerously close to using all available memory on my Linux machine by doing a calculation using  Grid:-Seq (Map, ..).   Is there a way to control the amount of memory used? Is numcpus a good option?   Or tasksize? 

I expect that Maple will use a large amount of memory since the calculations are performed over a rather large list of sets.  

Many thanks.

Ed

[Moderator's note: The original version of this Question mentioned using both Grid and Threads. The following 5 Replys will not make sense without knowing that Threads was mentioned.

Ed: Editing your Questions is fine, but please don't remove information that is necessary to understand the Replys and/or Answers that are already posted.--Carl Love]

Hello 

I am having equation y(x) in 5 variable c1, c2, A, R and x.

I am not able to plot graph in x and y(x) for A=1, c1 = 2.3, c2 = 2.4 and R=0,2 5,9.

Range of x: -1..1

Caption :graph of y(x) at different value of R.

Legend: R=0, R=1, R=2, R=3.

my equation is


 

"y(x):=0.0000148809523809523809 A^3 R^2 x^10-0.000334821428571428572 A^3 R^2 x^8+0.00156250000000000000 A^3 R^2 x^7+0.000133928571428571429 A^3 R^2 x^6-0.00312500000000000000 A^2 R^2 x^7+0.00156250000000000000 A^3 R^2 x^5-0.0156250000000000000 A^3 R^2 x^4-0.00312500000000000000 A^2 R^2 x^5-0.00625000000000000000 A^2 R x^6+0.00647321428571428572 A^3 R^2 x^3+0.0625000000000000000 A^2 R^2 x^4-0.0129464285714285714 A^2 R^2 x^3-0.0625000000000000000 A R^2 x^4+0.0625000000000000000 A c1 c2 x^4+0.125000000000000000 A^2 R x^3-0.00319293058132343847 A^3 R^2+0.00803571428571428571 A^2 R x^2-0.250000000000000000 A R x^3+0.0125000000000000000 A^2 R^2-0.00178571428571428571 A^2 R-0.0125000000000000000 A R^2+0.0125000000000000000 A c1 c2-0.750000000000000000 A x^2+0.500000000000000001 (0.0380078849721706865 A^3 R^2-0.150000000000000000 A^2 R^2+0.150000000000000000 A R^2-0.150000000000000000 A c1 c2) x^2+0.750000000000000000 A+1.00000000000000000 (-0.00959821428571428571 A^3 R^2+0.0191964285714285714 A^2 R^2) x+1.00000000000000000 (-0.125000000000000000 A^2 R+0.250000000000000000 A R) x:"

``


 

Download Ques1.mw

I have the numeric solution of differential equation and interpolate the data points with a spline of third degree. Is there a way of differentiating the spline as a whole? Differentiating every single polynom seems awkward.

 Help me please.  How can i simulate murmuration in maple.

Hi:

How can I solve the below ODE system in Maple?

sys_ode := diff(F0(zeta), zeta, zeta)-b^2*F0(zeta)+G0(zeta)^2 = 0, diff(G0(zeta), zeta, zeta)-b^2*G0(zeta) = 0, 2*F0(zeta)+diff(H0(zeta), zeta) = 0:
ics := F0(0) = 0, G0(0) = 1, H0(0) = 0, F0(infinity) = 0, G0(infinity) = 0:

Note: b is a constant.

tnx...

Hi everyone:

How can I earn the coefficients with P only in this equation? (No P^2 or P^3).

eq:=p*(diff(F1(zeta), zeta, zeta))-b^2*p*F1(zeta)+2*G0(zeta)*p*G1(zeta)+p^2*G1(zeta)^2-p*H0(zeta)*(diff(F0(zeta), zeta))-H0(zeta)*p^2*(diff(F1(zeta), zeta))-p^2*H1(zeta)*(diff(F0(zeta), zeta))-p^3*H1(zeta)*(diff(F1(zeta), zeta))-p*F0(zeta)^2-2*F0(zeta)*p^2*F1(zeta)-p^3*F1(zeta)^2+p*b^2*F0(zeta)+b^2*p^2*F1(zeta):

tnx...

Hi, 

I would like to enable/disable the Explore(plot(...), parameters=[...]) command according to some boolean value.
First idea (note that ending the previous command by : instead of ; doesn't prevent a figure to be displayed) was to encapsulated this Explore command within a conditional structure:
if T then Explore(...) end if.

But I prefered trying to define my own command by doing something like this:

EXPLORE := proc(TF::boolean)
  if TF then 
    Explore(_passed[2..-1])
  end if:
end proc:

with a call made this way:
EXPLORE(true, 'plot(a*x, x=0..1)', 'parameters=[a=-1.0 .. 1.0]');
wich ended with this error
Error, (in Explore) No parameters to explore


I also tried this without any more success:
EXPLORE := proc(TF::boolean)
  if TF then 
    Explore(_passed[1], parameters=_passed[2])
  end if:
end proc:

with a call made this way:
EXPLORE(true, 'plot(a*x, x=0..1)', [a=-1.0 .. 1.0]);
I get no more error but this warning and an inactive Explore
Warning, expecting only range variable x in expression a*x to be plotted but found name a

 


Can you help me to fix this?

Thanks in advance

 

 

ddesys := {diff(x(t), t, t) + 2/25*diff(x(t), t) + 4*x(t) = 1/25*diff(x(t), t, t)*piecewise(t - 6/7 < 0, cos(t - 6/7), x(t - 6/7)) + 2/3*diff(x(t), t)*piecewise(t - 6/7 < 0, cos(t - 6/7), x(t - 6/7)) + 5/2*piecewise(t - 6/7 < 0, cos(t - 6/7), x(t - 6/7)), h(t) = diff(x(t), t, t), x(0) = cos(0), z(t) = diff(x(t), t), D(x)(0) = -sin(0)}

tdsn := dsolve(ddesys, numeric):

plots[odeplot](tdsn, [[t, x(t), color = red]], 0 .. 20, labels = [t, ""]);

Hello,
I wish to make a simulation of a solution of  Neutral Delayed Differential  Equation (second order) whose initial condition is the history function cos(t) for t <0.
unfortunately Maple considers the history function as a constant and not a function, the simulation I tried to do by Maple is therefore not good.
Could somebody help me please ?


 

NULL

Restart:

pde := diff(w(x, t), x $ 4) + diff(w(x, t), t $ 2)/c^2 = 0;

diff(diff(diff(diff(w(x, t), x), x), x), x)+(diff(diff(w(x, t), t), t))/c^2 = 0

(1)

test1 := w(x, t) = W(x)*cos(omega*t); pde1 := expand((eval(pde, test1))/cos(omega*t))

w(x, t) = W(x)*cos(omega*t)

 

diff(diff(diff(diff(W(x), x), x), x), x)-W(x)*omega^2/c^2 = 0

(2)

ode := algsubs(omega^2/c^2 = alpha^4, pde1); sol := dsolve(ode); sol := convert(sol, trig)

-W(x)*alpha^4+diff(diff(diff(diff(W(x), x), x), x), x) = 0

 

W(x) = _C1*exp(-alpha*x)+_C2*exp(alpha*x)+_C3*sin(alpha*x)+_C4*cos(alpha*x)

 

W(x) = _C1*(cosh(alpha*x)-sinh(alpha*x))+_C2*(cosh(alpha*x)+sinh(alpha*x))+_C3*sin(alpha*x)+_C4*cos(alpha*x)

(3)

L_collection := [indets(sol, specfunc({cos, cosh, sin, sinh}))[]]

[cos(alpha*x), cosh(alpha*x), sin(alpha*x), sinh(alpha*x)]

(4)

``

temp := collect(sol, [sinh, cosh, sin, cos])

W(x) = (-_C1+_C2)*sinh(alpha*x)+(_C1+_C2)*cosh(alpha*x)+_C3*sin(alpha*x)+_C4*cos(alpha*x)

(5)

CL := [coeffs(rhs(temp), L_collection)]NULL

[-_C1+_C2, _C1+_C2, _C3, _C4]

(6)

R:=[seq(cat(_D,i)=CL[i], i=1..nops(CL))]

[_D1 = -_C1+_C2, _D2 = _C1+_C2, _D3 = _C3, _D4 = _C4]

(7)

MX:= subs((rhs=lhs)~(R), temp);

W(x) = _D1*sinh(alpha*x)+_D2*cosh(alpha*x)+_D3*sin(alpha*x)+_D4*cos(alpha*x)

(8)

boundary_condition_1 := simplify(rhs(eval(diff(MX, `$`(x, 1)), x = 0))/alpha = 0)

_D1+_D3 = 0

(9)

boundary_condition_2 := simplify(rhs(eval(MX, x = 0)) = 0)

_D2+_D4 = 0

(10)

boundary_condition_3 := simplify(rhs(eval(diff(MX, `$`(x, 1)), x = L))/alpha = 0)

cosh(alpha*L)*_D1+sinh(alpha*L)*_D2+cos(alpha*L)*_D3-sin(alpha*L)*_D4 = 0

(11)

boundary_condition_4 := simplify(rhs(eval(MX, x = L)) = 0)

_D1*sinh(alpha*L)+_D2*cosh(alpha*L)+_D3*sin(alpha*L)+_D4*cos(alpha*L) = 0

(12)

boundary_condition_solve := solve([boundary_condition_1, boundary_condition_2, boundary_condition_3, boundary_condition_4]); MX := eval(MX, boundary_condition_solve)

Warning, solutions may have been lost

 

{L = L, _D1 = -_D3, _D2 = -_D4, _D3 = _D3, _D4 = _D4, alpha = 0}, {L = 0, _D1 = -_D3, _D2 = -_D4, _D3 = _D3, _D4 = _D4, alpha = alpha}, {L = L, _D1 = 0, _D2 = 0, _D3 = 0, _D4 = 0, alpha = alpha}

 

Error, invalid input: eval received ({L = L, _D1 = -_D3, _D2 = -_D4, _D3 = _D3, _D4 = _D4, alpha = 0}, {L = 0, _D1 = -_D3, _D2 = -_D4, _D3 = _D3, _D4 = _D4, alpha = alpha}, {L = L, _D1 = 0, _D2 = 0, _D3 = 0, _D4 = 0, alpha = alpha}), which is not valid for its 2nd argument, eqns

 

``


 

Download Free_Vibration_Euler_Bernouli_Beam_1.mw

I have tried to solve these 4 equations to get the characteristic equation and finally the solution of the PDE.  But it shows some error. Can you please help with this issue?

How to draw an ellipse in a rectangle ? Thank you.

Hello,

I tried to solve an inequality involving factorials using solve, but I failed. The code is 

solve(1/(n+1)!<0.0001,n)

n should be 7.

Maple returns me "Warning, solutions may have been lost" message. 

How can I solve an inequality like this using solve?

I worked around this with a for loop testing the value of the expression for every increasing value of n against the criteria. Is there a "magical" keyword that will help with solve? 

 

 

sqrt(4) gives 2 in CAS systems, since the principal root is returned by default. 

Is there an option to have Maple return all roots? Which in this case 2,-2?

I'll explain the context why I need this.

When I solve an ODE, I get a solution that I need to solve for constant of integration C from initial conditions. For an example assume the ODE becomes, after replacing initial condition the following  eq:=4^(1/2) = -2+_C1;

So now when solving for _C1  in maple and then calling simplify, gives one solution which _C1=4 (case root=2) which when replaced back into the general solution gives the particular solution.

But this means the second solution is lost, which is when _C1=0  (case root=-2) which could have been obtained from the non-principal root of 4^(1/2)

eq:=4^(1/2) = -2+_C;
solve(eq,_C);

gives 

And I would like to get {4,0} instead.

In practice, this becomes important.

Here is an actual ODE, which should have 2 solutions. Mathematica gives both solutions, and Maple gives one solution.  This is due to the above.

ode:=diff(y(x),x)-y(x)=x*y(x)^(1/2);
ic:=y(0)=4;
dsolve([ode,ic])

In Mathematica

ode=y'[x]-y[x]==x*y[x]^(1/2);
ic={y[0]==4};
sol=DSolve[{ode,ic},y[x],x]

The second solution above came from when constant of integration is zero. The first solution is the one Maple  gave (when expanded).

When I worked the solution by hand, I tracked this to issue with sqrt(4) giving 2 and not +2,-2 when doing solve() to solve for C at the end.

I could ofcourse leave C=sqrt(4)  and not call simplify  on it  and that works.

But I thought to ask here to see if there is some option in Maple, so that when it sees (n)^m to return all m roots when calling solve() and not just the principal one. Even for m=2. 

I looked at root and tried allsolutions=true but they did not help. Looked at solve/details and did not spot something. I tried only few of the options there, as there are so many.

Any suggestions what to try?

 

Suppose that S={u1,u2,u3,u4}⊂ℝ5  where

u1=< 

u2=< -163, 171, 218, -92>

u3=< -287, 73, -284, -115>

u4=<-32, 172, 206, -180>

v=< 761, -1381, 7566, 3492>

The vector v  is in the span of S  written in the form

 

αu1+βu2+γu3+δu4 .

 

Find a possible set of values for α, β, γ, δ.  Enter the values of α, β, γ, δ  as a sequence in the box below

 

First 414 415 416 417 418 419 420 Last Page 416 of 2308