开发者

How to get first derivation of equation in matlab

I have this equation: f(a,b,x)=t0-a+(a^2*(1+((x-x0)^2/b^2)))^0.5

if I want get the first derivative: df(a,b,x)/d(a,b) for x0,t0 = constant and a,b,x = array.

is this true if I use this script

> syms f; syms t0; syms x; syms x0; syms
> a; syms b;
> 
> 
> f=t0-a+(a^2*(1+((x-x0)^2/b^2)))^0.5;
> f_1=diff(f,a)+diff(f,b)

开发者_如何学编程I'm asking because I never get the right plot if I use this method... Any suggestions?


df/d(a,b) is not equal df/da+df/db. Rather, it is (df/da)/db.

In other words, you need to write

f_1=diff(diff(f,a),b);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜