MaplePrimes Questions

The command print placed within a while loop does not produce any printout. How do I  make MAPLE to produce  it?

I am trying to animate two variables in a 3D plot. Basically I would like to combine these two animations into one simultaneous animation:

animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. 2*Pi, y = 0 .. R, coords = spherical, scaling = constrained], R = 0 .. 5)

and

animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. p, y = 0 .. 5, coords = spherical, scaling = constrained], p = 0 .. 2*Pi)

so that both animations start and end simultaneously. Is this possible?

Thanks in advance.

Hi
I appreciate your help forfinding the best fitting line for a discrete series.

Starting with 1978 as base year and counting by two's the five year overage global temperature. where 

the temperature is given by the data : x[0],...,x[12] 

1) Find the best  fitting line : x[n+1]=a*x[n]+b
2) Assuming we can extrapolate, find the predicted value x[30]

 

Fitting_best_line.mw

 

Many thanks for your help.

 

Hi everybody, i want to plot the intersection volume of three inequality, how can i do it?

 

restart

d1:=3:d2:=3:d3:=5:

plots:-implicitplot3d([x^2+y^2+z^2<d1^2,(x-3)^2+y^2+z^2<d2^2,x^2+y^2+(z-4)^2<d1^2],x=-5..5,y=-5..5,z=-5..5,style= wireframe)

 

 


 

Download plot.mw

Hi,

I am trying to solve the equation below. First method was subbing in all the parameters into the equation and the second method is plugging all the parameters straight into the equation. As you can see below, they give different results. Can someone please help me? I've been scratching my head for the past hr trying to figure out what am I doing wrong.

Method 1:

Y1 := P*b*x*(-b^2+l^2-x^2)/(6*l*E*I)     

maxdeflection := subs(P = 60000, b = 2050, E = 16000, I = 3062827708, l = 6600, x = (50/3)*sqrt(47229), Y1)

=-(77224295347218906250/297)*sqrt(47229)

 

Method 2:

Y2 := (50/3)*(60000*2050)*sqrt(47229)*(6600^2-((50/3)*sqrt(47229))^2-2050^2)/(16000*(6*6600)*3062827708)

=(50426796875/1819319658552)*sqrt(47229)

 

Thank you!

Using Maple 2017.3, I ask for the roots of x3-x2-8x+8 and I get the following result:

roots(x^3-x^2-8*x+8);
                            [[1, 1]]

However, I know that (2*sqrt(2)) and -(2 * sqrt(2)) are also roots. Is this a bug or something I do not understand about the "roots" command?

 

Here's a slightly reduced form of a little module from some code that I posted recently:

KandR:= module()
local
   a, b, c, e, #parameters

   #procedure that lets user set parameter values:
   ModuleApply:= proc({
       a::algebraic:= KandR:-a, b::algebraic:= KandR:-b, 
       c::algebraic:= KandR:-c, e::algebraic:= KandR:-e
   })
   local k;
      for k to _noptions do thismodule[lhs(_options[k])]:= rhs(_options[k]) od;
      return
   end proc
;
end module:

The purpose of the module is simply to be a container for the four parameters and to provide a simple ModuleApply interface by which they can be set, reset, and/or unset. 

I very often use a procedure parameter of a ModuleApply to set a local variable of same name in the module. Because of the name conflict, thismodule needs to be used in these situations. I see this as the primary use of thismodule. In the module above, the purpose of the line 

for k to _noptions do thismodule[lhs(_options[k])]:= rhs(_options[k]) od;

is to avoid the need to explictly use the parameters yet a third time. First off, I am amazed that this works! I've had many disappointments with thismodule (which is essentially undocumented---its miniscule help page is nearly worthless). I am using Maple 2018, release 1. Another Maple 2018 user (not sure which release) reports that the above line gives an error (when executed) that thismodule's index must be a name.

Question 1: What's up with that?

[Edit: It's been determined that the problem was due to an unfortunate global assignment in that user's initialization file rather than different behavior of thismodule. So, I consider Question 1 to be completely answered, and it should be ignored.]

Question 2: The for loop is not entirely satisfying to me. Is there a better way?

[Status: Answered, see below.]

Question 3: Ideally, I'd like to explicity use the four parameters once, not two or three times. Is there a way? If I need to use a container for the parameters (such as a Record), to achieve that, I'd be happy to do that, and I wouldn't mind needing to invoke that container's name any number of times.

[Status: Answered, see below.]

Note that op and exports can be applied to thismodule to extract the module's operands. I have found this occasionally useful.

Question 4: What are some other good uses for thismodule? The one and only example given on its help page seems ridiculous to me.

The docs say that you can assign initial values to a record as shown in this screenshot:

I would expect the last two lines of output to be 1, 2. The slighly more complicated example in the docs does not work as expected either. This is the worksheet: queery.mw

I can assign to a record subsequently, but that makes for very prolix code,

Thanks for any help.

How do we use the command convert(expression, number format) in the conversion of number input in a textarea?radianToDegree.mw
 

``

``

 

``

``

``

``

 

 

 

I want conversion from string to float and evaluate radian to degree and show it in textareaDegree.

I am unable to do the operation. 6 radian = 6x180/2 (pi) degrees must be shown degree textbox.

Please help.

Thanks.

Ramki

``

``


 

Download radianToDegree.mw

 

Hello,

I am trying to get Maple to recognize and reverse the product rule in more than one dimension. In one dimension, this works:

Int((Diff(f(x), x))*g(x)+(Diff(g(x), x))*f(x), x) = int((diff(f(x), x))*g(x)+f(x)*(diff(g(x), x)), x);

Int((Diff(f(x), x))*g(x)+(Diff(g(x), x))*f(x), x) = int((diff(f(x), x))*g(x)+f(x)*(diff(g(x), x)), x).

But in two dimensions, it no longer evaluates:

Int((Diff(f(x, y), x))*g(x, y)+(Diff(g(x, y), x))*f(x, y), x) = int((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)), x)

Int((Diff(f(x, y), x))*g(x, y)+(Diff(g(x, y), x))*f(x, y), x) = int((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)), x)

As far as I can tell, mathematically these should be identical (except for the antiderivatives being defined up to a constant in the first case and a function of y in the second). Is there a way to get Maple to reverse the product rule to integrate in more than one dimension? Or am I missing something mathematically that makes this incorrect?

Thanks for your help,

Johnathan


 

M := `<,>`(`<|>`(1, 2, 3), `<|>`(4, 5, 6), `<|>`(7, 8, 9))

Matrix(%id = 18446745804653824710)

(1)

b := `<|>`(10, 11, 12)

Vector[row](%id = 18446745804653819654)

(2)

M+b

Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 3, 1 .. 3) cannot be added to Vector[row](1 .. 3)

 

``

Of course the above addition will throw an error because M and b have different dimensions. But if broadcasting was allowed, then the row vector b is added to each row in the matrix M. For example, in Python:

 

 

Is there a similar feature in Maple?


 

Download question.mw

I am working on solving a set of equations for a number of parameters, and everything looks great except that I am getting a "1." in front of the solution for a couple of variables. What does this mean? In the example below, in the solution for both d__1 and d__2, there is a "1." (3 of them in fact).

 

s1Mean := -1/(2*(-rho^2+1))*(-2*d__1/c__1)-2*rho*d__2/((2*(-rho^2+1))*c__1^.5*c__2^.5) = -2*(-(-X*beta+y)*kappa/(2*sigma)+xi__2*Z__2*gamma__1/(2*tau__2)-xi__1*Z__1/(2*tau__1))

s2Mean := -1/(2*(-rho^2+1))*(-2*d__2/c__2)-2*rho*d__1/((2*(-rho^2+1))*c__1^.5*c__2^.5) = -2*(-(-X*beta+y)*gamma__2/(2*sigma)-xi__2*Z__2/(2*tau__2))

 

meanSol := solve({s1Mean, s2Mean}, {d__1, d__2})

with maple 2015

how can type log[2](3) into

Can you help me?

Thank you very much.

log.mw

 

 Any one can help me to solve the differential equations using maple to get the velocities u ,v and pressure p for the problem mentioned below

I tried the example in BodePlot help.

restart;
with(DynamicSystems):
sys := TransferFunction( 1/(s-10) ):
BodePlot(sys);


That works OK. But, if I invoke Syrup, the example no longer works.

restart;
with(Syrup);
with(DynamicSystems):
ckt := [V, Rsrc(50), C1(15e-9), L1(15e-6), C2(22e-9), L2(15e-6), C3(22e-9), L3(15e-6), C4(15e-9), 1, Rload(50)];

TF := subs(other, V=1, v[Rload]);
sys := TransferFunction(TF);

BodePlot(sys);
I get a message "not a valid plot structure".  OK, try the example, again.

sys := TransferFunction( 1/(s-10) ):
BodePlot(sys);
I also get the "not a valid plot structure" message.

What am I doing wrong?

First 760 761 762 763 764 765 766 Last Page 762 of 2428