[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cannot use ldegree() on symbolic expressions with non-integer expone
From: |
Martin Helm |
Subject: |
Re: Cannot use ldegree() on symbolic expressions with non-integer exponents |
Date: |
Sat, 27 Mar 2010 15:43:44 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.31.12-0.2-desktop; KDE/4.3.5; x86_64; ; ) |
Am Samstag, 27. März 2010 13:37:21 schrieb Jason Lewis:
> I'm still confused about this one. I've searched the web and read the
> documentation. Do I have a fundamental misunderstanding, or is this a
> bug?
>
> Thanks.
>
> ---------- Forwarded message ----------
> From: Jason Lewis <address@hidden>
> Date: Wed, 24 Mar 2010 11:52:32 -0400
> Subject: Cannot use ldegree() on symbolic expressions with non-integer
> exponents To: address@hidden
>
> I'm a bit confused. The following code won't work:
> > symbols
>
> octave-3.2.3.exe:42:C:\Octave\3.2.3_gcc-4.4.0\bin
>
> > x=sym("x")
>
> x =
>
> x
> octave-3.2.3.exe:43:C:\Octave\3.2.3_gcc-4.4.0\bin
>
> > y=x^2+9
>
> y =
>
> 9.0+x^(2.0)
> octave-3.2.3.exe:44:C:\Octave\3.2.3_gcc-4.4.0\bin
>
> > ldegree(y,x)
>
> error: power::ldegree(): undefined degree because of non-integer exponent
> octave-3.2.3.exe:44:C:\Octave\3.2.3_gcc-4.4.0\bin
>
> ...but if I change the input as follows, it works fine:
> > y=x*x+9
>
> y =
>
> 9.0+x^2
> octave-3.2.3.exe:45:C:\Octave\3.2.3_gcc-4.4.0\bin
>
> > ldegree(y,x)
>
> ans =
>
> 0.0
>
>
> Why does x^2 become x^2.0 and x*x become x^2? How do I fix this problem?
>
> Thanks,
> Jason
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
I have to say that I don't use the symbolic package so maybe my idea is
completely worthless.
Did you also try to explicitelyy tell that 2 is an integer, for example
x=sym("x")
y=x^int32(2)+9
ldegree(y,x)
What happens (I can not test it, I do not have the package installed)?
- mh