问题简化后如下:y = t^3 ,x=t^2 ;如何得到x y 的关系 :
代码如下 :
clc,syms t
y = t^3 ;x=t^2 ;
y=subs(compose(y,finverse(x)),'t','x')
y =
x^(3/2)
subs :替换变量
例如
subs('x^2+1','x','y')
ans =
y^2 + 1
compose :实现函数的复合
>> y=x^2
x=t
>> compose(y,x)
ans =
t^2
>>
compose 函数
compose Functional composition.
compose(f,g) returns f(g(y)) where f = f(x) and g = g(y).
Here x is the symbolic variable of f as defined by SYMVAR and
y is the symbolic variable of g as defined by SYMVAR.
If f and g are symbolic functions the x and y are the respective
inputs.
Examples:
syms x y z t u;
f(x) = 1/(1 + x^2); g(y) = sin(y); h = x^t; p = exp(-y/u);
compose(f,g) returns 1/(sin(y)^2 + 1)
compose(f,g,t) returns 1/(sin(t)^2 + 1)
compose(h,g,x,z) returns sin(z)^t
compose(h,g,t,z) returns x^sin(z)
compose(h,p,x,y,z) returns (1/exp(z/u))^t
compose(h,p,t,u,z) returns x^(1/exp(y/z))
finverse
求反函数
Functional inverse
Syntax
g = finverse(f)
g = finverse(f,var)
Description
g = finverse(f) returnsthe functional inverse of f.Here f isan expression or function of one symbolic variable,for example,x.Then g is an expression or function,such that f(g(x))= x.That is,finverse(f) returns f–1,provided f–1 exists.
g = finverse(f,var) usesthe symbolic variable var as the independentvariable.Then g is an expression or function,such that f(g(var)) = var.Use this form when f containsmore than one symbolic variable.
Input Arguments
f
Symbolic expression or function.
var
Symbolic variable.
Output Arguments
g
Symbolic expression or function.
Examples
Compute functional inverse for this trigonometric function:
syms x
f(x) = 1/tan(x);
g = finverse(f)g(x) =
atan(1/x)