Ask Your Question

Revision history [back]

Definite Integral Fails due to Runtime Error

from sage.symbolic.integration.integral import definite_integral from sage.calculus.integration import numerical_integral dSpringStretchedFully=10.625 dSpringUnstretchedLength=7.875 dArmatureInches=8 dSpringAnchor=4.75 thetaArmatureDefault=95 dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefaultpi/180)sin(pi/180(180-thetaArmatureDefault-(180/piarcsin(dSpringAnchorsin(thetaArmatureDefaultpi/180)/dSpringUnstretchedLength)))) fSpringPoundsPerInch=65.69 kNewtonsPerPound=4.44822 kMetersPerInch=0.0254 fSpringNewtonsPerInch=fSpringPoundsPerInchkNewtonsPerPound dArmatureMeters=dArmatureIncheskMetersPerInch dHalfRopeInches=dArmatureInchescos(pi/180(thetaArmatureDefault-90)) dHalfRopeMeters=dHalfRopeIncheskMetersPerInch fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch fSpringMinimumLoad=0 kSpringDirection=1 rRopeInches=0.5 rRopeMeters=rRopeIncheskMetersPerInch var('x') var('dHalfRope') var('thetaArmatureToRope') thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/piarctan((x-rRopeMeters)/dArmatureMeters)) dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2) dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2dPointFromFarAxis(x,dHalfRope)dArmatureMeterscos(pi/180thetaPointToAxis(x,thetaArmatureToRope)))^(1/2) IMultiplier(x)=2(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2)) ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)IMultiplier(x) ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2rRopeMeters) ISlice(3,4)

Here is the code that I have been writing; it's meant to predict the moment of inertia of a perfect cylinder tilted and offset from its axis of rotation, among other things. However, the definite_integral command fails with an error thrown by the gcd function. I suspect the issue is due to Sage's inner workings; however, I do not have the time or know-how to fully debug this issue. Any help would be appreciated.

Definite Integral Fails due to Runtime Error

from sage.symbolic.integration.integral import definite_integral from sage.calculus.integration import numerical_integral dSpringStretchedFully=10.625 dSpringUnstretchedLength=7.875 dArmatureInches=8 dSpringAnchor=4.75 thetaArmatureDefault=95 dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefaultpi/180)sin(pi/180(180-thetaArmatureDefault-(180/piarcsin(dSpringAnchorsin(thetaArmatureDefaultpi/180)/dSpringUnstretchedLength)))) fSpringPoundsPerInch=65.69 kNewtonsPerPound=4.44822 kMetersPerInch=0.0254 fSpringNewtonsPerInch=fSpringPoundsPerInchkNewtonsPerPound dArmatureMeters=dArmatureIncheskMetersPerInch dHalfRopeInches=dArmatureInchescos(pi/180(thetaArmatureDefault-90)) dHalfRopeMeters=dHalfRopeIncheskMetersPerInch fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch fSpringMinimumLoad=0 kSpringDirection=1 rRopeInches=0.5 rRopeMeters=rRopeIncheskMetersPerInch var('x') var('dHalfRope') var('thetaArmatureToRope') thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/piarctan((x-rRopeMeters)/dArmatureMeters)) dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2) dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2dPointFromFarAxis(x,dHalfRope)dArmatureMeterscos(pi/180thetaPointToAxis(x,thetaArmatureToRope)))^(1/2) IMultiplier(x)=2(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2)) ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)IMultiplier(x) ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2rRopeMeters) ISlice(3,4)

Here is the code that I have been writing; it's meant to predict the moment of inertia of a perfect cylinder tilted and offset from its axis of rotation, among other things. However, the definite_integral command fails with an error thrown by the gcd function. I suspect the issue is due to Sage's inner workings; however, I do not have the time or know-how to fully debug this issue. Any help would be appreciated.

Definite Integral Fails due to Runtime Error

from sage.symbolic.integration.integral import definite_integral from sage.calculus.integration import numerical_integral dSpringStretchedFully=10.625 dSpringUnstretchedLength=7.875 dArmatureInches=8 dSpringAnchor=4.75 thetaArmatureDefault=95 dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefaultpi/180)sin(pi/180(180-thetaArmatureDefault-(180/piarcsin(dSpringAnchorsin(thetaArmatureDefaultpi/180)/dSpringUnstretchedLength)))) fSpringPoundsPerInch=65.69 kNewtonsPerPound=4.44822 kMetersPerInch=0.0254 fSpringNewtonsPerInch=fSpringPoundsPerInchkNewtonsPerPound dArmatureMeters=dArmatureIncheskMetersPerInch dHalfRopeInches=dArmatureInchescos(pi/180(thetaArmatureDefault-90)) dHalfRopeMeters=dHalfRopeIncheskMetersPerInch fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch fSpringMinimumLoad=0 kSpringDirection=1 rRopeInches=0.5 rRopeMeters=rRopeIncheskMetersPerInch var('x') var('dHalfRope') var('thetaArmatureToRope') thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/piarctan((x-rRopeMeters)/dArmatureMeters)) dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2) dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2dPointFromFarAxis(x,dHalfRope)dArmatureMeterscos(pi/180thetaPointToAxis(x,thetaArmatureToRope)))^(1/2) IMultiplier(x)=2(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2)) ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)IMultiplier(x) ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2rRopeMeters) ISlice(3,4)

Here is the code that I have been writing; it's meant to predict the moment of inertia of a perfect cylinder tilted and offset from its axis of rotation, among other things. However, the definite_integral command fails with an error thrown by the gcd function. I suspect the issue is due to Sage's inner workings; however, I do not have the time or know-how to fully debug this issue. Any help would be appreciated.

Definite Integral Fails due to Runtime Error

from sage.symbolic.integration.integral import definite_integral from sage.calculus.integration import numerical_integral dSpringStretchedFully=10.625 dSpringUnstretchedLength=7.875 dArmatureInches=8 dSpringAnchor=4.75 thetaArmatureDefault=95 dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefaultpi/180)sin(pi/180(180-thetaArmatureDefault-(180/piarcsin(dSpringAnchorsin(thetaArmatureDefaultpi/180)/dSpringUnstretchedLength)))) fSpringPoundsPerInch=65.69 kNewtonsPerPound=4.44822 kMetersPerInch=0.0254 fSpringNewtonsPerInch=fSpringPoundsPerInchkNewtonsPerPound dArmatureMeters=dArmatureIncheskMetersPerInch dHalfRopeInches=dArmatureInchescos(pi/180(thetaArmatureDefault-90)) dHalfRopeMeters=dHalfRopeIncheskMetersPerInch fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch fSpringMinimumLoad=0 kSpringDirection=1 rRopeInches=0.5 rRopeMeters=rRopeIncheskMetersPerInch var('x') var('dHalfRope') var('thetaArmatureToRope') thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/piarctan((x-rRopeMeters)/dArmatureMeters)) dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2) dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2dPointFromFarAxis(x,dHalfRope)dArmatureMeterscos(pi/180thetaPointToAxis(x,thetaArmatureToRope)))^(1/2) IMultiplier(x)=2(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2)) ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)IMultiplier(x) ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2rRopeMeters) ISlice(3,4)

Here is the code that I have been writing; it's meant to predict the moment of inertia of a perfect cylinder tilted and offset from its axis of rotation, among other things. However, the definite_integral command fails with an error thrown by the gcd function. I suspect the issue is due to Sage's inner workings; however, I do not have the time or know-how to fully debug this issue. Any help would be appreciated.

from sage.symbolic.integration.integral import definite_integral
            from sage.calculus.integration import numerical_integral
            dSpringStretchedFully=10.625
            dSpringUnstretchedLength=7.875
            dArmatureInches=8
            dSpringAnchor=4.75
            thetaArmatureDefault=95
            dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefault*pi/180)*sin(pi/180*(180-thetaArmatureDefault-(180/pi*arcsin(dSpringAnchor*sin(thetaArmatureDefault*pi/180)/dSpringUnstretchedLength))))
            fSpringPoundsPerInch=65.69
            kNewtonsPerPound=4.44822
            kMetersPerInch=0.0254
            fSpringNewtonsPerInch=fSpringPoundsPerInch*kNewtonsPerPound
            dArmatureMeters=dArmatureInches*kMetersPerInch
            dHalfRopeInches=dArmatureInches*cos(pi/180*(thetaArmatureDefault-90))
            dHalfRopeMeters=dHalfRopeInches*kMetersPerInch
            fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch
            fSpringMinimumLoad=0
            kSpringDirection=1
            rRopeInches=0.5
            rRopeMeters=rRopeInches*kMetersPerInch
            var('x')
            var('dHalfRope')
            var('thetaArmatureToRope')
            thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/pi*arctan((x-rRopeMeters)/dArmatureMeters))
            dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2)
            dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2*dPointFromFarAxis(x,dHalfRope)*dArmatureMeters*cos(pi/180*thetaPointToAxis(x,thetaArmatureToRope)))^(1/2)
            IMultiplier(x)=2*(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2))
            ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)*IMultiplier(x)
            ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2*rRopeMeters)
            ISlice(3,4)

Definite Integral Fails due to Runtime Error

Here is the code that I have been writing; it's meant to predict the moment of inertia of a perfect cylinder tilted and offset from its axis of rotation, among other things. However, the definite_integral command fails with an error thrown by the gcd function. I suspect the issue is due to Sage's inner workings; however, I do not have the time or know-how to fully debug this issue. Any help would be appreciated.

from sage.symbolic.integration.integral import definite_integral
 from sage.calculus.integration import numerical_integral
 dSpringStretchedFully=10.625
 dSpringUnstretchedLength=7.875
 dArmatureInches=8
 dSpringAnchor=4.75
 thetaArmatureDefault=95
 dSpringPitch=dSpringUnstretchedLength/sin(thetaArmatureDefault*pi/180)*sin(pi/180*(180-thetaArmatureDefault-(180/pi*arcsin(dSpringAnchor*sin(thetaArmatureDefault*pi/180)/dSpringUnstretchedLength))))
 fSpringPoundsPerInch=65.69
 kNewtonsPerPound=4.44822
 kMetersPerInch=0.0254
 fSpringNewtonsPerInch=fSpringPoundsPerInch*kNewtonsPerPound
 dArmatureMeters=dArmatureInches*kMetersPerInch
 dHalfRopeInches=dArmatureInches*cos(pi/180*(thetaArmatureDefault-90))
 dHalfRopeMeters=dHalfRopeInches*kMetersPerInch
 fSpringNewtonsPerMeter=fSpringNewtonsPerInch/kMetersPerInch
 fSpringMinimumLoad=0
 kSpringDirection=1
 rRopeInches=0.5
 rRopeMeters=rRopeInches*kMetersPerInch
 var('x')
 var('dHalfRope')
 var('thetaArmatureToRope')
 thetaPointToAxis(x,thetaArmatureToRope)=thetaArmatureToRope-(180/pi*arctan((x-rRopeMeters)/dArmatureMeters))
 dPointFromFarAxis(x,dHalfRope)=((dHalfRope^2)+(x-rRopeMeters)^2)^(1/2)
 dPointFromNearAxis(x,dHalfRope,thetaArmatureToRope)=((dArmatureMeters^2)+((dPointFromFarAxis(x,dHalfRope))^2)-2*dPointFromFarAxis(x,dHalfRope)*dArmatureMeters*cos(pi/180*thetaPointToAxis(x,thetaArmatureToRope)))^(1/2)
 IMultiplier(x)=2*(((rRopeMeters^2)-(x-rRopeMeters)^2)^(1/2))
 ILine(x,dHalfRope,thetaArmatureToRope)=((dPointFromNearAxis(x,dHalfRope, thetaArmatureToRope))^2)*IMultiplier(x)
 ISlice(dHalfRope,thetaArmatureToRope)=definite_integral(ILine(x,dHalfRope,thetaArmatureToRope),x,0,2*rRopeMeters)
 ISlice(3,4)