How do you write a pde func for a variable v in matlab, where the v is experimental data that are to be fit in a pde function to extrapolate the data. fro a longer time.?
2 次查看(过去 30 天)
显示 更早的评论
How do you write a pde func for a variable v in matlab. The PDE equation is as follows, I simplified it with all the constants put and finally resulted in this: dv/dt=k(2-2.37v)/2.12
here the basic thing is v are experimental values which are varied with time (h) and need to fit those values or data in to the above function and extrapolate it for some days. Any advice or idea is accepted. Thank you
0 个评论
采纳的回答
Bruno Pop-Stefanov
2014-10-6
Dinesh,
Are you trying to simulate the evolution of a differential equation? Are you trying to solve the equation?
The differential equation:
is ordinary, not partial.
If you want to solve this equation and plot v(t) over time to compare the solution to the experimental values, you can use the dsolve function of Symbolic Math Toolbox.
The documentation page for dsolve contains examples to show you how to solve an ordinary differential equation. In addition, you can also take a look at this example page:
For example, you could solve the ODE above as follows:
>> syms k x(t)
>> S = dsolve(diff(x) == k*(2-2.37*x)/2.12)
S =
(C3*exp(-(237*k*t)/212))/237 + 200/237
Then, if you want to evaluate it, use matlabFunction to convert the expression to a function of C3, k and t:
>> v = matlabFunction(S)
v =
@(C3,k,t)C3.*exp(k.*t.*(-2.37e2./2.12e2)).*(1.0./2.37e2)+2.0e2./2.37e2
You can now evaluate it. For example, for C3 and k equal to 1:
>> t = 0:0.01:10;
>> y = v(1,1,t);
Now display the plot:
>> plot(t,y)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Partial Differential Equation Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!