How to solve and plot system of nonlinear differential equations?
Show older comments
Hello,
I am having troubles solving a system of second order nonlinear equations with boundary conditions.
The equations are:
u0=4*pi*10e-7;
R=0.8;
V=10;
d=0.015;
xp1=0.002;
xp2=d-xp1;
p2=1000000;
p1=1000000;
r=0.01;
W=0.02;
g=0.001;
N=200;
x0=0.025;
k=300;
M=0.3;
B=40;
syms t x(t) i(t)
v(t) = 10*heaviside(0.3-t);
fplot(v(t), [0 0.6])
L0=u0*pi*r^2*N^2;
L=L0/(x+(r*g/(2*W)));
Eqn1:

The equation 2 has boundries, I can write in Mathmatica as,
-M*Dt[x[t], {t, 2}] - B*Dt[x[t], t] +
If[x[t] > xp2, -p2*(x[t] - xp2), 0] +
If[x[t] < xp1, -p1*(x[t] - xp1), 0] - k*(x[t] - x0) +
0.5*(i[t]*i[t]*D[L[x], x[t]]) = 0,
x[0] = xp2 - 0.00000001, x'[0] = 0., i[0] = 0.0
but I dont know how to write the second equation in matlab and solving and plotting for i(t) and x(t).
7 Comments
Torsten
on 16 Dec 2022
I don't see any correspondence between the equation you posted and the equation you set up in Mathematica.
berk26092
on 16 Dec 2022
Torsten
on 16 Dec 2022
And where is the equation for L ?
berk26092
on 16 Dec 2022
Torsten
on 16 Dec 2022
p1, p2, xp1, xp2, k ?
berk26092
on 16 Dec 2022
Torsten
on 16 Dec 2022
When I coded in mathmatica I used different names for them and in matlab I used different names.
Why ? Don't make life harder than it needs to be.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

