Hello Matt,Thank you very much for your reply and your code above definitely helps me a lot.Now I still have a similar question about the advanced usage of the fitting constraint like the example below, in which I do not add the data.My question is that if I also want the mylorentzian() constructed by variables 'a','b','c','d' always satisfies some boundary condition like [1,100) during the fitting. How can I realize this constraint in the code?
Dear Matt,According to your suggestion, I program the code to fit the variables a, b, c, d and these four variables are necessary for the residual calculation function and they are marked with red below. The second function (mylorentzian()) needs to be imposed as the boundary condition for a,b,c,d but the variable 'x12' is not used in the residual minimization. Is it possible for this code to fit out the a,b,c,d which satisfy the second type boundary condition 10<=(a/ (1 + ((b-c) / d)**2))<=90 ?
Hi MattPlease check this code for instance and what I would expect from it is that the variables should obey 1.5<m+n<2. However, it still does not work under this constraint.
--
You received this message because you are subscribed to the Google Groups "lmfit-py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmfit-py+unsubscribe@googlegroups.com.
To post to this group, send email to lmfi...@googlegroups.com.
Visit this group at https://groups.google.com/group/lmfit-py.
To view this discussion on the web visit https://groups.google.com/d/msgid/lmfit-py/9a5be506-dd9f-40bd-9f01-6180c877b3d6%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lmfit-py+u...@googlegroups.com.
To post to this group, send email to lmfi...@googlegroups.com.
Visit this group at https://groups.google.com/group/lmfit-py.
To view this discussion on the web visit https://groups.google.com/d/msgid/lmfit-py/CA%2B7ESbpNDkMQqVGXXTzbf6644%2BmdK8ej9NuET4G5vJmw_E1Cew%40mail.gmail.com.
Hi Matt,Thank you for your reply.The problem is that in my actual code, there are up to 16 variables need to be fitted and they are mixed together with extremely sophisticated relationship instead of easy format like 1.5<m+n<2. So, is there another way to impose the complicate boundary condition in the fitting? Thank you in advanced.Best regardsJingzhong
Hi Matt,Please check the codes and files attached, from which you can get a code for the fitting and a code to check the fitting result. My aim is to guarantee that the boundary conditions applied can work on the 16 variables (from a to p) ready to be fitted in residuals function.