2015-07-06 01:34:02 +0200 | received badge | ● Famous Question (source) |

2015-01-14 16:22:25 +0200 | received badge | ● Taxonomist |

2014-03-31 05:01:29 +0200 | received badge | ● Famous Question (source) |

2013-12-15 07:20:00 +0200 | received badge | ● Notable Question (source) |

2013-06-03 15:37:34 +0200 | received badge | ● Notable Question (source) |

2013-05-13 17:58:36 +0200 | received badge | ● Popular Question (source) |

2012-12-16 21:31:25 +0200 | received badge | ● Popular Question (source) |

2012-04-18 15:52:57 +0200 | received badge | ● Student (source) |

2012-04-16 17:53:40 +0200 | commented answer | how to find a local maximum? More concretely, I was asking about the keyword lambda, because 'lambda?' yields no results. |

2012-04-16 16:21:31 +0200 | commented answer | obtaining all numerical roots of a function in an interval yes. it is: f(x) = 8 x^3 sin(x^2)-12 x cos(x^2) , or simply (cos(x^2))'''. But I believe the problem happens with any function with inifinite roots. |

2012-04-15 18:16:53 +0200 | commented answer | how to find a local maximum? Can you explain why, or how, does your solution work? Thanks you |

2012-04-15 16:57:04 +0200 | commented answer | how to find a local maximum? However, this bit piece of code gives me a runtime error: f(x) = -4*x^6/(x^4 + 1)^(3/2) + 6*x^2/sqrt(x^4 + 1) find_maximum_on_interval(f,0,2) This is the error: RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined. Thanks you |

2012-04-15 16:40:26 +0200 | received badge | ● Supporter (source) |

2012-04-15 15:37:12 +0200 | asked a question | how to find a local maximum? Hello. I'm fairly new to Sage, so lets see if someone more experienced can help! Say I have a function f(x) continuous in [a,b] and derivable in (a,b). How can I implement in Sage a function 'maximum(f,a,b)' that returns the maximum of f(x) in [a,b] (as a numerical approximation, not as an expression)? Thanks you a lot! |

2012-04-15 02:33:40 +0200 | commented answer | obtaining all numerical roots of a function in an interval Thanks for the reply, but this does not fix the problem with periodic infinte roots. I run into the same error: Traceback (most recent call last): MT = maxim(f, a, b) File "", line 1, in <module> File "/tmp/tmpGBdQkB/___code___.py", line 8, in <module> MT = maxim(f, a, b) File "/tmp/tmpbtKw0f/___code___.py", line 20, in maxim roots = [s[x] for s in roots]; KeyError: x |

2012-04-15 01:17:01 +0200 | asked a question | obtaining all numerical roots of a function in an interval Hello, thanks for reading. I'm working on single variable calculus here: Basically what I need is what "find_root" does, but I need a list of ALL roots in a given interval, not just one. So I've been playing with "solve". I found this piece of code which works in most cases: sage: roots = solve(f(x),x,solution_dict=True) sage: roots = [s[x] for s in roots] sage: num_roots = map(n, roots) but it gives an error if the function is periodic and has inifinite roots, becuase the symbolic expression that "solve" gets has infinite solutions too. Defining a desired interval should solve this issue, but I have no idea how to implement such thing! Thanks you and have a good day. |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.