Solving differential equation with multiple functions of the same variable
8 次查看(过去 30 天)
显示 更早的评论
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.
回答(1 个)
SAI SRUJAN
2023-11-3
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,
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!