numerical solution of a system of ODE which is not in standard form

3 ビュー (過去 30 日間)
raha ahmadi
raha ahmadi 2020 年 7 月 4 日
コメント済み: Star Strider 2020 年 7 月 6 日
Hi
I' m wondering can MATLAB solve a system of ODE of these forms numerically?
H11*dydt+H12*dxdt=H13
H21*dydt+H22*dxdt=H23
I can change it to standard form but I have very large numbers which MATLAB has problem with it and I receive this massage:
Output truncated. Text exceeds maximum line length for Command Window display.
. I will upload my output. I want to solve these ODE numerically so I need the coefficient of all of terms in each eqaution. I utilized the collect cammand but it did not work. How cam I control and arrenge these large coeffisient. how can i determine each coeffisient correctly?
I would be gratefull if some one can help me.
thank you in advance
raha
this is some terms of output differential equation
(930441627500546658162730981425505183132667665707339718275447859267760748743794621
3848815439656366790278984387099311194969091496593187779728810864687259359515581251
8191929791546041229963635314657368394923219128924360408416905997843608302300038558
79197879071442125658901144......................................................0
0000000000000000000*Iass^8*IBss^5*Ipss^4 - 191746860148563438549216527115219808387369783
2286756806355856960741923824185970189......

採用された回答

Star Strider
Star Strider 2020 年 7 月 4 日
It would likely help to have your code.
If you want more tractable numerical results, use the vpa function. The double function is also an option, however the arguments to it must not include any symbolic variables.
  4 件のコメント
raha ahmadi
raha ahmadi 2020 年 7 月 6 日
Dear Star Strider
I’m so grateful for your help. I couldnt handle my ODE coeffisients but now I can. it seems its implicit form and very different numbers ( numbers as large as 1e24 and also as small as 1e-9 make it difficult to solve. They are also nolinear. Odes15s seems does not work anymore ( In fact I m new in soling ODE.) I'll use your and John' s points. I' ll try one more time .
I hope best wishes for you and john
Raha
Star Strider
Star Strider 2020 年 7 月 6 日
As always, our pleasure!
The ‘dde_fcn’ with the appropriate arguments should allow you to calculate ‘ddd’. I did not try that myself because I have no idea what the arguments should be.

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

その他の回答 (1 件)

John D'Errico
John D'Errico 2020 年 7 月 5 日
Your question seems to be one of solving a system of ODEs with a mass matrix. For example in the help for ODE45, we see this option:
ode45 can solve problems M(t,y)*y' = f(t,y) with mass matrix M that is
nonsingular. Use ODESET to set the 'Mass' property to a function handle
MASS if MASS(T,Y) returns the value of the mass matrix. If the mass matrix
is constant, the matrix can be used as the value of the 'Mass' option. If
the mass matrix does not depend on the state variable Y and the function
MASS is to be called with one input argument T, set 'MStateDependence' to
'none'. ODE15S and ODE23T can solve problems with singular mass matrices.
That seems to be the question you have posed.
H11*dydt+H12*dxdt=H13
H21*dydt+H22*dxdt=H23
So all you need to do is pass in the mass matrix as
M = [H11, H12;H21, H22];
If you compute these elements in symbolic form but still just numbers, then use double to convert them to double precsion numbers.
  1 件のコメント
raha ahmadi
raha ahmadi 2020 年 7 月 5 日
編集済み: raha ahmadi 2020 年 7 月 5 日
Thanks alot. I' ll try it.
With best wishes

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

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by