solve linear differential equation

Hey everybody, I am trying to solve a linear differential equation where the right side depends on some function f{1} at some point (x+d,p), whose variables are x and p. Now f{2} should save the solution of this differential equation which should of course be a function depending on x and p. Unfortunately I get the error "Error in derive_p (line 16) eqn = diff(v, x) + lambda*v == lambda*beta+f{1}(x)"
What am I doing wrong?
function opt_barrier = deriv_p(beta, lambda, d)
f=cell(5);
f{1} = @(x,p) (beta*(beta + lambda*(d+(beta-1)*p)-2))/((1-beta)*lambda)+beta*x - ((1-beta)/lambda) *exp(lambda*p-lambda*x);
syms v(x)
eqn = diff(v, x) + lambda*v == lambda*beta+f{1}(x+d,p)
f{2}=dsolve(eqn);
end
Furthermore, the constant which is part of the solution to the diff.equ. should be calculated in a next step. It is the solution to f{1}(x,p)=f{2}(x,p). Does anyone know how to do this?
Thanks in advance:-)

1 Comment

I am sorry, the constant should be calculated by f{1}(p-d,p)=f{2}(p-d,p).

Sign in to comment.

Answers (0)

Asked:

on 22 May 2017

Edited:

on 22 May 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!