acer

32490 Reputation

29 Badges

20 years, 9 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

In optimal control the issue is often related to finding optimal values of parameters that appear in the functions or formula. Is that not your case? If it is then, sure, the parameters would be the variables over which to optimize, rather than `t`. If it is the very form of `x` and `y` that are to change, then you may need another approach altogether. (genetic programming?)

How do you define your set of functions from which to take each candidate x and y?

acer

In optimal control the issue is often related to finding optimal values of parameters that appear in the functions or formula. Is that not your case? If it is then, sure, the parameters would be the variables over which to optimize, rather than `t`. If it is the very form of `x` and `y` that are to change, then you may need another approach altogether. (genetic programming?)

How do you define your set of functions from which to take each candidate x and y?

acer

@Joe Riel Yes, but it was on purpose. There is some boilerplate at the bottom of the cited Application worksheet that indicates that the copyright is owned by the author, etc, etc. So I didn't want to reproduce it.

My upload is thus triavially short and nothing special at all. I just figured that I ought to show the simple code that I'd mentioned, as it lives inside my Slider component.

I should also add that I don't really want to get rid of old style animations. They have to be supported for legacy reasons, naturally. And some plots' individual frames will always be slow to produce, so there'll still be a sensible need to produce frames in advance, sometimes. I just think that, a high proportion of the time, generating all frames in advance might not be necessary and costs far too much with the current bloat.

@Joe Riel Yes, but it was on purpose. There is some boilerplate at the bottom of the cited Application worksheet that indicates that the copyright is owned by the author, etc, etc. So I didn't want to reproduce it.

My upload is thus triavially short and nothing special at all. I just figured that I ought to show the simple code that I'd mentioned, as it lives inside my Slider component.

I should also add that I don't really want to get rid of old style animations. They have to be supported for legacy reasons, naturally. And some plots' individual frames will always be slow to produce, so there'll still be a sensible need to produce frames in advance, sometimes. I just think that, a high proportion of the time, generating all frames in advance might not be necessary and costs far too much with the current bloat.

@toandhsp 

x < -(3/4)*3^(1/3)-(1/2)*3^(2/3)-9/4 or -1/3 < x

@toandhsp 

x < -(3/4)*3^(1/3)-(1/2)*3^(2/3)-9/4 or -1/3 < x

OrProp(A,B); # A union B

                              real

AndProp(A,B);# A intersect B

                        RealRange(-2, 5)

AndProp(A,Non(B)); # A minus B (how to improve?)

      AndProp(Non(RealRange(-infinity, 5)), RealRange(-2, infinity))

That last one is a little disappointing. Using it (temporarily) as a relation,

H:=convert(AndProp(x::A,Non(x::B)),relation); # A minus B

      And(-2 <= x, x <= infinity, Not(And(-infinity <= x, x <= 5)))

solve(H,x);

                    RealRange(Open(5), infinity)

solve(H,{x});

                       {x <= infinity, 5 < x}

acer

OrProp(A,B); # A union B

                              real

AndProp(A,B);# A intersect B

                        RealRange(-2, 5)

AndProp(A,Non(B)); # A minus B (how to improve?)

      AndProp(Non(RealRange(-infinity, 5)), RealRange(-2, infinity))

That last one is a little disappointing. Using it (temporarily) as a relation,

H:=convert(AndProp(x::A,Non(x::B)),relation); # A minus B

      And(-2 <= x, x <= infinity, Not(And(-infinity <= x, x <= 5)))

solve(H,x);

                    RealRange(Open(5), infinity)

solve(H,{x});

                       {x <= infinity, 5 < x}

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

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];
First 414 415 416 417 418 419 420 Last Page 416 of 595