MaplePrimes Questions

Kind help with a maple code without using the permute function maple such that I that can get each permutation at a time and as I do not want to store all the permutations in a list as it would require too much memory space when n is larger. So I would like to

say I have to permute [1,2,3] first I get 1,2,3 leave it , next get 2,1,3 leave it, 3,2,1 leave it and so I don't store them after using it.

the same way for combinations too without using the combinat to store entire in a list i want say choose from 1,2,3,4 say 3 elements at a time I choose 1,2,3 leave it next I choose say 1,2,4 leave it without storing after I have just used it

kind help please

in my object, I have few private variables. To make sure the object is correctly initialized between each use, I'd like to initialize these private variables each time at the start of the call each time the object is called to process something.

Some of these variables represent equations, or symbols or functions. Some of these are set by the user of the object, but some are not. And I do not want to leave those that are not set, using old values from last call.

The problem  I can't use {} nor NULL to initialized these private variables, since I am telling Maple they are of type `=` or `symbol` or `function`.

To give a small example, I use a proc here to illustrate, since it the same idea, but less code.

restart;
kernelopts('assertlevel'=2):
foo:=proc(input_ode::`=`)
   local ode::`=`:={};  #i'd like to give this some initial value. But what?
   ode:=input_ode;
end proc;

now foo(diff(y(x),x)=5) gives

Error, (in foo) assertion failed in assignment, expected `=`, got {}
Same type of error happens if I use NULL.

Is there a special value or tag one can use to initialize/reset any variable, regardless of its type? I thought at first that NULL will work, but it is not.

The idea is that I'd like all my object private variable to always have known state when the same object is called each time. ie. to clean it up before the next time is made.

The above is just an example. Ofcourse I could just do this

restart;
kernelopts('assertlevel'=2):
foo:=proc(input_ode::`=`)
   local ode::`=`; #leave it un-initialized since it will be overwritten next
   ode:=input_ode;
end proc;

And now no error. 

I read  help document of :

with(Physics[Vectors]):
(%Nabla)(f(x,y,z))
value(%)

 

But if I want to use Composition function , is it not useful? why? how to do?

(%Nabla@@4)(f(x,y,z));
value(%)

we know that:

(Nabla@@4)(f(x,y,z))

 

Hello all, 

Would you tell me how to replace a part of an equation with another expression?

I tried to replace the expression '(1-Lm^2/(Ls*Lr))' in the equation below ('LD') with an expression 'sigma', but no success. 

restart;

LD := Lambda_ds = (-Lm^2/Lr + Ls)*i_ds + Lm*Lambda_dr/Lr;

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(1)

sigma := (1-Lm^2/(Ls*Lr));

1-Lm^2/(Ls*Lr)

(2)

algsubs(1-Lm^2/(Ls*Lr)=ss,LD);

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(3)

subs({(1-Lm^2/(Ls*Lr)) = sigma}, (3));

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(4)

 


 

Download question20200618.mw

From a newbie:

Is there any way to get the Simpify from the Context Panel to clean up a little more?

I'm impressed with the job it does because it really did the job on some very hairy 5x5 matrices I had.

But I was not able to get it to completely collection all the terms of the following:

Clearly w,x, and y could have been collected like z was.  but I tried a number of approaches and could not get any of them to collect the w,x, and y terms..

Any thoughts about it?

Thanks,


 

Error, (in Compiler:-Setup) unable to write to initialization file, C:\Program Files\Maple 2020\bin.X86_64_WINDOWS/launch.ini, possibly due to insufficient permissions
NULL;

when choose bat file

but i see sufficient permission

any w should i s

choose a particular compiler or even visual studio i have in my system

 

where can i find if anything else

My OS is Windows 7 64-bit

I can't install the Physics Updates package in Maple 2020.1 and I'm looking for suggestions from anyone who has managed to do this, particularly on the above OS

Detailed timeline Nad what I have tried so far

  1. A couple of days ago I upgraded to Maple 2020.1
  2. I immediately started getting random warnings in Maple worksheets, which essentially stated that the installed Physics package (version 707) was designed for MAple 2020.0 and needed to be updated. However when I checked for \Physics updates none were available.
  3. So far, not a big problem, I figured the a Physics Update appropriate for Maple 2020.1would become available over the next few days
  4. Today I noticed that Physics Updates version 708 was available, and I made the rash(?) assumption that this would be the version I need for use with Maple 2020.1, so I tried to install it
  5. Using the icon in the top right of the the Maple worksheet in the usual way, I tried to install this update. The relevant pop-up finishes the download process, statrts the installlation process, gets about halfway through then stops along with another pop-up saying that mserver.exe has stopped working. Since the installation process was getting nowhere, I shut down Maple.
  6. Restarting Maple, and executing Physics:-Version(), I get the output `The "Physics Updates" version "708" is installed but is not active. The active version of Physics is within the library C:\\Program Files\\Maple 2020\\lib\\maple.mla, created 2020, March 5, 1:36 hours`. So maybe it did install? No, the "default location" for this package (which on my system is C:\Users\TomLeslie\maple\toolbox) contains a 'Physics Updates' folder, but the only thing in it is a 'version.txt file, which (amongst other things) contains the line cloud-version: 708.
  7. Normallly this 'Physics Updates' folder should contain a 'lib' subfolder, which in turn contains the file 'Physics Updates.maple' - but none of these exist, so I'm not convinced by the statement in (6) above that `The "Physics Updates" version "708" is installed
  8. At this stage I go into debug mode, and amognst other things, I have tried
    1. Repeat the process in (5)-(7) above - same result (including the mserver.exe crash)
    2. Delete the default installation folder C:\Users\TomLeslie\maple\toolbox\Physics Updates, and repeat the process in (5)-(7) above - same result (including the mserver.exe crash)
    3. Try 8.1 and 8.2 above running as administrator - same result
    4. Figure that maybe I have totally screwed my Maple 2020 installation, so reinstalled it, reactivated it, and updated it to 2020.1
    5. Repeated steps 8.1 to 8.3 above with exactly the same result
  9. Decide I am getting nowhere, so delete the folder C:\Users\TomLeslie\maple\toolbox\Physics Updates. The command Physics:-Version(); now returns `The "Physics Updates" package is not installed` so I assume I'm running on the Physics version which actually ships with the Maple 2020 release
  10. All suggestion for getting Physics updates running with Maple 2020.1 on 64-bit Windows 7 will be gratefully received

Hello guys I do not have a Code for you I'm sorry for that. Mybe you can help me with my Task its in German but I need to find out the (x;y) for my Saddle Point and also the local Maxima (x;y). I hope you can help me. 

Hi everyone:

How can I calculate these differentials? (a, b and R are constants). 

tnx...

I read the article "ONEOptimal: A Maple Package for Generating One-Dimensional Optimal System of Finite Dimensional Lie Algebra", and also searched out in Maplesoft website, but couldn't found. Does anyone have the package?

As I am playing with Maple object to understand it better, I found strange thing.

I have simple object with 2 methods. Both are exported so they could be called from outside.

One method is called set_name and this one is called OK (I have print inside to print it is called). The next exported method is called process and when calling this method, the print never shows up. Which means it is not called. Using the same exact call.

When changing the name from process to something else, say processX now the print show, meaning the method is now called.

Is there restriction on what one can call their object method? And why would there be ?

Here is an example

restart;
module car_class()
      option object;
      local name::string:=""; 

      export process::static := proc(o::car_class)
             print("process method");             
      end proc:   

      export set_name::static := proc(o::car_class,_name::string)
             print("inside set name"); 
             o:-name := _name:
      end proc:     
end module:

my_car:=Object(car_class):  #make object

set_name(my_car,"toyota"):
process(my_car):
set_name(my_car,"toyota"):

On the screen, it only shows 

Now I changed it to 

restart;
module car_class()
      option object;
      local name::string:=""; 

      export processX::static := proc(o::car_class)
             print("process method");             
      end proc:   

      export set_name::static := proc(o::car_class,_name::string)
             print("inside set name"); 
             o:-name := _name:
      end proc:     
end module:

my_car:=Object(car_class):
set_name(my_car,"toyota"):
processX(my_car):
set_name(my_car,"toyota"):

And now on the screen it shows OK

Is there a way a way to be able to freely choose what method names to give to the object method? clearly the name "process"  is something special for Maple here for some reason.

When I do ?process, I see that Maple has some commands that have this name. But this is a name of a method inside Object class, so it should not have anything to do with any Maple own command. 

This was never an issue with module() for an example.  If one has to worry about what name to give to their methods for an object, then this will be very awkward. For example, what if one calls their method FOO and future version of Maple introduce a new command called FOO now the code will no longer work.

 

 

I wanted to create an Array() to store only objects of specific type in it.  

Array() supports the datatype=value  telling it the type of elements to store. But when I try to create an Array() using datatype of the class, it fails. I must be doing something wrong. Here is an example

restart;
module solution_class()
      option object;
      local sol::anything;
end module;
sol:=Object(solution_class); #create an object

Now the following works:

A:=Array();
A(1):=sol;

But I wanted to do

A:=Array(datatype=solution_class);
A(1) := sol;

 Error, unable to store '0' when datatype=module solution_class () local sol::anything; option object; end module
 

Help says 

And this is the case here, because type(sol,solution_class)  gives true

So 'solution_class' is valid type name.

Where is my error?

 

 

Dear maple users,

Greetings.

Q1.How to plot a figure for different values of M?

      like M=1,2,3,4:

Code:Mplot.mw

Q2. How to assign all the expressions are "remember table assignment"

First 420 421 422 423 424 425 426 Last Page 422 of 2308