Solving differential equation with multiple functions of the same variable

8 views (last 30 days)
Hi,
I am trying to solve for b(c) in the differential equation below. However, there is also a function F(c) in the differential equation. I am assuming that F(c) is known (it is a CDF of a distribution), but b(c) is unknown.
When I run the code below, I think dsolve is solving for F(c) since the solution it returns is a function of b(c). How can I solve for b(c) in terms of F(c)?
syms c b(c) alpha theta F(c) f n; %establish variables
eqn = (1-F)*diff(b,c)*(-theta*(b-c)+(alpha-theta*b))==diff(F,c)*(n-1)*(b-c)*(alpha-theta*b); %diffeq
sol(c)=dsolve(eqn) %solve
Right now I'm getting the below which doesn't seem right.

Answers (1)

SAI SRUJAN
SAI SRUJAN on 3 Nov 2023
Hi Eric Yde,
I understand that you are trying to solve differential equation with multiple functions of same variable.
You can use "solve" and "dsolve" MATLAB functions to solve the equation.
S = solve(eqn,var);
The above line of code solves the equation "eqn" for the variable "var". If you do not specify "var", the "symvar" function determines the variable to solve for. For example, "solve(x + 1 == 2, x)" solves the equation for "x".You can use this to solve an equation with respect to a variable.
syms a b c x
eqn = a*x^2 + b*x + c == 0;
S = solve(eqn);
Sa = solve(eqn,a);
The following line of code solves the differential equation, where "eqn" is a symbolic equation. Solve a system of differential equations by specifying "eqn" as a vector of those equations.
S = dsolve(eqn)
As the cummulative distribution function "F(c)" is known, use the explicit formulaes of "F(c)" and "f" in the equation.To proceed with solving the differential equation, the "dsolve" function can be employed on the modified equation.
You can refer to the following documentation to know more about "solve" and "dsolve" MATLAB functions,

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!