For Programmers: Free Programming Magazines  


Home > Archive > Matlab > December 2005 > Need help with a integral calculation with more va









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need help with a integral calculation with more va
Wouter den Boer

2005-12-10, 7:21 pm

I Have been trying too create a code to calculate the following
equation for to variables.
-------------------------------------------------------
f1=(-8*s2*B/L2^2*((B-A+xi)^2+eta^2)^(-0.3e1/0.2e1));

f2=int(f1,B,-L2/2,L2/2);

f3=(-8*s1*A/L1^2)*f2;

f4=int(f3,A,-L1/2,L1/2);

f5=((rho*U^2*eta/pi)*f4)/((rho*U^2*L1^2*(s1/L1^2)*(s2/L2^2)));
-----------------------------------------------------------

I have to solve this for 10 < eta < 100 with stepsize 2

and in every step for eta

xi should calculated from -500 to 500 stepsize 5

the results should be written to a matrix or table with

eta ->
xi ___________
|| |Values for f5
|| |
\/ |

I have written an m-file for the integration, but it is not correct
for creating the table.
can anyone help me.

At the at I wil post my m-file so far.

Thanks a Lot

Greetz Wouter

% Definition of constants

rho =1025;
U= 5;

L1=100;
B1=L1/5;
T1=B1/3;
s1=B1*T1*.98;

L2=200;
B2=L2/5;
T2=B2/3;
s2=B2*T2*.98;

eta0=10
xi0=-10
fy0=[1;0]

for eta=eta0:4:50

for xi=xi0:2:10

syms B;
syms A;

f1 = (-8 * s2 * B / L2 ^ 2 * ((B - A + xi) ^ 2 + eta ^ 2) ^ (-0.3e1 /
0.2e1));

f2=int(f1,B,-L2/2,L2/2);

f3= (-8 * s1 * A / L1 ^ 2)*f2;

f4=int(f3,A,-L1/2,L1/2);

f5=(( rho * U ^ 2 * eta /
pi)*f4)/((rho*U^2*L1^2*(s1/L1^2)*(s2/L2^2)));
format compact
format short e
Fy=f5

end;
end;
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com