简体   繁体   中英

Solve system of equations: 2 differential, 1 quadratic in matlab

Write a Matlab(or other) code for solving the system numericaly: w'(t)=dw(t)/dt;

w'(t)=3*w(t)*y(t),
y'(t)=8*w(t)*y(t),
t^2=9+w(t)+y(t)

I don't know how to use ode45 for this as t has 2 solutions.

Why do you need to solve this numerically? For a numeric solution, you would need at least an initial condition, ie w(0), y0) .

Note that, by comparing the first two equations: 8w'(t) = 3y'(t)

Then, derive the third equation to obtain:

2t = w'(t)+y'(t)

This implies :

8*3*2t = 8*3*w'(t)+8*3*y'(t)

48t = 8*3*w'(t)+8*8*w'(t)

48t = 88*w'(t)

6t = 11*w'(t)

Thus w'(0)=0 and y'(0)=0 .

Therefore, from the first equation: w(0)*y(0)=0 .

Because the equations are symmetric, there are two solutions as you mention. Assume w(0)=0 , then from the third equation, 'y(0)=-9'. And from 6t = 11*w'(t) we have w(t)=(6/11)t , and y(t)=-9+(48/33)t .

The other solution is y(t)=(6/11)t , and w(t)=-9+(48/33)t .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM