Skip to content

'composite' Func in Matlab #752

@ane-sh

Description

@ane-sh

System information

  • Cantera version: 2.4.0
  • OS: Windows 10
  • MATLAB version:

Following the post in the google group forum titled 'composite' Functor Matlab, the problem is with composing Functors. One member advised that the code was incorrectly written/implemented.

To Reproduce
Taking the example of a function (1- (sin(x)^2))^(1/2), the following code was used

fs = Func('fourier',1,[0,0,1,1])  % sin(x)
fs2 = Func('prod',fs,fs)  % (sin(x)^2) 
fs2_1 = Func('diff',Func('polynomial',0,1),fs2)  % 1-(sin(x))^2 
sqrtF = Func('arrhenius',1,[1,0.5,0])  % sqrt function
% now is the challenging part
Func('composite', sqrtF, fs2_1)

Actual behavior
Either always results in 0 or NaN.
I also tried composing other (simpler) functions but to no avail.

Nonetheless, Cantera great software and indispensable in my toolbox.
Thanks
Aneesh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions