mm-135 Anyone know how to export a graphic from Maple 8 to *.eps so thecolors are maintained? Maple makes a very nice BW *.eps figure (evidentlyin vector format) when I Export a selected graphic. If I export as *.wmfthe result is bitmapped rather than vector, so conversion using ImageMagickor something like that produces a bitmapped *.eps file--admittedly in color,but otherwise lousy.I want to have my cake and eat it too--vector *.eps output with color. :-(PS: ItÍs not that I havenÍt tried to use the Maple Help, I must be mis- understanding it or else it isnÍt really Helpful.-- Julian V. NobleProfessor http://galileo.phys.virginia.edu/~jvn/ Science knows only one commandment: contribute to science. -- (legacy-1.mathforum.org [144.118.94.27]) by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, (from apache@localhost) by legacy.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.10 $, legacy) id hAB5SqC26975 =+ Julian V. Noble :| Anyone know how to export a graphic from Maple 8 to *.eps so the| colors are maintained? Maple makes a very nice BW *.eps figure (evidently| in vector format) when I Export a selected graphic. If I export as *.wmf| the result is bitmapped rather than vector, so conversion using ImageMagick| or something like that produces a bitmapped *.eps file--admittedly in color,| but otherwise lousy.| | I want to have my cake and eat it too--vector *.eps output with color. :-(I use this code:default_plot:=window; # replace window by inline if you preferpsoptions:=portrait,noborder,color;psplot:=proc(plot, filename) plotsetup(ps,plotoutput=filename,plotoptions=psoptions); print(plot); plotsetup(default_plot);end:Then, after creating a plot that I wish to save in a file, I can typepsplot(%,filename.eps);Now that you know about plotsetup, I am sure you can find other usefuloptions yourself in the help pages. 8-)Crossposted to comp.soft-sys.math.maple and followups set.-- * Harald Hanche-Olsen - Debating gives most of us much more psychological satisfaction than thinking does: but it deprives us of whatever chance there is of getting closer to the truth. -- C.P. Snow 1) Is there a way to minimize or maximize two variables simultaneously? That>doesnÍt mean that the method of choice needs to be linear programming. I>mean is there any other mathematical method?The question is what you mean by (say) minimizing two variables simultaneously. Usually these are contradictory goals: the solutions that minimize x are not the ones that minimize y. What you can do(e.g. with the help of parametric linear programming) is to finda piecewise-linear function Y(x) giving the minimum possible y foreach possible x.Robert Israel israel@math.ubc.caDepartment of Mathematics http://www.math.ubc.ca/~israel University of British Columbia Vancouver, BC, Canada V6T 1Z2 >>1) Is there a way to minimize or maximize two variables simultaneously? That>>doesnÍt mean that the method of choice needs to be linear programming. I>>mean is there any other mathematical method?The question is what you mean by (say) minimizing two variables >simultaneously. Usually these are contradictory goals: the solutions >that minimize x are not the ones that minimize y. What you can do>(e.g. with the help of parametric linear programming) is to find>a piecewise-linear function Y(x) giving the minimum possible y for>each possible x.>>Robert Israel israel@math.ubc.ca>Department of Mathematics http://www.math.ubc.ca/~israel >University of British Columbia >Vancouver, BC, Canada V6T 1Z2> Och... Really?...A.L. > I think the solver plugging has integer programming capability in>> Excel. You could also look up the excellent solver software known as>> lp_solve, at ftp://ftp.ics.ele.tue.nl/pub/lp_solve/README, and the GNU>> modeling> package,>> GLTK, at http://www.gnu.org/software/glpk/glpk.html. ThereÍs a great FAQ> on>> LP and MIP at>> http://www-unix.mcs.anl.gov/otc/Guide/faq/ linear-programming-faq.html.> HTH.> .... Bob> > 1) Is there a way to minimize or maximize two variables simultaneously?> That doesnÍt mean that the method of choice needs to be linear> programming. I mean is there any other mathematical method?> 2) In the excel there is an option for a variable (at the constraints tab)> to take a bin value. WhatÍs that and is there a possible way to use it> at the diet problem?Not generally -- at least not that IÍm aware of. You could try minimizing ormaximizing the sum of the two, or something similar. The main issue isthis. Suppose the place or places where the first variable is minimized donot overlap the place or places where the second is minimized. What do youdo then? Which place do you choose?HereÍs an example:Minimize x and y such that:x >= 0y >= 0x + y >= 10You can see that (0,10) provides a minimum value for x, and (10,0) providesa minimum value for y. In fact, the minimum value for x is achievedanywhere that x = 0 and y >= 10. And the minimum value for y is achievedanywhere that x >= 10 and y = 0. But thereÍs no way to bring those tworegions together.HTH..... Bob Not generally -- at least not that IÍm aware of. You could try minimizingor> maximizing the sum of the two, or something similar. The main issue is> this. Suppose the place or places where the first variable is minimized do> not overlap the place or places where the second is minimized. What do you> do then? Which place do you choose?>> HereÍs an example:>> Minimize x and y such that:>> x >= 0> y >= 0> x + y >= 10>> You can see that (0,10) provides a minimum value for x, and (10,0)provides> a minimum value for y. In fact, the minimum value for x is achieved> anywhere that x = 0 and y >= 10. And the minimum value for y is achieved> anywhere that x >= 10 and y = 0. But thereÍs no way to bring those two> regions together.>> HTH. .... BobLook at an alternative answer I got:Yes, if optimziation problem is constraints are linear and allperformance functions are linear, then the multicriteriaoptimization problem can be reduced to linear programming problem.The simplest and programming. Theer are many books discussing this topic.Check from legacy.mathforum.org (legacy-1.mathforum.org [144.118.94.27]) by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) with ESMTP id = IÍve posted a lot in an area called algebraic number theory, pointingout that there are some important numbers which mathematicians haveleft out in the cold.In this post you can meet those numbers.It tutns out thereÍs a quick and basic argument which conclusivelyproves that there are numbers left out by the definition of algebraicintegers.Consider(c_1 x + 7)(c_2 x + 7)( c_3 x + 2) = 49(x^3 + 5x^2 + 3x + 2)where you might wonder what the cÍs are, and thatÍs what is covered inthis post.Now then, you have as a zero of the factorization x = -7/c_1, so letx= -7/c_1, so you have49(-7^3/c_1^3 + 5(49)/c_1^2 - 21/c_1 + 2) = 0which is2c_1^3 - 21 c_1^2 + 245 c_1 - 343 = 0.But that is a non-monic primitive irreducible over Q, so c_1 and bysymmetry c_2 cannot be algebraic integers. However they must bealgebraic numbers, and it can be shown that any algebraic number canbe written as the ratio of algebraic integers.So then there must exist f, such that fc_1 is an algebraic integer,and letting g = fc_1 and multiplying both sides by f, I have(gx + 7f)(c_2 x + 7)( c_3 x + 2) = 49f(x^3 + 5x^2 + 3x + 2)so a zero is now x = -7f/g, which gives49f(-7^3f^3/g^3 + 5(49)f^2/g^2 - 21f/g + 2) = 0which is2g^3 - 21f g^2 + 245f^2 g - 343 f^3 = 0which proves that f must have 2 itself as a factor for g to be analgebraic integer.For instance, letting f=2, givesg^3 - 21 g^2 + 245(2) g - 343 (4) = 0.But looking back again at(c_1 x + 7)(c_2 x + 7)( c_3 x + 2) = 49(x^3 + 5x^2 + 3x + 2)that would mean that c_3 has a factor that is 2, which can distributeto c_1 x + 7, but that leaves c_2 x + 7, which also needs a factor of2 by symmetry.But you see, you only have just that one 2.So c_1 and c_2 while not algebraic integers cannot be written as aratio of non-unit coprime algebraic integers either.These numbers represent an unexplored frontier of mathematics, and anopportunity for many of you to make an impact like you never couldhave dreamed of before in the field.ItÍs fresh ground.James Harrishttp://mathforprofit.blogspot.com/ IÍve posted a lot in an area called algebraic number theory, pointing> out that there are some important numbers which mathematicians have> left out in the cold.> > In this post you can meet those numbers.> > It tutns out thereÍs a quick and basic argument which conclusively> proves that there are numbers left out by the definition of algebraic> integers.> > Consider> > (c_1 x + 7)(c_2 x + 7)( c_3 x + 2) = > > 49(x^3 + 5x^2 + 3x + 2)> > where you might wonder what the cÍs are, and thatÍs what is covered in> this post.> > Now then, you have as a zero of the factorization x = -7/c_1, so let> x= -7/c_1, so you have> > 49(-7^3/c_1^3 + 5(49)/c_1^2 - 21/c_1 + 2) = 0> > which is> > 2c_1^3 - 21 c_1^2 + 245 c_1 - 343 = 0.> > But that is a non-monic primitive irreducible over Q, so c_1 and by> symmetry c_2 cannot be algebraic integers. However they must be> algebraic numbers, and it can be shown that any algebraic number can> be written as the ratio of algebraic integers.> > So then there must exist f, such that fc_1 is an algebraic integer,> and letting g = fc_1 and multiplying both sides by f, I have> > > (gx + 7f)(c_2 x + 7)( c_3 x + 2) = 49f(x^3 + 5x^2 + 3x + 2)> > so a zero is now x = -7f/g, which gives> > 49f(-7^3f^3/g^3 + 5(49)f^2/g^2 - 21f/g + 2) = 0> > which is> > 2g^3 - 21f g^2 + 245f^2 g - 343 f^3 = 0> > which proves that f must have 2 itself as a factor for g to be an> algebraic integer.Sorry, but IÍve decided that statement is not proven in the post.James Harrishttp://mathforprofit.blogspot.com/ =...>Sorry, but IÍve decided that statement is not proven in the post.James Harris>http://mathforprofit.blogspot.com/It says: because algebraic integers is then clearly not the ring that mathematicians thought it was.The content of the first message also appeared at sci.logic and itwas replied to, and it the Google.com people archived some messages: IÍve posted a lot in an area called algebraic number theory, pointing>out that there are some important numbers which mathematicians have>left out in the cold.>>ItÍs fresh ground.James Harris>http://mathforprofit.blogspot.com/-Craig Carey =I am new to Maple 7.0 and used several hours without result.I want to solve this equation in vector form F=q(E+ v x B)even I simplify it with taking linear vectors for E and B(not functions: E=(Ex, Ey, Ez), B=(Bx,By,Bz) but not E=(Ex(x,y,z), Ey(x,y,z),...) etc)F=ma, with m=1F= i(d2x/dt2)+j(....etcq=chargeE=electric fieldv=veleocity=i(dx/dt)+j(dy/dt)+....etcAny help is appreciated..I coud come up to this point below, but after that I triedall I can try like dsolve, etc. without hell.> E:=; [Ex] [ ] E := [Ey] [ ] [Ez]> B:=; [Bx] [ ] B := [By] [ ] [Bz]> v:=; [D(x)(t)] [ ] v := [D(y)(t)] [ ] [D(z)(t)]> vxB:=CrossProduct(v,B); [D(y)(t) Bz - D(z)(t) By] [ ] vxB := [D(z)(t) Bx - D(x)(t) Bz] [ ] [D(x)(t) By - D(y)(t) Bx]> F_left:=q*(E+vxB); [Ex + D(y)(t) Bz - D(z)(t) By] [ ] F_left := q [Ey + D(z)(t) Bx - D(x)(t) Bz] [ ] [Ez + D(x)(t) By - D(y)(t) Bx]> F_right:=Vector([(D@@2)(x)(t),(D@@2)(y)(t),(D@@2)(z)(t)]); [ (2) ] [(D )(x)(t)] [ ] F_right := [ (2) ] [(D )(y)(t)] [ ] [ (2) ] [(D )(z)(t)]> diff_eq:=F_right=F_left; [ (2) ] [(D )(x)(t)] [Ex + D(y)(t) Bz - D(z)(t) By] [ ] [ ] diff_eq := [ (2) ] = q [Ey + D(z)(t) Bx - D(x)(t) Bz] [(D )(y)(t)] [ ] [ ] [Ez + D(x)(t) By - D(y)(t) Bx] [ (2) ] [(D )(z)(t)]Aran > F_left:=q*(E+vxB);|> [Ex + D(y)(t) Bz - D(z)(t) By]|> [ ]|> F_left := q [Ey + D(z)(t) Bx - D(x)(t) Bz]|> [ ]|> [Ez + D(x)(t) By - D(y)(t) Bx]Maple does not automatically distribute a non-numeric factor such as qinside the vector. You can say> F_left:= simplify(F_left); [q (Ex + D(y)(t) Bz - D(z)(t) By)] [ ] F_left := [q (Ey + D(z)(t) Bx - D(x)(t) Bz)] [ ] [q (Ez + D(x)(t) By - D(y)(t) Bx)]>> diff_eq:=F_right=F_left;For dsolve, you want a set of differential equations, or expressions which are interpreted as differential equations (expression) = 0. Once F_left has been simplified as above, you can say> diff_eq:= convert(F_right - F_left, set); (2)diff_eq := {(D )(x)(t) - q (Ex + D(y)(t) Bz - D(z)(t) By), (2) (D )(y)(t) - q (Ey + D(z)(t) Bx - D(x)(t) Bz), (2) (D )(z)(t) - q (Ez + D(x)(t) By - D(y)(t) Bx)}And then > dsolve(diff_eq, {x(t), y(t), z(t)});(rather complicated solution omitted)Or if you want initial conditions, e.g.> dsolve(diff_eq union {x(0)=0, y(0)=0, z(0)=0, D(x)(0)=0, D(y)(0)=0, D(z)(0)=0}, {x(t), y(t), z(t)});Robert Israel israel@math.ubc.caDepartment of Mathematics http://www.math.ubc.ca/~israel University of British Columbia Vancouver, BC, Canada V6T 1Z2 > |>> F_left:=q*(E+vxB);>> |> [Ex + D(y)(t) Bz - D(z)(t) By]> |> [ ]> |> F_left := q [Ey + D(z)(t) Bx - D(x)(t) Bz]> |> [ ]> |> [Ez + D(x)(t) By - D(y)(t) Bx]>> Maple does not automatically distribute a non-numeric factor such as q> inside the vector. You can say>> F_left:= simplify(F_left);>> [q (Ex + D(y)(t) Bz - D(z)(t) By)]> [ ]> F_left := [q (Ey + D(z)(t) Bx - D(x)(t) Bz)]> [ ]> [q (Ez + D(x)(t) By - D(y)(t) Bx)] diff_eq:=F_right=F_left;>> For dsolve, you want a set of differential equations, or expressions> which are interpreted as differential equations (expression) = 0.> Once F_left has been simplified as above, you can say>> diff_eq:= convert(F_right - F_left, set);>> (2)> diff_eq := {(D )(x)(t) - q (Ex + D(y)(t) Bz - D(z)(t) By),>> (2)> (D )(y)(t) - q (Ey + D(z)(t) Bx - D(x)(t) Bz),>> (2)> (D )(z)(t) - q (Ez + D(x)(t) By - D(y)(t) Bx)}>> And then>> dsolve(diff_eq, {x(t), y(t), z(t)});>> (rather complicated solution omitted)>> Or if you want initial conditions, e.g.>> dsolve(diff_eq union> {x(0)=0, y(0)=0, z(0)=0, D(x)(0)=0, D(y)(0)=0, D(z)(0)=0},> {x(t), y(t), z(t)});>> Robert Israel israel@math.ubc.ca> Department of Mathematics http://www.math.ubc.ca/~israel> University of British Columbia> Vancouver, BC, Canada V6T 1Z2 =Forgot something?I want to find out r(t)=(x(t), y(t), z(t))Option: E is a vector function E=(Ex(x,y,z), Ey(x,y,z), Ez(x,y,z))> I am new to Maple 7.0 and used several hours without result.> I want to solve this equation in vector form>> F=q(E+ v x B)>> even I simplify it with taking linear vectors for E and B> (not functions: E=(Ex, Ey, Ez), B=(Bx,By,Bz) but not> E=(Ex(x,y,z), Ey(x,y,z),...) etc)>> F=ma, with m=1> F= i(d2x/dt2)+j(....etc> q=charge> E=electric field> v=veleocity=i(dx/dt)+j(dy/dt)+....etc>> Any help is appreciated..>> I coud come up to this point below, but after that I tried> all I can try like dsolve, etc. without hell.>> E:=;>> [Ex]> [ ]> E := [Ey]> [ ]> [Ez]>> B:=;>> [Bx]> [ ]> B := [By]> [ ]> [Bz]>> v:=;>> [D(x)(t)]> [ ]> v := [D(y)(t)]> [ ]> [D(z)(t)]>> vxB:=CrossProduct(v,B);>> [D(y)(t) Bz - D(z)(t) By]> [ ]> vxB := [D(z)(t) Bx - D(x)(t) Bz]> [ ]> [D(x)(t) By - D(y)(t) Bx]>> F_left:=q*(E+vxB);>> [Ex + D(y)(t) Bz - D(z)(t) By]> [ ]> F_left := q [Ey + D(z)(t) Bx - D(x)(t) Bz]> [ ]> [Ez + D(x)(t) By - D(y)(t) Bx]>> F_right:=Vector([(D@@2)(x)(t),(D@@2)(y)(t),(D@@2)(z)(t)]);>> [ (2) ]> [(D )(x)(t)]> [ ]> F_right := [ (2) ]> [(D )(y)(t)]> [ ]> [ (2) ]> [(D )(z)(t)]>> diff_eq:=F_right=F_left;>> [ (2) ]> [(D )(x)(t)] [Ex + D(y)(t) Bz - D(z)(t) By]> [ ] [ ]> diff_eq := [ (2) ] = q [Ey + D(z)(t) Bx - D(x)(t) Bz]> [(D )(y)(t)] [ ]> [ ] [Ez + D(x)(t) By - D(y)(t) Bx]> [ (2) ]> [(D )(z)(t)]> Aran > Since this is surely a homework problem, I donÍt want to work it for you.> If you follow precisely the steps I laid out you will see how to get the> answer. Part of the exercise is to justify those steps! > -- > Julian V. Noble> Professor Emeritus of Physics> I solved the problem using the lim for a-> 0 of[1-exp(iz)]/[z^2+a^2]. This trick is very powerful.I am not sure any other method works, at least I did not succeed. What is interesting is that a similar easier integral sin x/xhas P.V. of pi, and the integral on the vanishing semicircle around the origin is -pi. If this was a result of a physics problem what would the sense be? Is the overall result pi or zero?Sergio >> Since this is surely a homework problem, I donÍt want to work it for you.> If you follow precisely the steps I laid out you will see how to get the> answer. Part of the exercise is to justify those steps! --> Julian V. Noble> Professor Emeritus of Physics> Finally I solved the problem using the lim for a-> 0 of> [1-exp(iz)]/[z^2+a^2]. This trick is very powerful.> > I am not sure any other method works, at least I did not succeed.> What is interesting is that a similar easier integral sin x/x> has P.V. of pi, and the integral on the vanishing semicircle around> the origin is -pi. If this was a result of a physics problem what> would the sense be? Is the overall result pi or zero?> > SergioThe result is pi, of course. The integral on the large semicirclevanishes as R -> infty by JordanÍs Lemma. The integral around thesmall semicircle is -pi. Thus 0 = I + Large semicircle + Small semicircle -> I - pithus I -> pi as you let epsilon and R -> 0 and infty respectively.Something similar happens when you use the contour I indicated forsin^2 (x) /x^2 . Tour trick of replacing x^2 by x^2 + a^2 inthe denominator is equivalent to changine the double pole atz=0 to one at +ia and one at -ia . The former is inside thecontour.-- Julian V. NobleProfessor Emeritus of ^^^^^^^^^^^^^^^^^^http://galileo.phys.virginia.edu/~jvn/ Science knows only one commandment: contribute to science. -- Bertolt Brecht, Galileo. The result is pi, of course. The integral on the large semicircle> vanishes as R -> infty by JordanÍs Lemma. The integral around the> small semicircle is -pi. Thus> > 0 = I + Large semicircle + Small semicircle -> I - pi> > thus I -> pi as you let epsilon and R -> 0 and infty respectively.> > Something similar happens when you use the contour I indicated for> sin^2 (x) /x^2 . Tour trick of replacing x^2 by x^2 + a^2 in> the denominator is equivalent to changine the double pole at> z=0 to one at +ia and one at -ia . The former is inside the> contour.> it would be interesting to see...Bye Sergio =Please provide me with an example of a procedure creating a 1-dimensional array,passing it to another procedure that sets its values and then in the first procedurethe arrayvalues are printed.The explanations and examples in the Help on the declaration and use of arrays has nothelped me.HereÍs one of the many variations I have tried:P1 := proc(Cn, n)local i;begin for i from 0 to n do Cn[i] := i * i; end_for;end_proc;P2 := proc(n)local Cn;begin Cn := array [0 .. n]; P1(Cn, n); print(Unquoted, Cn[4]);end_proc;-- Raymond KenningtonProgramming SolutionsTeamW2W (InfoPower) Please provide me with an example of a procedure creating a 1-dimensional> array, passing it to another procedure that sets its values and then in> the first procedure the array> values are printed.> > The explanations and examples in the Help on the declaration and use of> arrays has not helped me.> > HereÍs one of the many variations I have tried:> > P1 := proc(Cn, n)> local> i;> begin> for i from 0 to n do> Cn[i] := i * i;> end_for;> end_proc;> > P2 := proc(n)> local> Cn;> begin> Cn := array [0 .. n];> > P1(Cn, n);> > print(Unquoted, Cn[4]);> end_proc;> There is no call by reference in MuPAD (*).P1 has to return Cn; and P2 has to assign the return value (Cn:= P1(Cn, n)). (*)Exception: If Cn was a domain and P1 assigned to a slot of the domain, your solution would work because of the reference effect for domains. I donÍt believe that you are looking for this, and do not go into details.-- Stefan Wehmeierstefanw@mupad.de Please provide me with an example of a procedure creating a 1-dimensional array,> passing it to another procedure that sets its values and then in the first procedure> the array> values are printed.What you are looking for is a reference effect on arrays. Thiscannot be achieved with arrays since your function P1 always geta copy of the array in P2. There is no way to change the arrayCn in P2 as a side effect in P1. Instead P1 has to return thechanged array and P2 has to assign this changed array back to Cn:P1 := proc(Cn, n)local i;begin for i from 0 to n do Cn[i] := i * i; end_for; // return the array Cnend_proc;P2 := proc(n)local Cn;begin Cn := array(0 .. n); // assign the returned array to Cn Cn := P1(Cn, n); print(Unquoted, Cn[4]);end_proc;But you can define an own data type using domains, which doeswhat you want. The trick is to use a domain for the internalrepresentation of the elements of RefArray.domain RefArray new := proc() local myDom; begin // create a new domain for the internal representation // genident makes the key uniq myDom := newDomain(genident(RefArray)); myDom::Value := array(args()); new(dom, myDom); end_proc; print := x -> (extop(x))::Value; _index := proc(obj, idx) local myDom; begin myDom := extop(obj); myDom::Value[idx]; end_proc; set_index := proc(obj, idx, value) local myDom; begin myDom := extop(obj); myDom::Value[idx] := value; new(dom, myDom) end_proc;end_domain:P1 := proc(Cn, n)local i;begin for i from 0 to n do Cn[i] := i * i; end_for;end_proc;P2 := proc(n)local Cn;begin // use the above defined RefArray Cn := RefArray(0 .. n); P1(Cn, n); print(Unquoted, Cn[4]);end_proc;-- ** MuPAD from legacy.mathforum.org (legacy-1.mathforum.org [144.118.94.27]) by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) with ESMTP id hAA0PiB12913