Error using str2sym (line 83) Unable to convert string to symbolic expression: L 1 (C 103): BADCH: Invalid character(s).

9 ビュー (過去 30 日間)
Hi everyone, I am unsuccessful in converting string to symbolic expression on this code:
https://www.dropbox.com/s/xuauj97inby8o5m/IntegratedModelAnalytical.m?dl=0
What can I do?

採用された回答

Star Strider
Star Strider 2018 年 8 月 15 日
You are using the Unicode ‘En Dash’ (decimal 8211, hex 2013) instead of a normal hyphen (decimal 45, hex 002D) for your minus and negation signs.
You also have a ‘hanging’ negative:
Eq1 = ('n + 2*d -((e*6.24*n)/(n^2 +6.24*n + 6.24*5.68e-5))- 2*((e*6.24*5.68e-5)/(n^2 + 6.24*n + 6.24*5.68e-5))–((h*1.7e-3*n)/(n^2 + 1.7e-3*n + 1.7e-3*6.55e-8))– 2*((h*1.7e-3*6.55e-8-)/(n^2 + 1.7e-3*n + 1.7e-3*6.55e-8))- 5.3e-8/n=0');
(SCROLL RIGHT) ↑ ← HERE
The correct version is:
Eq1 = 'n + 2*d - ((e*6.24*n)/(n^2 + 6.24*n + 6.24*5.68e-5)) - 2*((e*6.24*5.68e-5)/(n^2 + 6.24*n + 6.24*5.68e-5))-((h*1.7e-3*n)/(n^2 + 1.7e-3*n + 1.7e-3*6.55e-8)) - 2*((h*1.7e-3*6.55e-8)/(n^2 + 1.7e-3*n + 1.7e-3*6.55e-8)) - 5.3e-8/n=0';
There are other problems. I will let you solve them.
  8 件のコメント
Star Strider
Star Strider 2018 年 8 月 15 日
I have no recent experience with DAEs.
It will be best if you open a new Question describing your current problem. There are others here much more knowledgeable with respect to DAEs in MATLAB than I am.
Dursman Mchabe
Dursman Mchabe 2018 年 8 月 15 日
Actually, I have been doing that for some time now, DAEs are just challenging. See the links below:
https://www.mathworks.com/matlabcentral/answers/412270-this-dae-appears-to-be-of-index-greater-than-1?s_tid=mlc_ans_email_view#comment_600007
https://www.mathworks.com/matlabcentral/answers/414912-error-using-vertcat-dimensions-of-arrays-being-concatenated-are-not-consistent?s_tid=mlc_ans_email_view#answer_332830
I only had success with IVPs and BVPs. That is the reason I am also trying DSOLVE coupled with SOLVE. It will give me analytical solutions for all the variables.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEquation Solving についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by