Go to Post I'm down with banning the Chicken Dance (and take the Macerena with you when you go)! - Koko Ed [more]
Home
Go Back   Chief Delphi > Other > Math and Science
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-05-2013, 07:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
numerical computation challenge


Find the area between these two curves, accurate to 6 decimal places:


y=10*ln(x+1)/exp(x+1)

x=10*ln(y+1)/exp(y+1)


Use whatever computer tools you want. Show your work.


Reply With Quote
  #2   Spotlight this post!  
Unread 15-05-2013, 12:56
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,573
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: numerical computation challenge

I think I solved it....

I got 0.536594(7|8)
My strategy was to use the fact that it was symmetric about x=y.

I took the initial y=... function and rotated it by pi/4 (45 degrees) using the transformation matrix:
Code:
[y']   [cos(pi/4)  sin(pi/4)] [y]
[  ] = [                    ] [ ]
[x']   [cos(pi/4) -sin(pi/4)] [x]
That allows me to essentially take the integral above the new y' and simply multiply it by 2. I used MATLAB to get it.

Code:
clear

xmin = eval(evalin(symengine, 'numeric::solve(0==y-10*log(y+1)/exp(y+1), y=-0.5..0.5)'));
xmax = eval(evalin(symengine, 'numeric::solve(0==y-10*log(y+1)/exp(y+1), y=0.5..2)'));

error = 1;
stepsize = 3000000;
prevsum = 0;
while (abs(error > 0.000000001))
    stepsize = stepsize + 10000;
    th = pi/4
    x0min = xmin;
    x0max = xmax;
    y0min = xmin;
    y0max = xmax;

    x0 = linspace(x0min,x0max,stepsize);
    y0 = linspace(y0min,y0max,stepsize);
    y = 10*log(x0+1)./exp(x0+1);
    x = 10*log(y0+1)./exp(y0+1);
    xp = x*cos(th) + y0*sin(th);
    yp = y*cos(th) - x0*sin(th);
    xp0 = x/cos(th);
    plot(x0,y,x,y0,xp,yp);
    axis equal
    axis square
    grid on
    sum = 0;
    for i=1:stepsize-1
        sum = sum + (xp0(i+1)-xp0(i))*yp(i);
    end
    sum = sum*2;
    error = sum - prevsum;
    disp('step size');
    disp(stepsize);
    disp('sum');
    disp(sum);
    disp('error');
    disp(error);
end

Last edited by Michael Hill : 15-05-2013 at 12:59.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-05-2013, 13:05
MechEng83's Avatar
MechEng83 MechEng83 is offline
Lead Mentor/Engineer
AKA: Mr. Cool
FRC #1741 (Red Alert)
Team Role: Coach
 
Join Date: May 2011
Rookie Year: 2011
Location: Indiana
Posts: 616
MechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond reputeMechEng83 has a reputation beyond repute
Re: numerical computation challenge

Quote:
Originally Posted by Michael Hill View Post
I took the initial y=... function and rotated it by pi/4 (45 degrees) using the transformation matrix:
Code:
y'     [cos(pi/2) sin(pi/2)] [y]
   =
x'     [cos(pi/2) -sin(pi/2)] [x]
That allows me to essentially take the integral above the new y' and simply multiply it by 2.
Rather than going through the trouble of transforming it, I just subtracted the integral of y=x, as that's the symmetry line.

I got 0.536595 for the area -- found the second intercept at .95012, then just took the integral from 0 to .95012 of [10*ln(x)/exp(x)-x] and multiplied by 2.
__________________

2016 INWLA GP| INWCH Entrepreneurship | INPMH DCA | INCMP Team Spirit | CAGE Match Winner (w/ 1747 &868), Finalist (1471 w/ 1529 & 1018), Best Fans
2015 ININD Judges Award, Proud "Phyxed Red Card" alliance partners of 1529 & 1720 | INWLA EI | INCMP GP
2014 Boilermaker Creativity | Chesapeake Finalist, Safety, GP, Entrepreneurship | IN State Championship Winner (w/ 868 & 1018) | CAGE Match Winner (w/ 1024, 5402 & 1646)
2013 Boilermaker RCA, Innovation in Controls, Finalist | Crossroads Entrepreneurship | Newton Semi-finalist
2012 Boilermaker Entrepreneurship | Queen City EI | Curie Semi-finalist
2011 Boilermaker RCA, Entrepreneurship
Red Alert Robotics
Reply With Quote
  #4   Spotlight this post!  
Unread 15-05-2013, 13:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: numerical computation challenge


Nice job guys. The key was using the y=x symmetry line.

In the attached graph, the red and green lines are the two curves. The cyan line y=x is the axis of symmetry. If you subtract the cyan line from the red curve, you get the black curve.

I used Maxima to find the X-axis intercept of the black curve, and then numerically integrate the black curve from zero to that value and double it.
Attached Thumbnails
Click image for larger version

Name:	area_solve.png
Views:	26
Size:	15.0 KB
ID:	14825  Click image for larger version

Name:	area_graph.png
Views:	43
Size:	10.4 KB
ID:	14826  
Reply With Quote
  #5   Spotlight this post!  
Unread 15-05-2013, 22:14
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,573
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Post Re: numerical computation challenge

Of course I go the complicated route. This transcends to my ideas for robots as well. I need to learn to be more elegant. :-P
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi