acer

32672 Reputation

29 Badges

20 years, 72 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Ali Guzel  Thanks.

ps. Please don't (!) respond to spam postings. If they have no replies then as moderator I can remove-as-spam and deactivate the submitter.

@Ali Guzel  You're very welcome.

I'll try and look up the author Heck and send him my edits, in case they are of use to him.

This site does't allow .maple attachments to download properly. But if you can attach a .zip file of Doug Meades workbook then I can probably find time to look it over.

These two authors' Maple books are some of the best.

@zenterix Your first call like,

   simplify( expr, {...} )

is an example of so-called simplify with side-relations.

It might sometimes seem convenient if that action were also to do all other, more usual simplifications. But it would in fact be bad if that always happened; it would be too heavy-handed. There would be no good & easy way to prevent the followup simplifications, in cases where they were not wanted.

There are several targeted simplifications which need to be able to act quite individually. There are similar general needs for targeted/restricted manipulations for convert/combine/expand.

@Joe Riel This would also pick up any files having as extension any of the other 6 permutations allowed by that syntax.

So it doesn't select only the .pdf and .dvi files in general.

@Andiguys Make your new data lists all the same lengths.

@Andiguys Your new data lists don't have the same lengths as each other.

So it complains when you try to use them together as (column) Vectors; one is too tall or too short.

@Andiguys Did you delete one of your previously answered Questions?

(It would have been posted around Jan 30, on maximizing an objective containing a piecewise, then plotting wrt variable `e` and `delta`.)

The magenta error message in your last attachment clearly indicates the nature of your mistake.

@Andiguys A single underscore means nothing special to Maple.

But a double underscore in a name tells the GUI to pretty-print it (2D Output) with an subscript.

So, instead use  C__v with two underscores.

If you've assigned a name to that variable, then one way (of several) to prevent evaluation to the value would be to wrap with single right-quotes  'C__v'  or  ':-C__v'

You asked about subscripts in labels on January 20 (two weeks ago). See my Answer here.


ps. Did you delete one (or more) other question of yours, from the past month, including one from around Jan 30, relating to optimization with an objective containing a piecewise?

@Andiguys As I showed before, you can add,

   labeldirections=[horizontal, vertical]

to get the x-axis label horizontal and the y-axis label vertical.

Adding the option,

   axes=box

to a regular kind of plot makes a box, instead of just the two (vertrical and horizontal axes being open.

You can find explanations of these options for 2D plotting commands on the Help Page with topic plot,options

@Andiguys I use "\n" the new-line character to pad the axis labels, so that they don't crowd in too close to the axes. Adjust to taste.

You can also add your own choice(s) of view to either P1 or P2, separately, etc.

The easiest way to exclude some of the left data values is to just chop the block off, by simple indexing.

Andiguys_dual_ac4.mw

 

This revision has distinct legend entries, so that the curves of the same color can be distinguished properly. (The pointline style isn't properly supported by the GUI, for legend items. So I fake it here by duplicating with both line and point styles separately done).

I'm only content to use the same color for the curves as for the two vertical axes.Without that distinction there's little visual cue at all to show which axis relates to any given curve. (See later example below, where the axes labels provide a cue -- unsatisfactory, IMO.)
nb. The GUI always merges all the legend entries of a dualaxisplot, which is a shame. The Library code allows construction of a PLOT structure in which one axis's info specifies its curve's legend entries to have location=left, while the other axis's info specifies legend=right for its curves. But the GUI still renders them all at one spot. So a split pair of legend boxes cannot serve as the visual cue for which curves go with which vertical axis. A shame.

Adjust with your favour point symbols...

restart;

with(plots):

X:=[10000,70000,75000,80000,85000,90000,95000]:
Pi__1_b:=[12478250.8,18963457.2,17846277.6,16743622.7,15655492.6,14581887.3,13522806.7]:
Pi__1_r:=[484495.57,204495.57,240745.572,281162.238,325745.572,374495.572,427412.238]:
Pi__2_b:=[11771004.6,118829161.3,17647617.5,16468147.5,15290751.2,14115428.6,12942179.7]:
Pi__2_r:=[512506.36,221280.537,259449.16,301765.4,348229.239,398840.68,453599.723]:

P1 := plot([ <<X>|<Pi__1_b>>,
             <<X>|<Pi__1_b>>,
             <<X>|<Pi__2_b>>,
             <<X>|<Pi__2_b>> ],
           color="Burgundy",
           legend=[`#msubsup(mi("Pi"),mi("b"),mn("1"));`,
                   "",
                   `#msubsup(mi("Pi"),mi("b"),mn("2"));`,
                   ""],
           view=0..max(Pi__1_b[],Pi__2_b[]), size=[500,400],
           style=[point,line,point,line], symbolsize=9,
           symbol=[box,box,asterisk,asterisk]
           ):

P2 := plot([ <<X>|<Pi__1_r>>,
             <<X>|<Pi__1_r>>,
             <<X>|<Pi__2_r>>,
             <<X>|<Pi__2_r>> ],
           color="Navy",
           legend=[`#msubsup(mi("Pi"),mi("r"),mn("1"));`,
                   "",
                   `#msubsup(mi("Pi"),mi("r"),mn("2"));`,
                   ""],
           view=0..max(Pi__1_r[],Pi__2_r[]), size=[500,400],
           style=[point,line,point,line], symbolsize=9,
           symbol=[box,box,asterisk,asterisk]
           ):

dualaxisplot(display(P1, axis[2]=[color="Burgundy"]),
             display(P2, axis[2]=[color="Navy"]),
             view=[70000..max(X), default], size=[600,400]);

 

 

Download Andiguys_dual_acc.mw

And here is the idea of using labels on the two vertical axes, as a way to give a cue as to how the curves related to the scales. (I find this awkward; one's eye has to match by doing a triple-step: A curve to its color, then the color to a legend entry, and then the legend entry's name to one of the vertical axis labels. oof.)

restart;

with(plots):

X:=[10000,70000,75000,80000,85000,90000,95000]:
Pi__1_b:=[12478250.8,18963457.2,17846277.6,16743622.7,15655492.6,14581887.3,13522806.7]:
Pi__1_r:=[484495.57,204495.57,240745.572,281162.238,325745.572,374495.572,427412.238]:
Pi__2_b:=[11771004.6,118829161.3,17647617.5,16468147.5,15290751.2,14115428.6,12942179.7]:
Pi__2_r:=[512506.36,221280.537,259449.16,301765.4,348229.239,398840.68,453599.723]:

P1 := plot([ <<X>|<Pi__1_b>>,
             <<X>|<Pi__2_b>> ],
           color=[red,blue], labels=["X", Pi__b],
           legend=[`#msubsup(mi("Pi"),mi("b"),mn("1"));`,
                   `#msubsup(mi("Pi"),mi("b"),mn("2"));`],
           view=0..max(Pi__1_b[],Pi__2_b[]), size=[500,400]
           ):

P2 := plot([ <<X>|<Pi__1_r>>,
             <<X>|<Pi__2_r>> ],
           color=[yellow,green], labels=["X", Pi__r],
           legend=[`#msubsup(mi("Pi"),mi("r"),mn("1"));`,
                   `#msubsup(mi("Pi"),mi("r"),mn("2"));`],
           view=1e5..max(Pi__1_r[],Pi__2_r[]), size=[500,400]):

dualaxisplot(P1, P2,
             view=[70000..max(X), default], size=[600,400]);

Download Andiguys_dual_accc.mw

@Andiguys You could adjust the following to your taste (I just made it, before seeing your latest attachment...)

The first example runs from X=70000..95000, and the second  runs from the 3rd data point, ie. X=75000..95000. I wasn't sure what kind of vertical view you wanted.

I can adjust the colors/styles a little, so that the legends entries are distinct.

Your latest attachment did not follow my earlier instructions. I wrote to combine a pair or usual plots (each having two curves), into a single dualaxisplot. Instead, you created two dualaxisplots and have asked how to combine them. That's not the right way to get the effect you appear to be after.

restart;

with(plots):

X:=[10000,70000,75000,80000,85000,90000,95000]:
Pi__1_b:=[12478250.8,18963457.2,17846277.6,16743622.7,15655492.6,14581887.3,13522806.7]:
Pi__1_r:=[484495.57,204495.57,240745.572,281162.238,325745.572,374495.572,427412.238]:
Pi__2_b:=[11771004.6,118829161.3,17647617.5,16468147.5,15290751.2,14115428.6,12942179.7]:
Pi__2_r:=[512506.36,221280.537,259449.16,301765.4,348229.239,398840.68,453599.723]:

P1 := plot([ <<X>|<Pi__1_b>>,
             <<X>|<Pi__2_b>> ],
           color="Burgundy", legend=[`#msubsup(mi("Pi"),mi("b"),mn("1"));`,
                                     `#msubsup(mi("Pi"),mi("b"),mn("2"));`],
           view=0..max(Pi__1_b[],Pi__2_b[]), size=[500,400],
           symbolsize=10, style=pointline, symbol=[circle,asterisk]
           ):

P2 := plot([ <<X>|<Pi__1_r>>,
             <<X>|<Pi__2_r>> ],
           color="Navy", legend=[`#msubsup(mi("Pi"),mi("r"),mn("1"));`,
                                 `#msubsup(mi("Pi"),mi("r"),mn("2"));`],
           view=0..max(Pi__1_r[],Pi__2_r[]), size=[500,400],
           symbolsize=10, style=pointline, symbol=[circle,asterisk]):

dualaxisplot(display(P1, axis[2]=[color="Burgundy"]),
             display(P2, axis[2]=[color="Navy"]),
             view=[70000..max(X), default], size=[600,400]);

P1k := plot([ <<X>|<Pi__1_b>>[3..,..],
             <<X>|<Pi__2_b>>[3..,..] ],
           color="Burgundy", legend=[`#msubsup(mi("Pi"),mi("b"),mn("1"));`,
                                     `#msubsup(mi("Pi"),mi("b"),mn("2"));`],
           size=[500,400],
           symbolsize=10, style=pointline, symbol=[circle,asterisk]
           ):

P2k := plot([ <<X>|<Pi__1_r>>[3..,..],
             <<X>|<Pi__2_r>>[3..,..] ],
           color="Navy", legend=[`#msubsup(mi("Pi"),mi("r"),mn("1"));`,
                                 `#msubsup(mi("Pi"),mi("r"),mn("2"));`],
           size=[500,400],
           symbolsize=10, style=pointline, symbol=[circle,asterisk]):

dualaxisplot(display(P1k, axis[2]=[color="Burgundy"]),
             display(P2k, axis[2]=[color="Navy"]),
             view=[75000..max(X), default], size=[600,400]);

 

Download Andiguys_dual_ac.mw

@Andiguys I showed you (three days ago) how the dualaxisplot command can be used to nicely show data from two different scales.

In my example from that link I used a color for the curves and two vertical axes, to make the correspondence more visually clear.

I'm not going to retype this data into Maple. You can upload it in a worksheet if you'd like me to show these four in an explicit example.

If you want two columns for each vertical axis then you can do it as follows:
 1) Make two usual plots, each with 2 of the curves in them (ie. pairs whose scales agree). Or put 3 curves in one usual plot, and 1 curve in the other. It depends on which columns share a scale.
  2) Use plots:-dualaxisplot to combine both those plots.

@Ali Guzel  Does your response mean that you are not going to provide any representative piece of code that illustrates the issues?

By the way, are you trying to simply paste 1D plaintext code from Heck's book into 2D Input areas (Execution Groups or Document Blocks) in later Maple versions? That's not always possible. You should instead set up a Worksheet with 1D Input, and paste into that, as by far the simplest way to handle other's 1D source. (Using Code-Edit-Regions is a possible alternative, but IMO may well be more work-intensive&problematic&buggy.)

Do you have an example?

What was the last version in which the code could run, can you say?

What version was it written for, can you say?

Was it written for a version older than Maple 6 (released, year 2000)?

First 21 22 23 24 25 26 27 Last Page 23 of 598