Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 28 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@MapleEnthusiast This is such a trivial modification to my Answer above that I must insist (for pedagogical reasons) that you try to do it yourself. If you've failed after repeated attempts, ask again and I'll show you.

Hint: seqadd, and mul are essentially the same command with the same syntax. The only thing that changes is the associative operator used: add is addition, mul is multiplication, and seq is concatenation with a comma.

In my opinion, I'd modify acer's "Using concatenated names in procedures is poor programming practice" to "Using concatenated names as variables in procedures is poor programming practice". Perhaps acer will agree with this modification. Names are often constructed essentially as strings to achieve a certain displayed effect. It's often impossible to make these local due to the need for concatenation, and there's often no other way to get the displayed effect.

@ecterrab In your Reply to Ambrozy above, you included two examples in boxes. Those boxes appear in my browser as totally black rectangles with no writing. My browser is Google Chrome, and I tried viewing it on both Windows 10 and Android. Even if I use my Moderator power to view your Reply in the editor, they still appear like that.

Your attached worksheet does not show an example of it "not working for derivatives". Please update the worksheet.

Nonetheless, I do understand what the problem is, and I'm trying to come up with a solution. However, this is substantially more complicated than doing explicit functions.

@Joe Riel Oops, I had TransferFunction in my worksheet, not PrintSystem. I copy-and-pasted the wrong line!

@9009134 You can start by reading the help pages that come with the package. Let me know if you can access the help pages. (Help pages of third-party packages are accessed exactly the same way as regular Maple help pages.) On the main page ?DirectSearch there is a section labeled "Multi-objective optimization". Note that fitting model parameters to a finite set of data points is the same thing as minimizing the residuals using the parameters as decision variables. The most well known way is "least squares"---minimizing the sum of the squares of the residuals---but the DirectSearch package offers many alternatives to this (see ?DirectSearch,DataFit for a table listing those alternatives).

In the section "Multi-objective optimization", there are seven commands listed:

Minimax                 Weighted Minimax (Maximin) method
CompromiseProgramming   Compromise Programming method
WeightedSum             Weighted Sum method
BoundedObjective        Bounded Objective Function method
ModifiedTchebycheff     Modified Tchebycheff method
WeightedProduct         Weighted Product method
ExponentialWeightedSum  Exponential Weighted Sum method

I do not know much more about this subject.

@Carl Love I tested the above procedure in Windows 10 Home. I hope that others will test other OSs. Maple 2020 is required for the FileTools:-Walk command.

@Lenny I'd like to see that expression both before and after you converted it to a string.

@acer Yes, of course, a posted worksheet is better. I said what I said because I suspected that there was a simple fix that I didn't know the details of. And, it's really annoying when people post (through no fault of their own) these incredibly mangled 1D transcriptions of their code.

@9009134 The DirectSearch package (you'll need to download it, but it's free) does multi-objective fits and can use penalty methods.

@sand15 When the constraints are polynomial, simplify with side relations works much better than algsubs, in my opinion. For one thing, it processes the entire set of constraints as a whole.

@Ali Hassani I don't know any method to solve a set of equations in parallel. If you can find any method, I'd help implement it in Maple.

I don't quite see your pattern. If you can express it with symbols instead of numbers for the indices, then it'd be trivial for me to generate all the permutations, which you could then pass to simplify.

I've seen you use as an index before. Am I correct in guessing that is a fixed, constant symbol rather than a variable that may (possibly at some future unspecified time) be given an integer value similar to the other indices?

@acer I've seen this many times before: 2D Input being converted into some abomination of 1D input with operators in prefix-functional form and numerous explicit invocations of Typesetting:-. Perhaps it has something to do with interface(typesetting= extended)?

@Carl Love Here it is, albeit significantly more code than my estimate.

CopyDir:= proc(src::string, dest::string)
uses FT= FileTools;
local n:= 1+length(src), r, d, f, limb, ds:= kernelopts('dirsep');
    if not FT:-Exists(dest) then FT:-MakeDirectory(dest) fi;
    for r in FT:-Walk(src, 'topdown', 'followlinks') do
        limb:= cat(dest, ds, r:-dir[n..], ds);
        for d in r:-subdirs do
            (d-> `if`(FT:-Exists(d), 0, FT:-MakeDirectory(d)))(
                cat(limb, d)
            )
        od;
        seq(FT:-Copy(cat(r:-dir, ds, f), cat(limb, f)), f= r:-files) 
    od;
    return
end proc
:
#Example:
CopyDir("C:/Program Files/Maple 2020", "C:/Users/carlj/desktop/maple");

 

@winfredgg Since you had some interest in using eval, I modified my Answer above to use it correctly. I changed the first argument of semilogplot from a seq command to an eval command. This is how I would've done it myself anyway, had I not been following your use of seq. But there's nothing wrong with your use of seq!

First 159 160 161 162 163 164 165 Last Page 161 of 709