acer

32358 Reputation

29 Badges

19 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

s1 := solve(x^2+3*x+2 > 0, {x});
                       {x < -2}, {-1 < x}

s2 := solve(x^2-9 >= 0, {x});
                      {x <= -3}, {3 <= x}

s3:=`or`(seq(`and`(op(x)),x in [s1]));
                        x < -2 or -1 < x

s4:= `or`(seq(`and`(op(x)),x in [s2]));
                       x <= -3 or 3 <= x

solve({ s3 and not s4 });
               {-1 < x, x < 3}, {-3 < x, x < -2}

acer

It can be fiddled with. This subtask is easier if you start with your earlier way of calling solve,

s1 := solve(x^2+3*x+2 > 0, {x});
                       {x < -2}, {-1 < x}

s2 := solve(x^2-9 >= 0, {x});
                      {x <= -3}, {3 <= x}

`or`(seq(`and`(op(x)),x in [s1]));
                        x < -2 or -1 < x

`or`(seq(`and`(op(x)),x in [s2]));
                       x <= -3 or 3 <= x

I made that a little more complicated than just this example needs. In case of multiple parts of any of the different solutions given by s1 (or s2), each `seq` has an extra `and`,

acer

It can be fiddled with. This subtask is easier if you start with your earlier way of calling solve,

s1 := solve(x^2+3*x+2 > 0, {x});
                       {x < -2}, {-1 < x}

s2 := solve(x^2-9 >= 0, {x});
                      {x <= -3}, {3 <= x}

`or`(seq(`and`(op(x)),x in [s1]));
                        x < -2 or -1 < x

`or`(seq(`and`(op(x)),x in [s2]));
                       x <= -3 or 3 <= x

I made that a little more complicated than just this example needs. In case of multiple parts of any of the different solutions given by s1 (or s2), each `seq` has an extra `and`,

acer

@Jarekkk Sorry, I did not see notice of this comment before. Yes, by SCR I mean this, as a euphemism for bug report.

I usually author posts in html-mode here (top left in the Editor menubar). And I use pre html-tags to insert code as verbatim. And I often set interface(prettyprint=1) when in the Standard GUI, so that I can paste rtables and HFloats, etc, when printed as output.

Basically, I find that I have to revert to the very lowest level of plaintext printing (Maple GUI) and authoring (Mapleprimes), because all the fancy mechanisms for inclusion do not work properly.

One of the few things that plaintext does not help me with is the lack of Submit&Edit round-tripping of the less-then symbol in Mapleprimes posts (whether in pre tag section, or in normal). It has to be set back to &lt; with every re-Edit, or else material will be lost. SNAFU.

@Jarekkk Sorry, I did not see notice of this comment before. Yes, by SCR I mean this, as a euphemism for bug report.

I usually author posts in html-mode here (top left in the Editor menubar). And I use pre html-tags to insert code as verbatim. And I often set interface(prettyprint=1) when in the Standard GUI, so that I can paste rtables and HFloats, etc, when printed as output.

Basically, I find that I have to revert to the very lowest level of plaintext printing (Maple GUI) and authoring (Mapleprimes), because all the fancy mechanisms for inclusion do not work properly.

One of the few things that plaintext does not help me with is the lack of Submit&Edit round-tripping of the less-then symbol in Mapleprimes posts (whether in pre tag section, or in normal). It has to be set back to &lt; with every re-Edit, or else material will be lost. SNAFU.

@serena88 

ans:=seq(x*B, x in A);

ans[3];

@serena88 

ans:=seq(x*B, x in A);

ans[3];

@mrask The `simplify` command should get rid of terms identically like 0.*I (while the `fnormal` command can turn "negligible" float values to 0.0 or 0.0*I).

The 0.*I terms look like so-called numeric artefacts (due to round-off error during float computation).

@mrask The `simplify` command should get rid of terms identically like 0.*I (while the `fnormal` command can turn "negligible" float values to 0.0 or 0.0*I).

The 0.*I terms look like so-called numeric artefacts (due to round-off error during float computation).

@mrask Ok, my example will be much shorter, because I'm not going to type in numbers from an embedded image.

It matches pretty well on r=-1..1.

Exx:=((9.134566608e19*cos(arctan(0.36397023*r)+0.087266462)^2
     +1.73113669e21*cos(arctan(0.36397023*r)+0.087266462)^6))/
     (8.65439107e19*cos(arctan(0.36397023*r)+0.087266462)^2):

sol:=numapprox[minimax](Exx,r=-1..1,[3,3]);

  (19.00213865

     + (-12.01638803 + (0.01176765813 + 0.5417654592 r) r) r)/

    (0.9155088810

     + (-0.4682135154 + (0.1689822380 - 0.09816443908 r) r) r)

plot([Exx,sol],r=-4.8..1.85,legend=["Exx","sol"]);

But when I look at Exx a few things come to mind. The presence of so many common subterms, and those rather large exponents which all just happen to cancel out nicely, makes me wonder whether your call to `simplify` had not perhaps done more damage than good. Maybe you could upload your full worksheet, or something with the unsimplified expression.

@mrask Ok, my example will be much shorter, because I'm not going to type in numbers from an embedded image.

It matches pretty well on r=-1..1.

Exx:=((9.134566608e19*cos(arctan(0.36397023*r)+0.087266462)^2
     +1.73113669e21*cos(arctan(0.36397023*r)+0.087266462)^6))/
     (8.65439107e19*cos(arctan(0.36397023*r)+0.087266462)^2):

sol:=numapprox[minimax](Exx,r=-1..1,[3,3]);

  (19.00213865

     + (-12.01638803 + (0.01176765813 + 0.5417654592 r) r) r)/

    (0.9155088810

     + (-0.4682135154 + (0.1689822380 - 0.09816443908 r) r) r)

plot([Exx,sol],r=-4.8..1.85,legend=["Exx","sol"]);

But when I look at Exx a few things come to mind. The presence of so many common subterms, and those rather large exponents which all just happen to cancel out nicely, makes me wonder whether your call to `simplify` had not perhaps done more damage than good. Maybe you could upload your full worksheet, or something with the unsimplified expression.

@Jarekkk Interesting. It also seemed to work ok for me using 32bit Maple 15.01 on Windows XP, in the Classic GUI (both with and without the x=8 constraint). Perhaps support@maplesoft.com could reproduce the problem on 32bit Vista Home Premium.

The example, Optimization:-LPSolve(7*x+3*y, {6*x+2*y >= 49},assume=nonnegint) works fine for me in both the Classic and Standard GUIS of 32bit Maple 14.01 and 15.01 for MS-Windows.

What platform are you running it on? Is there anything in your initialization file?

acer

This can be considered as a feasibility question: given some linear constraints and the requirement of an integer-value solution then find a feasible point.

If one adds in a linear objective function then it can be seen as the familiar (I)LP. The Optimization package can handle this particular example, if we supply an (here inconsequential) objective.

Optimization:-Minimize(1,
                       {6*x+2*y>=49, 7*x+3*y=0, y>=0},
                       assume=integer)[2];

                         [x = 8, y = 1]

acer

This can be considered as a feasibility question: given some linear constraints and the requirement of an integer-value solution then find a feasible point.

If one adds in a linear objective function then it can be seen as the familiar (I)LP. The Optimization package can handle this particular example, if we supply an (here inconsequential) objective.

Optimization:-Minimize(1,
                       {6*x+2*y>=49, 7*x+3*y=0, y>=0},
                       assume=integer)[2];

                         [x = 8, y = 1]

acer

First 412 413 414 415 416 417 418 Last Page 414 of 592