Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Variable substitution?

Name: Anonymous 2008-11-11 10:40

I need to integrate x/(1+a(c-x)+b*x) from 0 to c.
a=4150
b=0.3
c=100/8.314 (~12.0279...)

The problem being that the damn thing goes fubar around x=12, and possibly has other issues as well (Matlab doesn't like things one bit, even with the integrations limits set to, say, 10 to 11).

Any idea how to un-bork it? I suspect some suitable variable substitution is expected, but I can't for the life of me figure out what that swap should be. Cutting off the upper end of the integration doesn't seem very likely at least, as what I'm aiming for in the end is to examine how sensitive the whole thing is to small disturbances in c.

Name: 4tran 2008-11-11 17:29

Singularity at x = (1+ac)/(a-b) ~ 12.029015 in your case.
No reason it should fail in the interval [10,11].
Fix your matlab code.

Name: Anonymous 2008-11-11 19:33

Yeah, after a few hours of bashing my head against the wall, I finally sat down and actually calculated where the singularity should pop up. Simply rewriting the Matlab code from the ground up a few times then (...) finally solved it.

Matlab, keeping me humble for the last half a decade.

Thanks for the help though.

Don't change these.
Name: Email:
Entire Thread Thread List