Reputation: 21
I have tried to run this matlab code :
t = 0:1e-10:1e-3;
F=2.335807205111373e+16;
Y=cosh(t*F);
plot(t,Y), grid on
I didn't have plot ?? also result for Y is infinity ?
Where is the problem on my code ??
Upvotes: 0
Views: 96
Reputation: 3384
May be you can implement this equation and it will work for you:
I tried to use above formula and got these results:
>> (1 + exp(-2*900))/(2*exp(-900))
ans =
Inf
>> (1 + exp(-2*700))/(2*exp(-700))
ans =
5.0712e+303
Upvotes: 0
Reputation: 41
The maximum value for a double is 1.7e308. This value is reached when you do the following in Matlab
K>> cosh(710)
ans =
1.1170e+308
K>> cosh(711)
ans =
Inf
So, the maximum value you can feed to cosh appears to be 710. The numbers you are using appear to be too high, except for the first one which is 0.
Upvotes: 3