3
votes

Hi im and struggling to solve an integral with a variable as the limit using matlab, the 2 biggest problems I have is that matlab can't find the integral explicitly and a lot of the numerical methods wont except variables

I need to solve

0=H/2R  - integral (z(x) between b and 1)

z(x)= (((x/((a*x*x)+1-a))^2)-1)^-0.5
b= (sin(t)+sqrt(t^2 + 4a(a-1)))/2a

I know H,R and t and the idea is to solve the integral then solve the nonlinear equation for a, I know to suse fzero/fsolve for the nonlinear equation but I am stuggling to solve the integral

1

1 Answers

0
votes

enter image description here

You could try a shooting method - guess a value for a and numerically solve from there until you find an a value which solves the last equation. Heres something that should work (though I guessed randomly at the numeric values and didn't get it to converge)

function test

    a_guess = .1
    fzero(@(a) solveWithA(a), a_guess)


    function res = solveWithA(a)

    t = .9;

    H = 1.5;
    R = 1.1;


    z = @(x) (((x/((a*x*x)+1-a))^2)-1)^-0.5;
    b = (sin(t)+sqrt(t^2 + 4*a*(a-1)))/(2*a);

    lower_limit = b;

    integrand = z;


    [T, Y] = ode45(@(t, x) integrand(x),[lower_limit 1],0);

    res = norm((H/2/R - Y(end)))

    end

end

But an analytic expression for a... I think its pen and paper :) Try doing the indefinite integral by hand, then applying the limits? Though, removing a from the integrand still leaves a nasty result. There's probably a 'trick' for this better posed on math overflow.

enter image description here