Plot the integration of differential equations

Hello, I have a system similar to the Lorenz attractor. I mean a set of differential equations. They are in a function called Eq4_jieren_plot And the main script contains the different constants for the differential equation, calls the function above and plots the results of the integration. When I run the code, I get an error saying that I have a problem in the second line of the function which corresponds to the first differential equation. I checked several times, but there is nothing wrong with it. Can someone hep me to plot this integration, please? Thanks, Zied

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 11 月 8 日

0 投票

You are using an undocumented syntax for your ode45 call. Your ke is in a position where it is being treated as an options structure. As it is not a valid options structure, it is getting replaced with '' . This is a glitch in the handling of the undocumented syntax.
You should not use a string for a function for ode*() calls -- it can work, but it is long long obsolete. And do not pass extra arguments -- you can encounter problems that way.

3 件のコメント

Zied
Zied 2016 年 11 月 8 日
編集済み: Zied 2016 年 11 月 8 日
Hello Walter, I removed the string and I replaced it with @. I also deleted the extra arguments and I added them in the main script and the function as global variables. Now the code runs without error but I get an empty space in the 2D and 3D plot. I tried oder ode solvers like ode15s but same problem. Do you have an idea about the reason of this?
end Cheers, Zied
Walter Roberson
Walter Roberson 2016 年 11 月 8 日
Your attached code still uses the string syntax and no globals. Perhaps you attached an older version.
Zied
Zied 2016 年 11 月 8 日

サインインしてコメントする。

質問済み:

2016 年 11 月 7 日

コメント済み:

2016 年 11 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by