Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Finding best guess

Subject: Finding best guess

From: Andre

Date: 5 Aug, 2013 19:54:10

Message: 1 of 2

Hi gurus,

I'm trying to solve a small system with a best guess of an integral interval, but having some problems.
I define a funcion called "outer" (I parametrized all coefficientes in the main program):
function y=outer(x)
global alfa e2 delta x1 x4 v4 c1 c2
h=c1*sinh(x/sqrt(e2))+c2*cosh(x/sqrt(e2))+1;
v=c1*sqrt(e2)*cosh(x/sqrt(e2))+c2*sqrt(e2)*sinh(x/sqrt(e2));
y=v.*h;

then I have to integrate "outer" in the limit x3 < x < x4 where I know x4 but no idea about x3. however, I know that the integral x3->x4 = Qw (which I also parametrize in the initial).

It means that quad(@outer,x3,x4) - Qw = 0 (or less then a tolerance value).

I was thinking to use fzero to find the solution, but of course it will not work. I made a loop to find the best guess of x3, but also it was too slow.
is there any better approach to find this ?
Thanks in advance

Subject: Finding best guess

From: Roger Stafford

Date: 5 Aug, 2013 20:52:11

Message: 2 of 2

"Andre " <andre.gentoo@gmail.com> wrote in message <ktovt1$8sg$1@newscl01ah.mathworks.com>...
> function y=outer(x)
> global alfa e2 delta x1 x4 v4 c1 c2
> h=c1*sinh(x/sqrt(e2))+c2*cosh(x/sqrt(e2))+1;
> v=c1*sqrt(e2)*cosh(x/sqrt(e2))+c2*sqrt(e2)*sinh(x/sqrt(e2));
> y=v.*h;
>
> then I have to integrate "outer" in the limit x3 < x < x4 where I know x4 but no idea about x3. however, I know that the integral x3->x4 = Qw (which I also parametrize in the initial).
- - - - - - - - -
  You can obtain an explicit formula for the integral of y with respect to x over the interval from x3 to x4 with x3 still unknown using the symbolic toolbox function 'int'. Then you can use 'fzero' to solve for x3 with this formula to gain equality to Qw.

  (Note that the integral of sinh^2, cosh^2, and sinh*cosh is to be found in any good table of integrals, so 'int' should have no trouble finding the formula here.)

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us