# Question:Solve an ODE with mixed boundary condition

## Question:Solve an ODE with mixed boundary condition

Maple
Dear All, First of all thank alec and Prof Doug. Please refer to post http://beta.mapleprimes.com/node/362#comment-729 My problem is to solve the following ODE with constrain given by the Eq: > DEq := diff(f(x),x) = c1*sqrt( g(f(x)) - g(f(x=x1)) ); > Eq := ug - f(x=0) = c2*sqrt( g(f(x=0)) - g(f(x=x1)) ); > g(f(x)) := exp(f(x)-xn) +exp(-f(x)) +(1-exp(-xn))*f(x); where ug is the independent variable and others are parameters > c1 :=-257753830.552993398770016153893; > c2 :=1.40376701562707174099362643812; > xn := 35.4196679725860384893589519100; > x0 := 0; > ug := 40; I have tried to followed alec's suggestion but the solution sometime still cannot be obtained. The independent variable ug has to be varied from -50 or less to + 100 or more. The intial guess in solving f0 (f0 := fsolve(g('fx0'(f0))-gfx0(f0),f0=30);) has to be input manually, this is a big drawback. Please look at my worksheet attached. Thanks for your time and suggestion. David P.S. Cannot attached the file due to limited file size. Copy and paste it below. =============================== > restart: > with(DEtools): > gfx0 := unapply(solve(ug - f0 = c2*sqrt( g(f0) - g(f(x0)) ),g(f(x0))),f0); > fx0 := f0->rhs(dsolve({diff(f(x),x) = c1*sqrt( g(f(x)) - gfx0(f0)), f(0)=f0},numeric,method=dverk78)(x0)); > g := f->exp(f-xn) +exp(-f) +(1-exp(-xn))*f; > #Now it is time to enter the parameters > > c1 := -257753830.552993398770016153893; > c2 := 1.40376701562707174099362643812; > xn := 35.4196679725860384893589519100; > x0 := 0; > > ug := 28; > > #c1,c2,xn,ug,x0:=1,-2,5,1,0; > plot({g@fx0,gfx0},0..40); > f0 := fsolve(g('fx0'(f0))-gfx0(f0),f0=30); > sol := dsolve({diff(f(x),x) = c1*sqrt( g(f(x)) - gfx0(f0)), f(0)=f0},numeric,method=dverk78); > plot(x->rhs(sol(x)),0..3e-9,-1.5..1.5); ﻿