Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
Close
From: velten <kai.velten@hs...>  20140329 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 <willisb@...> To: velten <kai.velten@...>, andre maute <andre.maute@...> Subject: RE: [Maximadiscuss] 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((Lvbv)*%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 
From: velten <kai.velten@hs...>  20140329 08:31:32

erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); produces three solutions, erg[1] is relevant for me: bv = (sqrt(3)*%i/21/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*% pi)+(%pi*Lv^324*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% i/21/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*%pi)+(% pi*Lv^324*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((Lvbv)*%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 
From: Aleksas Domarkas <aleksasd873@gm...>  20140329 20:55:59
Attachments:
Message as HTML

> > Original Message > From: Barton Willis <willisb@...> > To: velten <kai.velten@...>, andre maute <andre.maute@...> > Subject: RE: [Maximadiscuss] 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((Lvbv)*%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((Lvbv)*%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((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv)$ spr:expand(%)$ (%i5) tr:expand(atan2((sqrt(3)*sqrt(%pi*Lv^312*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((omega2*%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^312*Vmax)*sqrt(Vmax))/(2*%pi),Lv^3/8(3*Vmax)/%pi) best Aleksas D 
From: andre maute <andre.maute@gm...>  20140329 09:48:48

On 03/29/2014 09:31 AM, velten wrote: > erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > produces three solutions, erg[1] is relevant for me: > > bv = (sqrt(3)*%i/21/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*% > pi)+(%pi*Lv^324*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% > i/21/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*%pi)+(% > pi*Lv^324*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((Lvbv)*%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 : (Lvbv)*%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 
From: velten <kai.velten@hs...>  20140329 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 <willisb@...> To: velten <kai.velten@...>, andre maute <andre.maute@...> Subject: RE: [Maximadiscuss] 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((Lvbv)*%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 
From: velten <kai.velten@hs...>  20140329 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((Lvbv)*%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: maximadiscuss@... Subject: Re: [Maximadiscuss] 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((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > produces three solutions, erg[1] is relevant for me: > > bv = (sqrt(3)*%i/21/2)*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*% > pi)+(%pi*Lv^324*Vmax)/(8*%pi))^(1/3)+(sqrt(3)*% > i/21/2)*Lv^2/(4*(sqrt(3)*sqrt(Vmax*(12*Vmax%pi*Lv^3))/(2*%pi)+(% > pi*Lv^324*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((Lvbv)*%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 : (Lvbv)*%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  _______________________________________________ Maximadiscuss mailing list Maximadiscuss@... https://lists.sourceforge.net/lists/listinfo/maximadiscuss 
From: Barton Willis <willisb@un...>  20140329 12:05:10

> 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax%pi*Lv^3<0); > erg:solve((Lvbv)*%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 
From: Stavros Macrakis <macrakis@al...>  20140331 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 <kai.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 <willisb@...> > To: velten <kai.velten@...>, andre maute <andre.maute@...> > Subject: RE: [Maximadiscuss] 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((Lvbv)*%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 > > > >  > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > 
From: velten <kai.velten@hs...>  20140402 06:00:54

You are right, I didn't see this. Original Message From: Stavros Macrakis <macrakis@...> To: velten <kai.velten@...> Subject: Re: [Maximadiscuss] 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 <kai.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 <willisb@...> To: velten <kai.velten@...>, andre maute <andre.maute@...> Subject: RE: [Maximadiscuss] 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((Lvbv)*%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  _______________________________________________ Maximadiscuss mailing list Maximadiscuss@... https://lists.sourceforge.net/lists/listinfo/maximadiscuss 