help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot use ldegree() on symbolic expressions with non-integer expon


From: Jason Lewis
Subject: Re: Cannot use ldegree() on symbolic expressions with non-integer exponents
Date: Sat, 27 Mar 2010 12:23:23 -0400

Thanks for the reply.

It appears that ^ doesn't like 'int32' as an argument, and so it
produces an error.

I've run into this problem while trying to have octave solve a system
of symbolic equations to model the output of an electronic circuit
(something I used to do with Matlab). I'm a bit disappointed, but I'm
willing to concede that I may be the problem.

 - J

On 3/27/10, Martin Helm <address@hidden> wrote:
> 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
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]