Skip to content

[Template Fitting] Is it possible to apply this constraint? #857

Closed Answered by HDembinski
zjkjsd asked this question in Q&A
Discussion options

You must be logged in to vote

When you have an equality constraint like this, you would normally express one of the degrees of freedom in your cost function by the others.

I assume that yield(A), yield(B) etc are numbers, and free fit parameters (if we ignore the constraint).

def original_cost_function(yield_a, yield_b, yield_c, yield_d):
     ...

def modified_cost_function(yield_b, yield_c, yield_d):
    yield_a = <compute from yield_b, yield_c, yield_d using the equality constraint>
    return original_cost_function(yield_a, yield_b, yield_c, yield_d)

I assume you are doing a template fit, so in your case, it would work something like this.

template_cost = Template(...)  # insert your templates and data

def modifi…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@zjkjsd
Comment options

@zjkjsd
Comment options

Answer selected by zjkjsd
Comment options

You must be logged in to vote
1 reply
@zjkjsd
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants