8 views (last 30 days)
Muhammad Danish
Muhammad Danish on 18 Feb 2015
Edited: Mike Hosea on 18 Feb 2015
I want to integrate a pressure equation to get the hydrodynamic bearing forces. the way I am doing it is as follows: function [forceR,forceT]=forces(eps,epsd,dalfa,ombar)
c=0.0001; Rb=0.024; Rj=Rb-c; Lb=0.02; u=0.01;
del0=(atan(epsd/(eps*(ombar-dalfa)))); del1=del0+pi;
z0=0; z1=z0-(Lb/2); z2=z0+(Lb/2);
fun1 = @(del,z)((((6.*u.*c)./((c.*(1+eps.*cos(del))).^3)).*((epsd.*cos(del))+(eps.*(dalfa-ombar).*sin(del))).*((z.^2)-(0.25*(Lb^2)))).*cos(del)); fun2 = @(del,z)((((6.*u.*c)./((c.*(1+eps.*cos(del))).^3)).*((epsd.*cos(del))+(eps.*(dalfa-ombar).*sin(del))).*((z.^2)-(0.25*(Lb^2)))).*sin(del));
forceR=-integral2(fun1,del0,del1,z1,z2)*Rb; forceT=-integral2(fun2,del0,del1,z1,z2)*Rb;
fun1 and fun 2 are dependent on del and z and the upper and lower limits are from del0 to del1 and z1-z2.
this is an embedded function in a simulink model. (coder.extrinsic).
The program starts running then give me an error when the simulation reaches 2-3 percent.
I shall be really grateful if anyone of you could help me in this.
Regards Danish

Answers (1)

Mike Hosea
Mike Hosea on 18 Feb 2015
Edited: Mike Hosea on 18 Feb 2015
I don't seem to be having any difficulty integrating this problem with the parameter values that I make up. What are the values of eps, epsd, dalfa, and ombar when the simulation fails? I do note that you will need abs(eps) < 1 or else there will be a singularity where 1 + eps*cos(del) == 0. Something very close to one may also be numerically challenging.



Community Treasure Hunt

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

Start Hunting!