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

4 views (last 30 days)
raha ahmadi on 4 Jul 2020
Commented: Star Strider on 6 Jul 2020
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.
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 on 4 Jul 2020
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.
Star Strider on 6 Jul 2020
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.

John D'Errico on 5 Jul 2020
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.
raha ahmadi on 5 Jul 2020
Thanks alot. I' ll try it.
With best wishes

R2018b

### Community Treasure Hunt

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

Start Hunting!