2015-07-05 18:34:02 -0600 | received badge | ● Famous Question (source) |

2015-01-14 09:22:25 -0600 | received badge | ● Taxonomist |

2014-03-30 22:01:29 -0600 | received badge | ● Famous Question (source) |

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

2013-06-03 08:37:34 -0600 | received badge | ● Notable Question (source) |

2013-05-13 10:58:36 -0600 | received badge | ● Popular Question (source) |

2012-12-16 14:31:25 -0600 | received badge | ● Popular Question (source) |

2012-04-18 08:52:57 -0600 | received badge | ● Student (source) |

2012-04-16 10:53:40 -0600 | 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 09:21:31 -0600 | 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 11:16:53 -0600 | commented answer | how to find a local maximum? Can you explain why, or how, does your solution work? Thanks you |

2012-04-15 09:57:04 -0600 | 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 09:40:26 -0600 | received badge | ● Supporter (source) |

2012-04-15 08:37:12 -0600 | 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-14 19:33:40 -0600 | 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-14 18:17:01 -0600 | 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.