Trouble Solving a Diff Equation

  • Thread starter marcoaaguiar
  • Start date
In summary, the problem is a piece of a Control Engineering problem for a paper that the poster is writing. The equation is: dy = (k+x)*(a/x+b/y)dx. The inital condition for y is a constant 'y0' and for x = 0. The problem is to find a analytic so that the properties of the controller can be proved. The problem can be simplified to: find I(g), so that g can be found. The function I is a function of g and can be solved for in Mathematica numerically. The constants are set to one and the problem is solved for g(0) = 1.
  • #1
marcoaaguiar
2
0
Hi, I've been two weeks trying to solve this Diff Equation, but no success 'til now. I found your forum now, and I hope we can find a solution. I'm sorry if I'm posting this on the wrong section.
This problem looks simple, but due my formation (Engineering) and the fact that I've not used EDO for a while, makes this problem hard for me :)

It's a piece of a Control Engineering problem for a paper that I'm writing.
The equation is:

dy = (k + x)*(a/x+b/y)dx

The inital condition for y is a constant 'y0' and for x = 0. I need a analytic so I can prove some some properties of my controller.

I'll really appreciate your help
 
Physics news on Phys.org
  • #2
I tried a few substitutions and I also tried maple and all came up a blank, what properties were you hoping to prove? They may well be proven without actually solving the equation.
 
  • #3
ok, the full problem is:

the controller diff equation
dI/V = a*dg/g + b*dp/p

System dinamics:
System 1:
dV = dg
but the inital conditions for V is different from 0, a cst k
so V = (k + g)

System 2:
dg = I*dp/p
dp/p = dg/I

back to the controller DE,

dI/(k+g) = a*dg/g + b*dg/I
>> dI = (k+g)*(a/g + b/I)*dg

or

dI = (k+g)*(a*I+ b*g)/(g*I)*dg
>> g*I dI = (k+g)*(a*I + b*g) dg

I want to find I(t), so i can find g(t). Based in the input p(t).
 
  • #4
Lemme' give it a shot in terms of I, g, and known p(t). You have:

[tex]\frac{I'}{k+g}=\frac{a g'}{g}+\frac{b g'}{I}[/tex]

So that's a DE for the function I(g). Right? Not 100% sure but think so. Suppose for now, I'm ok with that. Then note g can't be zero since that's a singular point of the DE. So let's solve this in Mathematica numerically for the function I(g) (can't use big I in Mathematica as a variable name) with just all the constants set to one:

Code:
myk = 1;
a = 1;
b = 1;
g0 = 1;
i0 = 1;
myp[t_] := 2 + t^2;

mysol = NDSolve[{g i[g] i'[g] == (myk + g) (a i[g] + b g), 
   i[g0] == i0}, i, {g, g0, 15}]
myi[g_] := Evaluate[i[g] /. mysol] // First

So now I have I(g) and I solve the other equation in g:

[tex]dg=\frac{Ip'}{p}[/tex]

and for now, just let p(t)=2+t^2 and keep in mind I is a function of g. So I solve for g in Mathematica now letting g(0)=1:

Code:
mygsol = NDSolve[{Derivative[1][g][t]/myi[g[t]] == (2*t)/(2 + t^2), g[0] == 1},
 g, {t, 0, 2}]
myg[t_] := First[Evaluate[g[t] /. mygsol]]

Note how I specified i(g(t)) in that expression since previously I solved for i(g). So now I have g(t).

Now, let's back-substitute all that into the original DE an keep in mind that I solved for I(g) so to back-substitute into the DE in terms of t, I calculated:

[tex]\frac{dI}{dt}=\frac{dI}{dg}\frac{dg}{dt}[/tex]

Code:
In[149]:=
leftside = ((D[myi[g], g] /. g -> myg[1])*(D[myg[t], t] /. t -> 1))/(1 + myg[1])
rightside = (a*D[myg[x], x] /. x -> 1)/myg[1] + (b*D[myg[x], x] /. x -> 1)/myi[myg[1]]

Out[149]=
1.8982003067079452

Out[150]=
1.8981978130717898

That's a start since the left side is close to the right side. That may however not be what you want and I'm not sure everything is ok. May need to clean it up if it's close to what you want.
 
Last edited:
  • #5
I didn't initially think to just solve the system simultaneously:

In[118]:=
a = 1;
b = 1;
k = 1;
i0 = 1;
g0 = 1;
p[t_] := 2 + t^2;
ttest = 2.3;

mysol = NDSolve[{Derivative[1][t] == (k + g[t])*((a*Derivative[1][g][t])/g[t] + (b*Derivative[1][g][t])/i[t]),
Derivative[1][g][t] == (i[t]/p[t])*Derivative[1][p][t],
i[0] == i0, g[0] == g0}, {i, g}, {t, 0, 5}]

myi[t_] := Evaluate[i[t] /. Flatten[mysol]];
myg[t_] := Evaluate[g[t] /. Flatten[mysol]];

leftside = D[myi[t], t] /. t -> ttest
rightside = (k + myg[ttest])*((a*D[myg[t], t] /. t -> ttest)/myg[ttest] + (b*D[myg[t], t] /. t -> ttest)/myi[ttest])

Out[125]=
{{i -> InterpolatingFunction[], g -> InterpolatingFunction[]}}

Out[128]=
19.888332975980877

Out[129]=
19.88832995172911


. . . glad I'm not being tested on this stuff.
 

1. What is a differential equation?

A differential equation is a mathematical equation that describes the relationship between a function and its derivatives. It involves one or more independent variables, one or more dependent variables, and the derivatives of these variables.

2. Why is it important to solve differential equations?

Differential equations are used to model many real-world phenomena in fields such as physics, engineering, economics, and biology. By solving these equations, we can gain insight into the behavior of these systems and make predictions about their future behavior.

3. What are the different methods for solving differential equations?

There are several methods for solving differential equations, including separation of variables, substitution, and using integrating factors. These methods involve various techniques such as integration, differentiation, and algebraic manipulation.

4. How do I know which method to use to solve a particular differential equation?

The method used to solve a differential equation depends on its type and order. For example, a first-order linear differential equation can be solved using the integrating factor method, while a second-order homogeneous differential equation can be solved using the substitution method.

5. Are there any software tools available to help with solving differential equations?

Yes, there are many software tools available, such as MATLAB, Mathematica, and Maple, that can help with solving differential equations. These tools use numerical methods to approximate solutions to differential equations, making the process faster and more accurate.

Similar threads

  • Differential Equations
Replies
7
Views
1K
  • Differential Equations
Replies
2
Views
985
  • Differential Equations
Replies
4
Views
1K
  • Differential Equations
Replies
2
Views
2K
Replies
39
Views
479
  • Differential Equations
Replies
7
Views
2K
  • Differential Equations
Replies
27
Views
2K
  • Differential Equations
Replies
5
Views
652
Replies
13
Views
1K
Replies
3
Views
789
Back
Top