필터 지우기
필터 지우기

How to find the input that makes the function get a specific value

조회 수: 4 (최근 30일)
Grigorios Chatziandreou
Grigorios Chatziandreou 2022년 12월 10일
답변: Walter Roberson 2022년 12월 10일
Hello, I have a function that represents the number of cycles of loading to a component, to grow a crack from length ai to af
N = @(ai,af)
I want to make another function that gives me the final length for a given number of cycles N and initial negth ai
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2022년 12월 10일
You could consider minimizing
@(AF) (N(GIVEN_AI,AF) - TARGET_N).^2
However, presumably "number of cycles" is an integer. If it tried two different AF and both of them returned the same N value that was not the target, then the minimizers would not have anything to go on about which direction to move. So you cannot use fminsearch() or fmincon() because thoe require continuous functions. You could probably try with ga() though.

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by