Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: complex results using ODE45
Replies: 3   Last Post: Oct 22, 2013 2:25 PM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: complex results using ODE45
Posted: Oct 15, 2013 2:14 PM
 Plain Text Reply

On 10/15/2013 12:53 PM, Jeffrey wrote:
> I have the two m files given below. "a" and "T" are returned as complex with
>
> Why are values becoming complex?
>
> Please help.
>
> Jeff
> _______________________________
> %this is in file alpha.m
> function dadT = alpha(T,a)
> b = 20
> l= 50.1
> k=exp(l)
> ner = -36108.73
> n=1.269
> dadT = (k/b)*(exp(ner/T)) *((1-a)^n
> ________________________________________
>

You have missing ")" above btw. Last line.

But besides this, which I assume a cut/paste issue only,
look at the expression itself.

What happens for (1-a)^n, and "a" happens to be
larger than one?

EDU>> (1-1.5)^(1.269)

ans =

-0.2754 - 0.3104i

Date Subject Author
10/15/13 Jeffrey
10/15/13 Nasser Abbasi
10/20/13 Jeffrey
10/22/13 Jeffrey

© The Math Forum at NCTM 1994-2018. All Rights Reserved.