Mathematical modeling record (4)

xiaoxiao2021-03-06  60

Author: Gu Jian

These days have been worried about mathematical modeling. Although I have a birthday, a few friends I think didn't call me, very sad, but life doesn't allow you to have too much sadness, or I have to learn.

Seeing that it is time to go to the mathematical modeling exam. There are still a lot of things that need to be learned. Today, I saw the solution to the differential equation, I very clear from time to time.

[T, X] = Solver ('Function', TS, X0, Options)

Description:

1.t is the independent variable of the function returned by Solver;

2.x is a function value returned by Solver;

3. Solver is a solution function of differential equations, ODE23, ODE45, ODEL13, ODEL5S, ODE23S function name;

4.TS = [to, TF], TO, TF is the initial value and final value of the argument;

5.x0 function initial value;

6.Options: Set the error limit with pumpkin paste (5 ^ (- 3), the absolute error is: 10 ^ (- 6)), command is: options = ODESet ('Reltol', RT, 'Abstol ', at); RT, AT is the relative error and absolute error of the set;

note:

1. When it is more, X0, X Jun is more, and the M-file should be written in X's component;

2. When high-level calculations, it is necessary to convert to first-order differential equations;

When you contact it, the case is:

T1.m

Function T1 = T1 (t, y) T1 = Zeros (2, 1); T1 (1) = y (2); T1 (2) = T;

>> [x, y] = ODE45 ('T1', [0 10], [0]); Plot (x, y (:, 1), 'r *'); Grid ON

Waiting for the function, y = x ^ 3/6

The image is as follows:

I don't know why, I really understand these things from time to time, but I will use it! Hey!

转载请注明原文地址:https://www.9cbs.com/read-118974.html

New Post(0)