Question: Help with problems solving?

Hello

I encountered a few problems. One is that in the first section, I wanted to use the definition above instead of f (s ) and g (s ), which means that when the variable changes under the integral sign, it should detect and replace it.

And the next is that in the Equality section, I should sort by p and set the coefficients to zero. And then, for example, solve for the zero power of p and get the value of f0 and use it in subsequent solutions. Can you help me?

restart;
EQUATIONS

equ1:=diff(f(t),t)-1-t-t^2-g(t)-int(f(s)+g(s),s=0..t)=0;

equ2:=diff(g(t),t)+1+t-f(t)+int(f(s)-g(s),s=0..t)=0;
 

diff(f(t), t)-1-t-t^2-g(t)-(int(f(s)+g(s), s = 0 .. t)) = 0

 

diff(g(t), t)+1+t-f(t)+int(f(s)-g(s), s = 0 .. t) = 0

(1)

f(t):=sum(f[i](t)*p^i,i=0..1);

f[0](t)+f[1](t)*p

(2)

g(t):=sum(g[i](t)*p^i,i=0..1);

g[0](t)+g[1](t)*p

(3)


HPMs

hpm1:=(1-p)*(diff(f(t),t)-1-t-t^2)+p*(-diff(f(t),t)+1+t+t^2-g(t)-int(f(s)+g(s),s=0..t))=0;

hpm2:=(1-p)*(diff(g(t),t)+1+t)+p*(diff(g(t),t)-1-t+f(t)-int(f(s)-g(s),s=0..t))=0;

(1-p)*(diff(f[0](t), t)+(diff(f[1](t), t))*p-1-t-t^2)+p*(-(diff(f[0](t), t))-(diff(f[1](t), t))*p+1+t+t^2-g[0](t)-g[1](t)*p-(int(f(s)+g(s), s = 0 .. t))) = 0

 

(1-p)*(diff(g[0](t), t)+(diff(g[1](t), t))*p+1+t)+p*(diff(g[0](t), t)+(diff(g[1](t), t))*p-1-t+f[0](t)+f[1](t)*p-(int(f(s)-g(s), s = 0 .. t))) = 0

(4)

``

Collect

A:=collect(hpm1,p);

(-2*(diff(f[1](t), t))-g[1](t))*p^2+(2*t^2-2*(diff(f[0](t), t))+diff(f[1](t), t)-g[0](t)-(int(f(s)+g(s), s = 0 .. t))+2*t+2)*p-t^2+diff(f[0](t), t)-t-1 = 0

(5)

EqualityNULL

for i from 0 to degree(A,p) do EQ[i]:=simplify(coeff(A,p,i)); end do;

Error, final value in for loop must be numeric or character

 
   

Download HPMsystem.mw

Please Wait...