I attached 2 photos of my program. so i have numerical solution for system of differential equations, and in addition, i have data of exexperiment so i want to find the "best" parameters that will generate the closest solution. i think i need to use lsqcurvefit command but it is not working for me. any suggestions?

 채택된 답변

Alan Weiss
Alan Weiss 2018년 8월 6일

0 개 추천

This example is relevant.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

댓글 수: 3

Shira Bar Dov
Shira Bar Dov 2018년 8월 6일
thank you very much, I've tried to write this fuction but i have errors. i would like to get your help with understanding how should i change the program please.
i attached my fuction and the main program
Alan Weiss
Alan Weiss 2018년 8월 6일
I do not understand what is the size of your xdata, nor what it represents. In the example I pointed you to, tspan is used as xdata, and this tspan is given by the ODE solver as the set of points used in solving the ODE. In your code, you declare tspan = [0 34], meaning tspan is a 2-element vector. You probably want to use your resulting time variable t as the set of data points.
Furthermore, in your fitlorenzfn code, you seem to assume that xdata is three-dimensional. This is where I cannot help you, because I don't understand what you are doing here. Look at the code of the example, and you see that the example fitlorenzfn takes a long vector of xdata, the set of times.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Shira Bar Dov
Shira Bar Dov 2018년 8월 7일
Thank you, I'm just starting use matlab so it's still confusing for me. In the beggining i wrote the fuction on the picture which solve numericly the system of differential equations. I'm not sure how to adjust the fitlorenzfn so it will find the best parameters for my data.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2018년 8월 4일

댓글:

2018년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by