05-01-2020 04:47 AM
Thank you Thank you ....thanks a lot.. now i understand the concept of adding constraints to objective function.
Please if you help me regarding my second problem i.e. variant to data converter is not giving output due to which my objective function is giving zero value, please also spot error in code their, i will be very very thankful.
05-01-2020 12:00 PM
You have two ways to specify parameters of an objective function.
1. Specify in the objective function: This means that in the objective function you specify constants or default values that can only be changed by editing the objective function. It looks like this is what you are trying to do, but you are using a block-diagram constant as the "type" input to the "variant to data" primitive. Any data contained within the type input is ignored as it is used as a type specifier only. So instead of your current code:
You might have this:
2. Specify objective function parameters elsewhere in the optimization algorithm:
Method one can be inconvenient because every time the objective function parameters change you must edit the objective function. For example, suppose temperature (T) is a measured quantity in an experiment and is a parameter of your objective function. Suppose you measure temperature 10 times and each time you will perform an optimization with your objective function. Using method 1 you will have to edit your objective function 10 times, making automation of the optimization problem problematic. An alternative is to have a method to pass the objective function parameter into the cost function from a higher level in the VI hierarchy. This data could be anything, so we used a variant as a carrier for this data. This means that at the point in your diagram where you call the global optimization.vi you would pass your model parameters into the "function data" input of "global optimization.vi". The global optimization vi uses call by reference internally to evaluate your specified objective function, and passes the function data variant to your objective function. Inside the objective function you just convert from the variant type back to the actual parameter type.
-Jim
05-01-2020 01:33 PM
oh great Sir, things are getting amazing, as Now i understand why in ''Non linear spring constant fit" example variant is used. Let me try to optimize this objective function by taking remaining help from Non linear spring constant example. I will let you know than here.
As i found you here Sir that's why i will solve my all problems here in this post unless i optimize this objective function. Once again thanks again for so much help