acer

32333 Reputation

29 Badges

19 years, 326 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

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)?

@segfault 

I pass the (undocumented) option,

   -standalone

to the maple or xmaple script. That makes the GUI start in a separate JVM. I do that for much the same reason as you describe; I want a crash in one Maple GUI session to not freeze up all my other open Maple GUI sessions. This options allows separate GUI launches to be run independently far as OS and Java RT are concerned.

The above is about running separate Maple GUI instances. (I also happen to run all my worksheets with separate Maple kernels/mservers, all within any single GUI instance. But this is a different kind of thing.)

@segfault You haven't stated where you installed Maple, or how you're launching it. But the principal scripts that can launch it are,

  $(MAPLE)/bin/maple
  $(MAPLE)/bin/xmaple

if, say, MAPLE were a Linux environment variable whose value were the location of the installation.

On my Linux I have the installation location as,
   /usr/local/maple/maple2024
but my choice is mixed arbitrary/convention.

If you forget where you have installed Maple (but can still launch it from an icon, etc) then the following Maple command will return that location:
    kernelopts(mapledir);

You could hard-code extra options in a script file.

If you launch the Maple GUI by desktop icon then you could instead edit that icon's source file's script call. I personally avoid desktop icons in Linux because their format/locations can change by distro and desktop environment.

Or, if (like me) you launch Maple from a command-line xterm window then you could simply add a shell alias for the call with extra options. That's what I did. I simply added the alias to my .bashrc/.profile file and it's available in every new shell/login/etc.

@Andiguys You could add the option axes=box at the end of the plotting command.

Or, just get rid of Kitonum's choice of axes = normal

You could figure this out by reading the Help page for 3D plotting options, ie. see the section for axes.

@Rouben Rostamian  It's interesting. Your attachment was last saved by you in Maple 2024.2.

I cannot see the pretty-printed Vectors in its output if I open that in Maple 2023.2 or older. But I can using Maple 2024.1, say.

I left your attachment link alone, but replaced the (problematic) inlined content in your Answer.

The OP seems to use Maple 2022. That version runs your attachment fine.

Have you looked at this Question, from October 2024?

Its Answer involved substitution, in particular using simplify with side-relations involving bilinear derivatives, etc.

@Andiguys I realized (from work on another another of your recent Questions) that the piecewise objective presents some issues for some of ther Optimization nonlinear solvers (including the default method=sqp, which seems to need good behavior of the derivatives, which the piecewise objective might muddy...).

And (my earlier idea of) interpolating from your original mere four (4) Cv values turns out to be a bad idea, and altogether misses the piecewise effects.

I don't have time to analyze the objective symbolically (generically), but I've checked the following with a faster Optimization method as well as with a forced DirectSearch global optimizer at all points. The plots agree  (and you can experiment with the attachment).

Question_plot_cv_ac2CC.mw

I've used a dual-axis 2D plot, to present better the two curves on their different scales.

 


ps. I've also re-done the contour plots (3D and 2D).

This sounds like something for which you might wish to contact to Maplesoft Tech Support.

I have deleted another Question, which duplicated very closely one problematic part of this Question's attachment.

Duplicate Question threads get tagged as such, and may be flagged and deleted.

Please don't post such close followup queries (or repeats, or even additional followup details) in wholly separate new Question threads. Instead, you could put the repeat/followup in a Reply/Comment here.

My Answer below does show (in more than one way) some approaches for getting around the "no improved point could be found" error message for your kind of piecewise objective. I suggest that you study it, then get back to us (here) if you are unable to resolve it.

@Andiguys 

1) A very simple change to the evalf[2] calls in the textplot parts of the ContoursWithLabels procedure allows for your choice of decimal places. You could change it to evalf[4], say. I think you could have figured that out. Or it could be made into a new option to the proc, as I've done in the attachment below.
2) You can simply call plot3d on it. I think you could have figured that out (especially since I did that in an earlier Reply above).

Question_plot_cv_ac2B.mw

@vv For L=9 the following takes about 7sec for me,

[seq](radnormal(expand(p(radnormal(expand(evstheory[i]))))), i = 1 .. L^2)

First 15 16 17 18 19 20 21 Last Page 17 of 592