epostma

1579 Reputation

19 Badges

17 years, 49 days
Maplesoft

Social Networks and Content at Maplesoft.com

Maple Application Center
I am the manager of the Mathematical Software Group, working mostly on the Maple library. I have been working at Maplesoft since 2007, mostly on the Statistics and Units packages and on contract work with industry users. My background is in abstract algebra, in which I completed a PhD at Eindhoven University of Technology. During my studies I was always searching for interesting questions at the crossroads of math and computer science. When I came to Canada in 2007, I had nothing but a work permit, some contacts at Maplesoft (whom I had met at a computer algebra conference a year earlier), and a plan to travel around beautiful Canada for a few months. Since Maplesoft is a company that solves more interesting math and computer science related questions than just about anywhere else, I was quite eager to join them, and after about three months, I could start.

MaplePrimes Activity


These are replies submitted by epostma

This issue seems to come up now and then as well. Here are two relevant recent discussions:

http://www.mapleprimes.com/forum/matrixcontainingvaluesfxylistxy

http://www.mapleprimes.com/forum/buildingmatrixcolumnvectors

Best,

Erik Postma
Maplesoft.

So do I get it right that you want the loop that you'd written to iterate, not over the diagonal, but over all points in a rectangle (well, a rectangular lattice intersected with a rectangle)? Then you should write a nested loop.

Hope this helps,

Erik Postma
Maplesoft.

So do I get it right that you want the loop that you'd written to iterate, not over the diagonal, but over all points in a rectangle (well, a rectangular lattice intersected with a rectangle)? Then you should write a nested loop.

Hope this helps,

Erik Postma
Maplesoft.

As in your previous comment, use

points := [seq([dom[i],DD[i],sp4[i]],i=1..NII)]:

which should give you a list of triples of numbers - you can check with type(points, list([realcons, realcons, realcons])). This assumes you're running the loop that assigns to dom[II] as well; otherwise you can substitute i * TH for dom[i]. Then plot it with

plots:-pointplot3d(points);

Hope this helps,

Erik Postma
Maplesoft.

As in your previous comment, use

points := [seq([dom[i],DD[i],sp4[i]],i=1..NII)]:

which should give you a list of triples of numbers - you can check with type(points, list([realcons, realcons, realcons])). This assumes you're running the loop that assigns to dom[II] as well; otherwise you can substitute i * TH for dom[i]. Then plot it with

plots:-pointplot3d(points);

Hope this helps,

Erik Postma
Maplesoft.

dom, DD, and sp4 are defined in the loop (technically, they're probably tables, unless you've assigned something to either variable outside the loop you've shown above), so [dom[i], DD[i], sp4[i]] should be a well defined point for i in 1 .. NII. I think what you're proposing should work. Does it give an error?

Erik Postma
Maplesoft.

dom, DD, and sp4 are defined in the loop (technically, they're probably tables, unless you've assigned something to either variable outside the loop you've shown above), so [dom[i], DD[i], sp4[i]] should be a well defined point for i in 1 .. NII. I think what you're proposing should work. Does it give an error?

Erik Postma
Maplesoft.

For your first question: I don't understand why it doesn't work. If hvalues is generated by mapping over dTvalues, then they should have the same rtable dimensions. What does rtable_dims(dTvalues) return? And how about rtable_dims(hvalues)?

For your second question: do I understand correctly that you're confident that the loop iterates over the values for T and d that you want, and that you just want to generate a point plot of the generated points? I think it should work if you just type

plots:-pointplot3d(points);

after the fragment that you posted earlier.

Hope this helps, and all the best to you, too,

Erik Postma
Maplesoft.

For your first question: I don't understand why it doesn't work. If hvalues is generated by mapping over dTvalues, then they should have the same rtable dimensions. What does rtable_dims(dTvalues) return? And how about rtable_dims(hvalues)?

For your second question: do I understand correctly that you're confident that the loop iterates over the values for T and d that you want, and that you just want to generate a point plot of the generated points? I think it should work if you just type

plots:-pointplot3d(points);

after the fragment that you posted earlier.

Hope this helps, and all the best to you, too,

Erik Postma
Maplesoft.

OK - I see that dom and DD contain values in a sort of time * d space, and you're iterating over the diagonal as time goes from 0 to 10 and d goes from -30 to 30. I don't see what you're doing with all the variants of sp.

Best,

Erik Postma
Maplesoft.

OK - I see that dom and DD contain values in a sort of time * d space, and you're iterating over the diagonal as time goes from 0 to 10 and d goes from -30 to 30. I don't see what you're doing with all the variants of sp.

Best,

Erik Postma
Maplesoft.

If you know where the singular point is, say at 0, then you could put a few extra points close to it. For example,

dvalues := Vector([seq(d, d=-50..-5, 5), -1, -1/10, 1/10, 1, seq(d, d=5..50, 5)]);

For a 3d plot you could do the same as for 2d; you just have to supply values for both T and d now. So you define g and h as you're showing above, then

dTvalues := Vector([seq(seq([d, T], d=-50..50, 10), T=1/2..5, 1/2)]);
hvalues := map(dTv -> evalf[6](eval(h, [d = dTv[1], T = dTv[2]])), dTvalues);
# plotting is now slightly more tricky:
plots:-pointplot3d([seq([op(dTvalues[i]), hvalues[i]], i=rtable_dims(dTvalues))]);

However, for a 3D plot you need many more points before you have a convincing approximation of the surface than you need in 2D to get a decent approximation of a curve.

Hope this helps,

Erik Postma
Maplesoft.

NOTE: in an earlier version of this comment, there was a typo in the specification of i for the seq in the plot command.

If you know where the singular point is, say at 0, then you could put a few extra points close to it. For example,

dvalues := Vector([seq(d, d=-50..-5, 5), -1, -1/10, 1/10, 1, seq(d, d=5..50, 5)]);

For a 3d plot you could do the same as for 2d; you just have to supply values for both T and d now. So you define g and h as you're showing above, then

dTvalues := Vector([seq(seq([d, T], d=-50..50, 10), T=1/2..5, 1/2)]);
hvalues := map(dTv -> evalf[6](eval(h, [d = dTv[1], T = dTv[2]])), dTvalues);
# plotting is now slightly more tricky:
plots:-pointplot3d([seq([op(dTvalues[i]), hvalues[i]], i=rtable_dims(dTvalues))]);

However, for a 3D plot you need many more points before you have a convincing approximation of the surface than you need in 2D to get a decent approximation of a curve.

Hope this helps,

Erik Postma
Maplesoft.

NOTE: in an earlier version of this comment, there was a typo in the specification of i for the seq in the plot command.

Arrgh, and again I made a typo. That plotting line should have been:

plots:-pointplot3d([seq([op(dTvalues[i]), hvalues[i]], i=rtable_dims(dTvalues)]);

Sorry. I'll change my earlier post.

I'm not sure I'll have time to look at the worksheet you posted earlier, what with the holidays and all...

Erik Postma
Maplesoft.

Arrgh, and again I made a typo. That plotting line should have been:

plots:-pointplot3d([seq([op(dTvalues[i]), hvalues[i]], i=rtable_dims(dTvalues)]);

Sorry. I'll change my earlier post.

I'm not sure I'll have time to look at the worksheet you posted earlier, what with the holidays and all...

Erik Postma
Maplesoft.

First 15 16 17 18 19 20 21 Page 17 of 22