Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

A user wondered how to have Maple produce a desired form of a solution

eq1 := `σ__2` = P__2/(Pi*r^2)NULL

NULL

r := (1/2)*d

NULL

soln := `assuming`([solve(eq1, {d}, useassumptions)], [`σ__2`::real, d > 0, P__2 > 0])

{d = 2*(Pi*sigma__2*P__2)^(1/2)/(Pi*sigma__2)}

(1)

NULL

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

Download question-better-spacing.mw

We suggested the closest they might be able to get is using simplify like so:

 

restart; eq1 := `σ__2` = P__2/(Pi*r^2)
``

``

r := (1/2)*d

``

soln := `assuming`([solve(eq1, {d}, useassumptions)], [`σ__2`::real, d > 0, P__2 > 0])

{d = 2*(Pi*sigma__2*P__2)^(1/2)/(Pi*sigma__2)}

(1)

``

`assuming`([simplify(soln)], [sigma__2::real, P__2 > 0])

{d = 2*P__2^(1/2)/(Pi^(1/2)*sigma__2^(1/2))}

(2)

NULL


Download suggestion.mw

Hi, I would be grateful if anyone could help find inconsistency in a system of equations I have been solving. I can easily solve the system (that I have called ‘EQs’) when I set the parameter ‘tau\_l’ equal to .06, but for a different value, it will not solve. The same thing happens whenever I change the value of some other parameters like ‘l3’. Regards

ACCOLLEY_Delali_-_Demographics_3.mw

Hello guys,

I want to find exact form of a(t) in following differential equation:

-diff(a(t), t)^2*_C1*6^(-1/(-1 + 2*alpha))*((diff(a(t), t, t)*a(t) + diff(a(t), t)^2)/a(t)^2)^(-1/(-1 + 2*alpha))/(4*(diff(a(t), t, t)*a(t) + diff(a(t), t)^2)*(-1/2 + alpha)) = (6*diff(a(t), t, t)*a(t)^2*alpha + 6*a(t)*diff(a(t), t)^2*alpha + k^2)/a(t)^3

please guide me,

I am looking for something like the equal sign (“=”) with a question mark (“?”) on top.

This would be handy to express an unknown relation or something that has to be proofed.

If not: Is it possible to create custom symbols?

Many times when using the debugger, and hitting the NEXT button I get the message

   Warning, cannot determine statement number; procedure may have changed in-place

The problem is that after this, hitting NEXT will not go to next statement any more. It will bypass and return from the current procedure. but hitting STEP will make it go to next statement, But STEP will also go into next block which I might not want to do.

Only way to fix this is to terminate the debugging session and start all over again.

it is random and comes up in different places. The code in in .mla file and I step through it.

I am sure anyone who have used the buildin debugger have seen this message before. It shows for me many times. 

What causes it and what can one do to not make it show up or clear it up so one does not have to restart the debugging each time it shows up?

Here is a screen shot.  I am also wondering if this happens using the emacs interface to the Maple debugger? I have not used the emacs interface to the debugger before.

Maple 2021.2 on windows 10

 

Colleagues, help me please. There is a 256 by 256 matrix in the form of a histogram or heat map.

I want to smooth this histogram and get a surface function.

I used Lowess.

However, there is a problem. the resulting function f (x,y) of the surface is calculated for a long time and it is not possible to use it in NonLinearfit. My NonLinearFit does not give a result. I try to use this function as  A * f(x,y) where A is parameter/

And my idea is to use this function as a template when approximating new poorer matrices. like copulas

What should I do?

I can't understand why this error Error, adding lists of different length show up only when removing a print statement!

Why would a print has anything to do with an error message showing up or not?

some context. I wanted to call map on expression, but wanted to collect the result of operating on each indent in a list as map goes through the expression on term after the other. The expression will be type `+`.

I did not know how to do it inside map. So I create separate proc which map call.

Inside this proc, I use list to append to (this will small list, few terms at most).  To be able to do this, I made the list I want to collect thing into a global variable outside the proc.  Everything was working OK, until I remove a print statement  I had inside the proc for debugging.

I am sure there is a better way to do this all (i.e. collect map output into a list) and I am trying to find better way. But my question is: Why would this error shows up only when I remove a print statement from the last line in the proc?

I also notice when removing the line variable declaration global L now both version work with no error, but get warning Warning, (in f) `L` is implicitly declared local which is why I added declaration global L in first place.

Maple 2021.2 on windows 10

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

r:=2/(x^2+1)+1/(x^2+1)^2;
L:=[];
f:=proc(Z)
   global L;  
   #do some processing on Z, then collect it into list L
   L:=[ op(L), Z^2];
   #print("op(L) = ",op(L)," Z=",Z);   
end proc:
map(Z->f(Z),r);
L;

2/(x^2+1)+1/(x^2+1)^2

[]

Error, adding lists of different length

[4/(x^2+1)^2, 1/(x^2+1)^4]

restart;

r:=2/(x^2+1)+1/(x^2+1)^2;
L:=[];
f:=proc(Z)
   global L;  
   #do some processing on Z, then collect it into list L
   L:=[ op(L), Z^2];
   print("op(L) = ",op(L)," Z=",Z);   
end proc:
map(Z->f(Z),r);
L;

2/(x^2+1)+1/(x^2+1)^2

[]

"op(L) = ", 4/(x^2+1)^2, " Z=", 2/(x^2+1)

"op(L) = ", 4/(x^2+1)^2, 1/(x^2+1)^4, " Z=", 1/(x^2+1)^2

[4/(x^2+1)^2, 1/(x^2+1)^4]

 

Download why_error.mw

 

Thanks to everyone for the answers and information I did not know that map does process return value from a proc it calls. Good to know.

 

Dear Maple community,

I was trying to differentiate symbolically in Maple a function of a vector but, unfortunately, could not figure out how to implement/code it. I would really appreciate it if you could help me with the problem described below: 

 

Apparently the Units[Simple] package has not implemented certain features of the original implementation, which (again) leads to very unexpected and wrong results.

This is not acceptable.

Either...

  1. Implement everything
  2. Give a proper warning

a := [0, 1.2, 2, 8, -1.3]

[0, 1.2, 2, 8, -1.3]

(1)

max(a)

8

(2)

Units[Simple]:-max(a)

8

(3)

max[index](a)

4

(4)

Units[Simple]:-max[index](a)

8

(5)

````

Download maxindex.mw

Hello,

I'm havig trouble getting answers to be in decimal form with a certain simple type of equation.

I'm new to Maple so I likely don't understand something basic but when I enter in numbers with decimals as the neumerator like (654321.987*123456.789)/2 I get 4.0390245740 x 10^10. Yet when I enter whole numbers like (654321*123456)/2 I get 40389926688.

I've checked the Number Format settings many times, it's set to "None".

How do I get decimals?

What am I doing wrong?

I'm asking this because I'm sure I'm just missing something.

If I solve a DE with numerics, i.e., dsolve(...,numeric), I get a procedure, say h. I want to answer: if I have a point a that I know, what are the root(s) of h(x) - h(a) = 1? In other words, solve for x.

I thought this would just involve something like fsolve or solve/evalf, or perhaps a root finding package, but I can't figure it out. What I want to avoid is having to write a procedure to hone in on the root myself, since my code is already quite slow.

Any help would be greatly appreciated.

EDIT 1: Here is my MWE (or, what should work in my mind but doesn't). The ODE isn't important, it's just an easy example.

restart;

ode := diff(f(x),x) = f(x);

initial_condition := f(0)=1;

a := 1;

h := dsolve({ode,initial_condition},numeric);

solution := fsolve(h(x) - rhs(h(a)[2]) = 1);

University of Costa Rica     

Course: SP-1493

Student: Lic. Marcus Vinicio Mora Salas

Instructor: Dr. Erick Castellón Elizondo

 

Assigment 7

Description

   

e2.301

 

Express sin(theta) in terms of

i)   cos(theta), and

ii)  tan(theta), and

iii)  cot(theta);

the latter part is more difficult than the preceding two parts.  Each square root that appears is assumed to include both positive and negative roots; for arbitrary angle theta, the sign of the root is given by the quadrant of the angle.  Test your results with a numerical value of theta. In an analogous manner, each circular trigonometric function is expressible in terms of any other circular trigonometric function, but possible ambiguity of signs of square roots exists.   

eq := [sin(theta)^2 + cos(theta)^2 - 1,

Error, invalid input: convert expects its 2nd argument, form, to be of type name, but received -sin(theta)

sin(theta)

 

Download tareaclase8.mw

In this question I have to do what I said in the title. Really I don't understand the question very well, or at least I don't understand the objetive, because if I use solve I get an error and if I use isolate I only can get sin in terms of cos and even wen I could get all answer, I needed a starting point, it's say an identity to solve the exercise. Therefore, my question is, Maple have some comand to express trigonometric functions in terms of another without introducing identities?

Seems to me informative to see a earth-like surface on a sphere and in particular from the zeta function.
Another simple complex function will do it also.

Note: i saw a  3D picture with a colored sphere , where you can see zeroes and poles on the surface of the sphere
A colored complex function is that hard to make with Maple too?: it are all polar coordinates as complex points in the complex plane. 
The angle is standing for hue and the magnitude is standing for the lightness 

Hi

I am trying to get a family of curves on one graph. Each curve a different colour and labeled

P=2, Q=0 , P=2,Q=1 , etc

mmcdara 's proposal for inspiration?

https://www.mapleprimes.com/questions/233088-How-Do-I-Plot-A-Function-Of-Two-Variables

Family_of_curves_plot.mw

I looked at combinat package but it is too large and could not find what I want.

I'll explain with example to make it easy. Given n=2 I want to generate all possible arrangements of sets of length n where each element can be either +1 or -1. So it will be 2^n=4 possible arrangements

And for n=3 then want to generate all possible sets of length 3 where each element can be either +1 or -1 so it will be  2^n=2^3=8 possible sets

And for n=4 it will be 2^n=16 possible arrangements

And so on. I picked [+1,-1] in the above as an example.   

Is there a command to do this in Maple?  I can ofcourse program it using using loops and if's and so on. But thought there might be a command in Maple package which will generate all these possibles sets. Either as list of lists or Matrix or any other format. 

 

1 2 3 4 5 6 7 Last Page 1 of 1880