| New Reply |
Solving Dependant Integrals in MATlab |
Share Thread | Thread Tools |
| Apr19-11, 06:58 AM | #1 |
|
|
Solving Dependant Integrals in MATlab
Hi i need to create a MATlab m file solving the following function for 0 to 90 degrees of \theta_0 and for any function F(\theta^').
![]() [edit] dx should be d\theta^', sorry about that. I managed to do it in MATlab using symbolic maths toolkit and the int() function, but the script breaks for more complex F(\theta^'). I thus need ways of going about it using trapz() or any other recommendable numerical solutions. But I'm really finding it hard to wrap my head around where to start. Any ideas? Oh just for interest the formula is used for calculating a reflector antenna's aperture efficiency. Where \theta_0 is the subtended angle or f/d ratio (Focus point), and F(\theta^') is the feed used normally in my case, (sin(x/2))^n, (sin(x))^n or 10^((nx^2)/10) |
| Apr19-11, 09:40 AM | #2 |
|
|
Okay I played around a bit and this is what I've ended up. But there is still problems with the amplitude. Any help will still be appreciated. The aperture efficiency for the given problem below should be between 0.8 and 0.83 but the results are out with a factor bigger than 3000. The shap is correct but the amplitude is just out by a factor.
Code:
clc
clear all
theta = 0:89; %Angle range
for n= 2:2:8 %Specify range of n
% calculate values for all angles of the integral function
for i=1:length(theta)
angle = theta(i)*pi/180;
g =(2*(n+1))*((cos(angle))^n); %The feed
int(i) = sqrt(g)*tan(angle/2); % The integral
end
%Set initial value of iterative integral sum
res(1)=int(1);
for j=2:length(theta)
res(j) = res(j-1)+int(j); %calculate and store integral sum for each case
end
res = abs(res); %apply absolute value
res = res.^2; %square integral
%calculate resulting values of complete function
for k=1:length(theta)
res(k) = res(k)*(cot(k*pi/360))^2;
end
plot(res)
hold on;
grid on;
end
|
| New Reply |
| Tags |
| integral, matlab, trapz |
| Thread Tools | |
Similar Threads for: Solving Dependant Integrals in MATlab
|
||||
| Thread | Forum | Replies | ||
| solving double integrals | Calculus & Beyond Homework | 3 | ||
| Solving for the dependant variable in sinusoidal functions . | General Math | 4 | ||
| Solving Integrals Using a Known Mac Series (Sin(x)) | Calculus & Beyond Homework | 2 | ||
| Method for solving integrals? | Calculus & Beyond Homework | 17 | ||
| [SOLVED] solving integrals | General Math | 11 | ||