How to resolve the error-Input arguments of type 'double'?.

12 visualizaciones (últimos 30 días)
Subhashree rajagopal
Subhashree rajagopal el 26 de Sept. de 2012
I tried to perform double integration using syms function in my program. Its generating the error- Input arguments of type 'double. What could be the possible mistake?
The expression is :
delF=((-h^2)/rad)*sigma*(rad^2)*(2*pi)*omega*square(abs((R2*exp((alpha/rad)*z))+(S2*exp((-alpha/rad)*z))))**
Here h is the harmonic order which assumes its value for every iteration (from an outer for loop).
omega and sigma are constants.
R2,S2 and alpha are parameters which are calculated during the iteration process
Its a 2D cylindrical coordinate system analysis with the given expression integrated over radius (rad) and z
The limits of integration for rad-inner radius (Rin) and outer radius (Rout)(Rin and Rout are taken as inputs) z-g to (g+e) (g and e are also taken as inputs)
my code is:
syms rad z
firstans=int(((-sigma*(h^2)/rad)*(2*pi)*omega*(rad^2))*(square(abs((((R2*exp((alpha*z/rad))+(((S2*exp((-alpha*z/rad))))))))))),rad,Rin,Rout);
answer=int(firstans,z,g,g+e);
[Merged information from duplicate question]
When I tried to perform double integration it is generating an error "input arguments should be of type double". I used syms command. How do I check if the parameters of my function are of type 'double'
  12 comentarios
Subhashree rajagopal
Subhashree rajagopal el 4 de Oct. de 2012
And Iam sorry for using "need faster reply" before.Sorry for the inconvinience.The answers and comments you post are very useful to beginners like me.Thanks a lot!!
Walter Roberson
Walter Roberson el 4 de Oct. de 2012
oooo... I missed seeing the square() call. Good hunting there.

Iniciar sesión para comentar.

Respuestas (1)

Muruganandham Subramanian
Muruganandham Subramanian el 28 de Sept. de 2012
Editada: Walter Roberson el 28 de Sept. de 2012
Hi,
Before doing that integration using 'syms' command. better you convert all the variables by using double('var') or other commands like single(' '); , etc...Then try it.
  1 comentario
Walter Roberson
Walter Roberson el 28 de Sept. de 2012
Probably not. int() is symbolic integration, and if all the variables are floating point, there will not be anything useful to integrate.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by