Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 363 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@RES I think that you don't understand Preben's suggestion: You upload your files here and someone here will use their copy of Maple to convert the Maple code in the files to plaintext files and send them back to you. The whole process (download, export as text, upload) would take less than a minute per file for someone who had Maple.

Maple code for numeric programming (i.e., that doesn't use symbolic features) can be automatically translated by Maple to a variety of other languages: C, C#, Fortran, Java, JavaScript, Julia, Matlab, Perl, Python, R, and VisualBasic.

You say "dimensions", plural. So, you don't seem to be aware that you must view the array as one-dimensional on the C side (AFAIK).

Can't you precompute, on the Maple side, at least a reasonable upper bound for the number of elements? Then you can pass in an array with that number of elements.

@vv Vote up. But I think that your double-arrow solution is better than unapply, which has a lot of complexity that's not needed for this problem (see showstat(unapply)). Your solution can be abbreviated to

(a-> x-> a*x)~([$1..3])[];

@ You're conflating left- and right-side solutions. Up until this point, we've been solving the equation A.x = b for x. To solve the queueing problem, you need to solve x.A = b. The solution to this equation is indeed <1,1,1,1> (as a row vector). To solve this using Maple, do

IterativeApproximate(A^+, b, ...);

where the A^+ is Maplese for the transpose of A.

Please use the Reply button on the post that you are replying to to make replies. You've been using the Answer button on your original Question.

@ If I use b = <1, 0, 0, 0 >, then I do get the same result as you:

Vector(4, {(1) = 1.000428778, (2) = 0.2467490013e-3, (3) = 0.1892815477e-3, (4) = 0.1451981728e-3})

which does have the low residual that I posted.

@Vic You'll need to show me that in a worksheet. My Array prints horizintally. If you don't want to see the output, end the command with a colon (:):

Array([4, 5, 7]):

@ At this point I need to see the complete code of f in order to diagnose it further. For one thing, I need to verify that f has exactly four parameters.

The following has nothing to do with your errors, but you inaccurately transcribed something that I wrote before. The command's name is Optimization:-NLPSolve, not Optimization-NLPSolve.

@ Your objective procedure f needs to have four parameters---not a a single parameter x which you subscript as x[1], x[2], etc. You might as well name the four parameters x1, x2, etc.

@sunit It appears that you are trying to change the number of parameters/arguments of a function after the differentiation operator has been applied to it. The operator (either D or diff) doesn't know what to make of that, and neither do I. What do you intend for it to mean? Why not first change the arguments, and then take the derivative?

For example, while it's true that the derivative of sin(x) is cos(x), it doesn't follow that the derivative of sin(2*x-y) is cos(2*x-y). Indeed, the latter derivative isn't even properly specified until we say the variable with respect to which the derivative is taken.

@sunit And what do you want it changed to?

@MortenZdk There's no need to load the Units package to do what you want to do. If you don't want to clobber the arithmetic operators, then just do:

restart:
eq:= 2.*Unit(m) + d = 5.*Unit(m);
solve(eq, d);

No knowledge of units is required to solve this equation. It's just pure algebra. And Maple will return the result with the units that you expect.

The purpose of overloading the arithmetic operators by loading Units:-Standard is that you may want to enforce unit consistency, you may want to do dimensional analysis, you may want to use equivalent yet differently presented units, etc.

As for units being a gimmick: The package's knowledge of unit systems seems comphrehensive, and there are many hooks for incorporating new knowledge.

 

@John Fredsted Just a wild guess: The OP's form explicitly shows that the function has the symmetry f(w) = f(1/w).

@taro No problem. The delay for the vote up button to respond is amazingly long. You often think that you haven't actually clicked it, so you click it again, which negates the first click!

Thank you for reminding me of the shorter (Diff = diff) form.

@MortenZdk I'm sorry that that didn't work for you. What Maple version are you using? I tested it in Maple 2016.

Obviously you intended for the above to be a Reply to Joe Riel's Answer to your previous Question: 'trasfer funtion plot tmdumper". Please copy it there.

First 405 406 407 408 409 410 411 Last Page 407 of 709