From: Yehuda <yehuka@softhome.net> > To solve min-max problems we need usually calculus. But if we have Logo, we can > solve this sort of problems, with much younger students. I'm not sure if I used calculus: make "f [(30-2*:x)*(30-2*:x)*:x] show intervalsolve [deriv :f "x :x] "x 0 10 [0 10] [7.49999999833904 0] [5.99999999988195 7.49999999833904] [5.35714285244459 5.99999999988195] [5.12195121721646 5.35714285244459] [5.04098360180739 5.12195121721646] [5.01369863231258 5.04098360180739] [5.00457038462791 5.01369863231258] [5.00152392622646 5.00457038462791] [5.0005080260684 5.00152392622646] [5.00016934403484 5.0005080260684] [5.00005644794088 5.00016934403484] [5.00001881619279 5.00005644794088] [5.00000627272929 5.00001881619279] [5.00000209157829 5.00000627272929] [5.00000069449318 5.00000209157829] [5.00000022585075 5.00000069449318] [5.00000007174192 5.00000022585075] [5.00000002753037 5.00000007174192] [5.00000000605619 5.00000002753037] [5.00000000605619 5.00000000605619] [5.00000000352982 5.00000000605619] [5.00000000479301 5.00000000352982] [5.00000000384562 5.00000000479301] [5.00000000408246 5.00000000384562] [5.00000000392457 5.00000000408246] [5.00000000388509 5.00000000392457] [5.00000000390483 5.00000000388509] [5.00000000389167 5.00000000390483] [5.00000000388838 5.00000000389167] [5.00000000389003 5.00000000388838] [5.00000000389085 5.00000000389003] [5.0000000038903 5.00000000389085] [5.00000000389016 5.0000000038903] [5.00000000389007 5.00000000389016] [5.00000000389005 5.00000000389007] [5.00000000389003 5.00000000389005] [5.00000000389003 5.00000000389003] [5.00000000389003 5.00000000389003] [5.00000000389003 5.00000000389003] [5.00000000389003 5.00000000389003] 5.00000000389003 to deriv :func :dep :depv localmake "inf 0.0000005 op ((eval :func :dep :depv+:inf)-(eval :func :dep :depv-:inf))/(2*:inf) end to eval :func :dep :depv localmake :dep :depv op run :func end to intervalSolve :func :dep :ini :fin local [lower upper depLower depUpper currentAns lastAns depCurrent] make "lower :ini make "upper :fin make "currentAns :ini make "lastAns :fin make "depLower eval :func :dep :lower make "depUpper eval :func :dep :upper if (not (:depLower * :depUpper) < 0) [print [Interval useless]] while [not :currentAns = :lastAns] [ show list :currentAns :lastAns make "lastAns :currentAns make "currentAns :lower - :depLower * (:lower - :upper) / (:depLower - :depUpper) make "depCurrent eval :func :dep :currentAns ifelse (:depUpper * :depCurrent < 0) [ make "lower :currentAns make "depLower :depCurrent ] [ make "upper :currentAns make "depUpper :depCurrent ] ] op :currentAns end I guess intervalSolve, numInt (posted earlier), deriv, and eval put together could be a useful set of tools. --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home