473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

fminbound

Hello everyone:
I'm new using scipy, so I'm sorry if any of my questions are silly.

I'm trying to find the maxima, absolut and local, of a function, in order to
fit an exponencial curve and get de exponecial argument.

My function if the soluction of a couple equations system:

def derivs3(x,t,gamma,omega,dl):
d1 = omega*x[2] - gamma *x[0]
d2 = dl*x[2] - (gamma/2.)* x[1]
d3 = -omega *x[0] - dl*x[1] - (gamma/2.)* x[2] + (omega/2.)
return d1,d2,d3
def solucion(a,t,gamma, omega, dl):
sol=odeint(derivs3,a,t,(gamma,omega,dl))
return sol

The case I'm interesting in, the soluction have the form of a sin*exp, so I
want to find the function that envolves it, a exponencial function.
To do this, I can find the maximas, and fit them, so I use:

def g4(t1):
sol2=odes.solucion((0.5,0,0),t1,0.5,5,0)
return sol2[:,0]
x_max = optimize.fminbound(g4,0,2)

To use fminbound, I need a function that returns only a single array, so I use
de g4 function.
I use (0,2) as bounds.
The problem I have is that the return is:

x_max
1.9999959949686341

That aren't the maximas in the interval.
If I change the interval:

x_max = optimize.fminbound(g4,0.1,4)
x_max
3.9999945129622403

And so on.

I don't know what I'm doing wrong, so if everyone can help, I'm going to be
really happy.


May 8 '07 #1
0 1066

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tkpmep | last post by:
I'm trying to optimize a function using SciPy's optimize.fmin, but am clearly getting the syntax wrong, and would be grateful for some guiidance. First, here's the function def func(Y,x): """Y...
8
by: tkpmep | last post by:
I need to create ranges that can start and end with real numbers. Searching this newsgroup brought me to a function that I then modified as follows: def myRange(iMin, iMax=None, iStep=1):...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.