Carl Love

Carl Love

28100 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@acer Thank you for the corrections. I've never been able to get eval to work inside evalhf and now I have an example.

Still, is it ever actually worth it to create a Vector in evalhf code? Isn't it substantially more efficient to pass it in?

And is what I wrote true with respect to compiled code?

@charlesforgy 

I avoid any scenario that involves modifying the optimized code with a text editor. A substantial amount of modifying can be done with subs, and there's almost always some of that that I need to do after using codegen(..., tryhard).

Do you plan to call the resulting optimized procedure with evalhf?

Note that your entire procedure TestFunc can be replaced by 

Matrix((ii,jj), `*`);

@Adri van der Meer 

There is no need to use print in your procedure, and, indeed, it may make the procedure less useful.

@Markiyan Hirnyk 

Here's why the OP wants to separate the columns. Look closely at the Matrix in the original Question. It superficially appears to be eight columns. But the first two columns are actually one, each entry having two terms. The OP wants that to be visually obvious.

@Hamidreza 

I'm using Windows 8.1.

Your command works for me. Try doing a restart first; perhaps something has inadvertently been assigned to a or b.

@Mac Dude You wrote:

In Maple, you pick whether to use a common server for all worksheets or separate servers in the preferences.

Not true: There's a third choice in the Preferences: "Ask each time a new worksheet is created." If you make this choice, then you can select for each worksheet at the time of its creaton either a new server or one of the existing servers for the other open worksheets.

 

I find it a little hard to believe that your original Matrix is

A:=Matrix([[Matrix[[a,b],[c,d]]], [Matrix[[e,f],g,h]] ])

Are you sure that you have the parentheses and square brackets correct on that? Perhaps it's like this:

A:= Matrix([Matrix([[a,b],[c,d]]), Matrix([[e,f],[g,h]])]);

The original syntax that you gave is possible, but I find it unlikely.

If the message is as Tom Leslie suggests (which seems like a good guess except that the "1%" still has me baffled), then the solution is simple: just continue with your computation. Note that the message isn't an error, or even a warning. Maple has sucessfully computed the output and simply chooses (based on your interface settings) not to display it. And what's the point of looking at an output that can run on for hundreds of pages (I've seen one that was 4000+ pages---a single algebraic expression)? Just go on to the next step of your computation.

@tomleslie 

The cubic spline of y as a function of x isn't the inverse of the spline of x as a function of y, even with exact computation (which Maple is happy to do in this case). I'm not saying that you thought that it was. However, it may be desirable that getx and gety be inverses of each other. Consider these plots of the relative deviation from the true inverse:

plot(x-> (getx(gety(x)) - x)/x, (min..max)(xlist));
plot(y-> (gety(getx(y)) - y)/y, (min..max)(ylist));

To make them inverses, I'd use your gety and define

getx:= y-> fsolve(gety(x)=y);

If you now check the above two plots (which takes longer due to the slowness of fsolveing for every point), the relative deviations are all on the order of 10^(1-Digits) or less---what's expected for this type of numeric computation.

You may be more comfortable with this if you verify that gety is a strictly increasing, hence invertible, function. This plot shows that it is:

plot(D(gety), (min..max)(xlist))


@krismalo 

You may be more satisfied with getx as I defined it immediately above.

@farzane 

Okay, so now we've eliminated t. That leaves four variables (y[a], y[b], y[c], and x) and two equations. Theoretically, we could use one of the equations to eliminate one of y[a], y[b], or y[c] from the other equation. That'd leave us with an equation containing, say, y[a], y[b], and x. So, theoretically, I could make a 3D plot of, say, y[a] vs. x and y[b], but I couldn't make a 2D plot of y[a] vs. x alone. So, do you want such 3D plots? I emphasize theoretically because I have no idea whether the computations are numerically feasible.

@Preben Alsholm 

I think that what is meant is "4 amperes at 120 degrees plus 2.5 amperes at 60 degrees."

Do you mean a long program in a Maple worksheet? Would you please post the worksheet? Use the green up arrow that is the last item on the second row of the toolbar in the MaplePrimes editor.

First 461 462 463 464 465 466 467 Last Page 463 of 709