MaplePrimes Questions

There is the following differential equation:

 

where l(t)=2+t,  g=10 and the goal is to find φ(t). I wrote the following code:

M := diff(phi(t), t);

M1 := diff(M, t);
g := 10;
M2 := diff(l(t), t);
ode := M1 + 2*M2*M/l(t) + g*sin(phi(t))/l(t) = 0;
ics := phi(0) = 1, D(phi)(0) = 1;
l := t -> 2 + t;
ode;
dsovle([ode, ics]);
 

But I don't get any result. How can I solve this differential equation?

A simple question:

Can I define a Vector using:

a) Initial Value (a), Final Value (b) and the number of elements (N) (assuming linear spacing)
For example: Starts at 1, finishes at 12 with 5 elements:

[ 1 , 3.75 , 6.5 , 9.25 , 12 ]

b) Initial Value (a), Final Value (b) and step (s)
For example: Starts at 2, finishes at 6 with a step of 0.5

[ 2 , 2.5 , 3 , 3.5 , 4 , 4.5 , 5 , 5.5 , 6]

but using only a,b and N ; or a,b and s directly?

Thanks.

------
------

I know this can be done using the seq command and some basic definitions:

In the first case:
Vector([ seq(a+(b-a)/N*i,i=0..N) ]); should do the trick

And the second case is even easier:
Vector([seq(i,i=2..6,0.5)]);

PS. I know for the second case that using any arbitrary step can result in loosing the final value "b" of the sequence because you won't step on b using that arbitrary step value.

As I said above. I just want to know if there is a direct way to define these cases.

Does Maple have a built in hash map (associative array) datatype. I need to write a program where I will be iteratively building a lookup table. It will be very convenient for me if Maple has a hash map map structure built in.

Hi,

Is it possible to capture programatically the values of theta, phi and psi when you manually rotate a 3D plot?

Thanks in advance

PS: The target version is Maple 2020

sometimes I get equations where there is clearly more simplification on it. For an example

restart;
ode:=y(x)=diff(y(x),x)^3*y(x)^2+2*x*diff(y(x),x);
new_ode:=PDEtools:-dchange({y(x)=sqrt(u(x))},ode,{u});

Doing this by hand, I would now write the above as

by multiplying both sides by sqrt(u(x))

new_ode :=sqrt(u(x))*lhs(new_ode)=simplify(sqrt(u(x))*rhs(new_ode))

Since I am doing this in a program, without knowing what the expression is, I need to have this simplification done automatically, since I do not know before hand, if the resulting expression has this form or not. So I automatically call simplify on it.

I tried on a simpler example

expr:=sqrt(u)=1/sqrt(u)

And want to simplify this to u=1

I can't do  

new_expr :=sqrt(u)*lhs(expr)=sqrt(u)*rhs(expr)

Since this is done in a program, without the benefit of looking first and then deciding what to do. Everything needs to be automated since the expression can be anything.

So I need a generic operation to apply and have Maple simplify it, if this pattern exist.  I tried many things, but do far nothing is working:

restart;
expr:=sqrt(u)=1/sqrt(u);
expand(expr);
expand(expr) assuming real;
combine(expr);
combine(expr,sqrt);
combine(expr,radical);
combine(expr,power);
expand(expr);
collect(expr,sqrt(u));
collect(lhs(expr)-rhs(expr)=0,sqrt(u));
simplify(lhs(expr)-rhs(expr)=0) assuming u<>0; # I expected this to work
simplify(expr) assuming real;
simplify(expr,size=false);
simplify(expr,sqrt) assuming real;
simplify(expr,sqrt) assuming positive;
simplify(expr,sqrt,symbolic) assuming positive;
simplify(expr,sqrt,symbolic,size=false) assuming positive;
simplify(expr,symbolic,size=false);
simplify(expr) assuming u<>0;
rationalize(expr);

no change.

Please do not give me an answer that requires one to use specific solution assuming one can see the expression. The solution needs to be something generic and work on any such expression that I can apply to any expression and have Maple simplify the sqrts on both sides, if they are there, since this is done in a program.

From the above, this should have worked


expr:=sqrt(u)=1/sqrt(u);
simplify(lhs(expr)-rhs(expr)=0) assuming u<>0;
simplify(lhs(expr)-rhs(expr)=0,symbolic);

Using Mathematica

ClearAll[u];
expr = Sqrt[u] == 1/Sqrt[u]
Simplify[expr[[1]] - expr[[2]] == 0, Assumptions -> u != 0]

Any suggestions? I am sure there is a simple way to do this in Maple, I just have not found it yet.

Maple 2020.2

 

 

Why Maple can't simplify this expression to zero?

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

simplify(check) assuming x>0

In Mathematica:

ClearAll[x]
check = -2*x + 4*x*Exp[x/2] - x^2 -x*Sqrt[x^2 - 8*x*Exp[x/2] + 4*x + 16*Exp[x] - 16*Exp[x/2] + 4]
Simplify[check, Assumptions -> x > 0]

note that using x>=0 instead of x>0 does not change the above output.

Any work around in Maple?

 

How to change the size of Text area box , i want to increase the box size

I have been trying to figure out a good way to work with z-transform expressions which display keeping everything in terms of negative powers of z. I am not using the z-transform procedure, but writing the equations directly by hand.

For example, given an expression a*z^(-1), Maple will output this as a/z. This is even more dramatic when dealing with rational forms in z^(-1).

The issue here is that z^(-1) has an explicit meaning in terms of delay blocks and causality.

If anyone has a nice way for Maple to return these in a pretty-printed fashion retaining the z^(-1) terms, that would be great. I still need to be able to manipulate the expressions algebraically.

 

I think this is also wrong ode type given by ode advisor.   The following clearly can't be _dAlembert ode. 

restart;
ode:=diff(y(x),x)*tan(diff(y(x),x))+ln(cos(diff(y(x),x))) = y(x);

It does not even have an explicit on its own, in the RHS. D'Alembert ode has the form

The ode above has the form   y=f(p)+g(p)  or one can argue the form y=F(p). Either way, there is no in the RHS.

For the first form above, f(p)=p*ln(p) and g(p)=ln(cos(p))

So why Maple says

DEtools:-odeadvisor(ode)

And Maple knows this. But for some reason, for the above ode, I think it made the wrong call.

restart;
ode:=y(x)=x*f(diff(y(x),x))+g(diff(y(x),x));
DEtools:-odeadvisor(ode);

ode:=y(x)=f(diff(y(x),x))+g(diff(y(x),x));   #no x
DEtools:-odeadvisor(ode)

 

Is there something I am overlooking here? 

Maple 2020.2 with Physics 908 on windows 10

 

I need to find and remove any abs that shows up only inside ln anywhere in an expression.

I used to do this in multiple steps before, by using loop and subs. But I am now learning evalindet which is powerful command. I should use it more. 

I wanted to see if it is possible to do this in one call to evalindent. Both finding and replacing.

Here is an example. Given

expr:=sin(x)+ln(abs(x))+ln(x+abs(y)/sqrt(abs(x+3)))+ln(x^3)+cos(abs(x));

The goal is to change it to the following

This is what I ended up with

restart;
expr:=sin(x)+ln(abs(x))+ln(x+abs(y)/sqrt(abs(x+3)))+ln(x^3)+cos(abs(x));
expr:=evalindets(expr,
          'specfunc( satisfies(u->has(u,abs)),  ln)',
          f->evalindets(f,'specfunc(anything,abs)',f->op(1,f))
          )

My question is: Is there a more optimal or better way to do this? I had to use evalindets inside the transformer to remove the abs. At first I did not know if it will work, but it did work.

Any place for improvement?

Maple 2020.2

Knowing the realations between cartesian ans shperoidal coordinates (x,y,z and v,u,w respectively)

 

 

the goal is to take the following graph:

 

 

 

This graphic consists of three planes (One with v=const, let's say v=2, the other one with u=const, let's say u=π/4 and the last one with w=const let's say w=π/4), of three coordinate lines (line v with u=π/4 and w=π/4, line u with v=2 and w=π/4 and finally line w with v=2 and u=π/4). I wrote the following code but an error occurs...

restart;
with(plots);
with(LinearAlgebra);
F := <2*cosh(1)*cos(x), 2*sinh(1)*sin(x)*sin(t), 2*sinh(1)*sin(x)*cos(t)>;
S1 := plot3d(F, x = -Pi/2 .. Pi/2, t = 0 .. 2*Pi, color = "Green");
F, 1.5*Normalize(diff(F, x), 2);
eval(%, {t = Pi/4, x = Pi/4});
A1 := arrow(%, color = red);
V1 := textplot3d(<`+`(`%%`), v^`0`>, align = {'above', 'right'}, font = [Roman, bold, 14]);
F, 1.5*Normalize(diff(F, t), 2);
eval(%, {t = Pi/4, x = Pi/4});
A2 := arrow(%, color = red);
V2 := textplot3d(<`+`(`%%`), u^`0`>, align = {'below'}, font = [Roman, bold, 14]);
G := <2*cosh(x)*cos(Pi/4), 2*sinh(x)*sin(Pi/4)*sin(t), 2*sinh(x)*sin(Pi/4)*cos(t)>;
S2 := plot3d(G, x = 0 .. 100, t = 0 .. 2*Pi, color = "Cyan");
G, 1.5*Normalize(diff(G, x), 2);
eval(%, {t = Pi/4, x = Pi/4});
A3 := arrow(%, color = red);
V3 := textplot3d(<`+`(`%%`), w^`0`>, align = {'above', 'left'}, font = [Roman, bold, 14]);
display(S1, S2, A1, A2, A3, V1, V2, V3, scaling = constrained, axes = framed, labels = [x, y, z]);
 

 

Given an expression, I want to obtain list of all functions in it, that contains as argument, anywhere another function.  

I can do this now using 2 steps. I was wondering if there is a way to do it in one call.

Here is an example.

expr:=sin(x)+ln(abs(x))+ln(x+1/sqrt(abs(x+3)))+ln(x^3);

The goal is to find all ln functions, with abs inside them. Now, I do this

restart;
expr:=sin(x)+ln(abs(x))+ln(x+1/sqrt(abs(x+3)))+ln(x^3);
lis:=indets(expr,'specfunc(anything,ln)');
select(Z->has(Z,abs),lis)

I could not find a way to do it in one call, If I do this

indets(expr,'specfunc(abs(anything),ln)');

it only finds

Which overlooked the other one, since abs there is elsewhere in side ln.

I looked at help Definition of a Structured Type in Maple but do not know yet if there is an option there to do this. 

Is it possible to do this on one call?  Just wondering, that is all. The above works OK for me now.

 

Maple 2020.2

How I can edit and apply the following conditions to my plot functions 

`######   I want to change q  (starting from 0.3) from 0.3 by .001 to 0.377 and plot 2D (u-q) ,(v,q), (u,v) and  plot3D (u,v,q)`

 

`######   I want to change q (starting from 0.37727) from 0.37727 by .001 to 0.390059 and h from 0.1 by .001 to 0.138462  and plot 2D (h-q)  and  plot3D (u,h,q),(v,h,q)`

I couldn't attach my file here, so I uploaded that here

https://drive.google.com/file/d/17purRxEdDqrTJeFDcF1-d9J7b3LkuJnF/view?usp=sharing

 

I just got a "new" graphics card, NVIDIA GT630, and was wondering whether the CUDA capabilities are accessible. But no luck:

CUDA:-Enable();

Error, (in CUDA:-Enable) CUDA not supported on the current system (see CUDA,supported_hardware for more information)

The CUDA help page with the example, when run, just shows a host of error messages.

I have OS X 10.11.6, the above mentioned GT630 card with claimed 384 CUDA cores and 2 GB of VRAM; NVIDIA WebDriver 346.03.15f16 for the card (i.e. latest for this OS) and NVIDIA CUDA driver 8.0.90 (again, latest for this OS as far as I can tell). My Maple is 2015.2. All this running on a MacPro 4,1.

I am not having great illusions about the performance I should get (this is not a state-of-the-art card today), but it seems to me this combination should be working with Maple 2015 and not throw an error, shouldn't it? Checking the system extensions: CUDA.kext is loaded and its dependencies are satisfied, so I don't see any problem there.

Am I missing something?

M.D.

We have the equation of the following plane in the three-dimension space :

with m1=10, m2=2, C=20 and r1 and r2 given by the following expressions:

  

with d1=0.6 and d2=0.4. How can we get in Maple the graph of this equation on the x0y plane (z=0) ?

First 437 438 439 440 441 442 443 Last Page 439 of 2414