## Re: [Maxima-discuss] Can Maxima prove Im(x)=0?

 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: Stavros Macrakis - 2014-03-31 13:50:22 Attachments: Message as HTML ```Can you assume that Vmax>0? If so, ratsimp(imagpart(erg[1])) simplifies to 0. On Sat, Mar 29, 2014 at 10:54 AM, velten wrote: > Thanks, I'll try that. You are probably right that real_p(e) won't work > on complex expressions, and I will probably have to keep my current > workaround for complex expression, which is plotting imagpart e.g. using > plot3d over the subset of the parameter space where I expect imagpart=0. > > Kai > > > > > > > -----Original Message----- > From: Barton Willis > To: velten , andre maute > Subject: RE: [Maxima-discuss] Can Maxima prove Im(x)=0? > Date: Sat, 29 Mar 2014 12:04:59 +0000 > > > 1. Can I somehow solve equations with assumptions similar to: > > assume(12*Vmax-%pi*Lv^3<0); > > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > Solve does not exclude solutions that do not satisfy the assumptions in > the fact database. > You could try using sublist on the solutions to find the solution that > satisfies certain inequalities. > > >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on > >parameters a,b,c..., and the parameter space is restricted similar to > >the cubic example below. > > I'd say Maxima isn't capable of proving anything. You can certainly define > predicates such as > > real_p(e) := is(equal(imagpart(e),0)) > > For simple expressions, this function might work, but in general, I'd > guess that real_p will not > work as well as you would like it to work. > > > > --Barton > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > ```

 [Maxima-discuss] Can Maxima prove Im(x)=0? From: velten - 2014-03-29 08:31:32 ```erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); produces three solutions, erg[1] is relevant for me: bv = (-sqrt(3)*%i/2-1/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*% pi)+(%pi*Lv^3-24*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% i/2-1/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*%pi)+(% pi*Lv^3-24*Vmax)/(8*%pi))^(1/3))+Lv/2 This is a complex solution in general, but I can assume 12*Vmax-% pi*Lv^3<0, and then bv can be written as a real number based on a (tedious) hand calculation. Question: Can Maxima help to avoid this hand calculation? Ideally, I would like to do something like assume(12*Vmax-%pi*Lv^3<0); erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); and, ideally, this would give erg[1] as a real number, but this seems to be a wrong approach. If this doesn't work, it would be helpful if Maxima could somehow prove that imagpart(erg[1])=0 if 12*Vmax-%pi*Lv^3<0. Thank you for your help. Kai ```
 [Maxima-discuss] Can Maxima prove Im(x)=0? From: Aleksas Domarkas - 2014-03-29 20:55:59 Attachments: Message as HTML ```> > -----Original Message----- > From: Barton Willis > To: velten , andre maute > Subject: RE: [Maxima-discuss] Can Maxima prove Im(x)=0? > Date: Sat, 29 Mar 2014 12:04:59 +0000 > > > 1. Can I somehow solve equations with assumptions similar to: > > assume(12*Vmax-%pi*Lv^3<0); > > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > Solve does not exclude solutions that do not satisfy the assumptions in > the fact database. > You could try using sublist on the solutions to find the solution that > satisfies certain inequalities. > > >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on > >parameters a,b,c..., and the parameter space is restricted similar to > >the cubic example below. > > I'd say Maxima isn't capable of proving anything. You can certainly define > predicates such as > > real_p(e) := is(equal(imagpart(e),0)) > > For simple expressions, this function might work, but in general, I'd > guess that real_p will not > work as well as you would like it to work. > > > > --Barton > Example. Solve solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv) (%i1) assume(12*Vmax-%pi*Lv^3<0,Vmax>0,Lv>0)\$ (%i2) load(odes); (%o2) "C:/Users/Aleksas/maxima/odes.mac" (%i3) solvet((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv)\$ spr:expand(%)\$ (%i5) tr:expand(atan2((sqrt(3)*sqrt(%pi*Lv^3-12*Vmax)*sqrt(Vmax))/(2*%pi),-(24*Vmax-%pi*Lv^3)/(8*%pi)))\$ (%i6) ratsubst (omega, %, spr); (%o6) [bv=(2*Lv*cos(omega/3)+Lv)/2,bv=(2*Lv*cos((omega-2*%pi)/3)+Lv)/2,bv=(2*Lv*cos((omega+2*%pi)/3)+Lv)/2] Solution: (%i7) sol:expand(%); (%o7) [bv=Lv*cos(omega/3)+Lv/2,bv=Lv*cos(omega/3-(2*%pi)/3)+Lv/2,bv=Lv*cos(omega/3+(2*%pi)/3)+Lv/2] where (%i8) omega=tr; (%o8) omega=atan2((sqrt(3)*sqrt(%pi*Lv^3-12*Vmax)*sqrt(Vmax))/(2*%pi),Lv^3/8-(3*Vmax)/%pi) best Aleksas D ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: andre maute - 2014-03-29 09:48:48 ```On 03/29/2014 09:31 AM, velten wrote: > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > produces three solutions, erg[1] is relevant for me: > > bv = (-sqrt(3)*%i/2-1/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*% > pi)+(%pi*Lv^3-24*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% > i/2-1/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*%pi)+(% > pi*Lv^3-24*Vmax)/(8*%pi))^(1/3))+Lv/2 > > This is a complex solution in general, but I can assume 12*Vmax-% > pi*Lv^3<0, and then bv can be written as a real number based on > a (tedious) hand calculation. > > Question: Can Maxima help to avoid this hand calculation? > > Ideally, I would like to do something like > > assume(12*Vmax-%pi*Lv^3<0); > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > and, ideally, this would give erg[1] as a real number, but this seems to > be a wrong approach. > > If this doesn't work, it would be helpful if Maxima could somehow prove > that imagpart(erg[1])=0 if 12*Vmax-%pi*Lv^3<0. > > Thank you for your help. When I get a cubic polynomial, my first reflex is to think of the 'casus irreducibilis' see the wikipedia link http://en.wikipedia.org/wiki/Casus_irreducibilis hence we have -------------------------------------------- display2d : false; eq : (Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax; p : lhs(eq) - rhs(eq); a : factor(ratcoef(p,bv,3)); b : factor(ratcoef(p,bv,2)); c : factor(ratcoef(p,bv,1)); d : factor(ratcoef(p,bv,0)); discr : 18*a*b*c*d - 4*b^3*d + b^2*c^2 - 4*a*c^3 - 27*a^2*d^2; discr : factor(discr); -------------------------------------------- maxima gives for the last line -------------------------------------------- (%o10) -%pi^2*Vmax*(12*Vmax-%pi*Lv^3)/16 -------------------------------------------- so all depends on Vmax Andre ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: velten - 2014-03-29 14:54:35 ```Thanks, I'll try that. You are probably right that real_p(e) won't work on complex expressions, and I will probably have to keep my current workaround for complex expression, which is plotting imagpart e.g. using plot3d over the subset of the parameter space where I expect imagpart=0. Kai -----Original Message----- From: Barton Willis To: velten , andre maute Subject: RE: [Maxima-discuss] Can Maxima prove Im(x)=0? Date: Sat, 29 Mar 2014 12:04:59 +0000 > 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax-%pi*Lv^3<0); > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); Solve does not exclude solutions that do not satisfy the assumptions in the fact database. You could try using sublist on the solutions to find the solution that satisfies certain inequalities. >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on >parameters a,b,c..., and the parameter space is restricted similar to >the cubic example below. I'd say Maxima isn't capable of proving anything. You can certainly define predicates such as real_p(e) := is(equal(imagpart(e),0)) For simple expressions, this function might work, but in general, I'd guess that real_p will not work as well as you would like it to work. --Barton ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: velten - 2014-03-29 10:27:01 ```You are right, this works in the cubic case. I am looking for a procedure that would also apply to the general case. The question is: 1. Can I somehow solve equations with assumptions similar to: assume(12*Vmax-%pi*Lv^3<0); erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); 2. Can Maxima prove imagpart(x)=0, if x is complex, depends on parameters a,b,c..., and the parameter space is restricted similar to the cubic example below. Kai To: maxima-discuss@... Subject: Re: [Maxima-discuss] Can Maxima prove Im(x)=0? Date: Sat, 29 Mar 2014 10:48:39 +0100 On 03/29/2014 09:31 AM, velten wrote: > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > produces three solutions, erg[1] is relevant for me: > > bv = (-sqrt(3)*%i/2-1/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*% > pi)+(%pi*Lv^3-24*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% > i/2-1/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax-%pi*Lv^3))/(2*%pi)+(% > pi*Lv^3-24*Vmax)/(8*%pi))^(1/3))+Lv/2 > > This is a complex solution in general, but I can assume 12*Vmax-% > pi*Lv^3<0, and then bv can be written as a real number based on > a (tedious) hand calculation. > > Question: Can Maxima help to avoid this hand calculation? > > Ideally, I would like to do something like > > assume(12*Vmax-%pi*Lv^3<0); > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > and, ideally, this would give erg[1] as a real number, but this seems to > be a wrong approach. > > If this doesn't work, it would be helpful if Maxima could somehow prove > that imagpart(erg[1])=0 if 12*Vmax-%pi*Lv^3<0. > > Thank you for your help. When I get a cubic polynomial, my first reflex is to think of the 'casus irreducibilis' see the wikipedia link http://en.wikipedia.org/wiki/Casus_irreducibilis hence we have -------------------------------------------- display2d : false; eq : (Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax; p : lhs(eq) - rhs(eq); a : factor(ratcoef(p,bv,3)); b : factor(ratcoef(p,bv,2)); c : factor(ratcoef(p,bv,1)); d : factor(ratcoef(p,bv,0)); discr : 18*a*b*c*d - 4*b^3*d + b^2*c^2 - 4*a*c^3 - 27*a^2*d^2; discr : factor(discr); -------------------------------------------- maxima gives for the last line -------------------------------------------- (%o10) -%pi^2*Vmax*(12*Vmax-%pi*Lv^3)/16 -------------------------------------------- so all depends on Vmax Andre ------------------------------------------------------------------------------ _______________________________________________ Maxima-discuss mailing list Maxima-discuss@... https://lists.sourceforge.net/lists/listinfo/maxima-discuss ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: Barton Willis - 2014-03-29 12:05:10 ```> 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax-%pi*Lv^3<0); > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); Solve does not exclude solutions that do not satisfy the assumptions in the fact database. You could try using sublist on the solutions to find the solution that satisfies certain inequalities. >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on >parameters a,b,c..., and the parameter space is restricted similar to >the cubic example below. I'd say Maxima isn't capable of proving anything. You can certainly define predicates such as real_p(e) := is(equal(imagpart(e),0)) For simple expressions, this function might work, but in general, I'd guess that real_p will not work as well as you would like it to work. --Barton ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: Stavros Macrakis - 2014-03-31 13:50:22 Attachments: Message as HTML ```Can you assume that Vmax>0? If so, ratsimp(imagpart(erg[1])) simplifies to 0. On Sat, Mar 29, 2014 at 10:54 AM, velten wrote: > Thanks, I'll try that. You are probably right that real_p(e) won't work > on complex expressions, and I will probably have to keep my current > workaround for complex expression, which is plotting imagpart e.g. using > plot3d over the subset of the parameter space where I expect imagpart=0. > > Kai > > > > > > > -----Original Message----- > From: Barton Willis > To: velten , andre maute > Subject: RE: [Maxima-discuss] Can Maxima prove Im(x)=0? > Date: Sat, 29 Mar 2014 12:04:59 +0000 > > > 1. Can I somehow solve equations with assumptions similar to: > > assume(12*Vmax-%pi*Lv^3<0); > > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > Solve does not exclude solutions that do not satisfy the assumptions in > the fact database. > You could try using sublist on the solutions to find the solution that > satisfies certain inequalities. > > >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on > >parameters a,b,c..., and the parameter space is restricted similar to > >the cubic example below. > > I'd say Maxima isn't capable of proving anything. You can certainly define > predicates such as > > real_p(e) := is(equal(imagpart(e),0)) > > For simple expressions, this function might work, but in general, I'd > guess that real_p will not > work as well as you would like it to work. > > > > --Barton > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Maxima-discuss mailing list > Maxima-discuss@... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > ```
 Re: [Maxima-discuss] Can Maxima prove Im(x)=0? From: velten - 2014-04-02 06:00:54 ```You are right, I didn't see this. -----Original Message----- From: Stavros Macrakis To: velten Subject: Re: [Maxima-discuss] Can Maxima prove Im(x)=0? Date: Mon, 31 Mar 2014 09:50:13 -0400 Can you assume that Vmax>0? If so, ratsimp(imagpart(erg[1])) simplifies to 0. On Sat, Mar 29, 2014 at 10:54 AM, velten wrote: Thanks, I'll try that. You are probably right that real_p(e) won't work on complex expressions, and I will probably have to keep my current workaround for complex expression, which is plotting imagpart e.g. using plot3d over the subset of the parameter space where I expect imagpart=0. Kai -----Original Message----- From: Barton Willis To: velten , andre maute Subject: RE: [Maxima-discuss] Can Maxima prove Im(x)=0? Date: Sat, 29 Mar 2014 12:04:59 +0000 > 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax-%pi*Lv^3<0); > erg:solve((Lv-bv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); Solve does not exclude solutions that do not satisfy the assumptions in the fact database. You could try using sublist on the solutions to find the solution that satisfies certain inequalities. >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on >parameters a,b,c..., and the parameter space is restricted similar to >the cubic example below. I'd say Maxima isn't capable of proving anything. You can certainly define predicates such as real_p(e) := is(equal(imagpart(e),0)) For simple expressions, this function might work, but in general, I'd guess that real_p will not work as well as you would like it to work. --Barton ------------------------------------------------------------------------------ _______________________________________________ Maxima-discuss mailing list Maxima-discuss@... https://lists.sourceforge.net/lists/listinfo/maxima-discuss ```