function [Q_LEFT,Q_RIGHT] = fcnn(x_v)
%#codegen
Ps=2.1*10^6; %%压力1
P0=0.06*10^6; %%背压
b0=0.155*10^(-3)/2; %%出口半宽度
g=9.8;
Lambda=0.62;
A1=1.2178*10^(-3);
rou=830;
H=0.8*10^(-3);
% x=0.7*10^(-3);
alfa=0.7749;
alfa_1=5/180*pi;
alfa_2=10/180*pi;
gamma=18.5/180*pi;
ksi0=Lambda/(8*tan(alfa))*[1-(2*b0/A1)];
u0=(2*(Ps-P0)/(rou*(1+ksi0)))^0.5;
% L0=11.5*b0;
L0=b0/tan(5/180*pi);
D1=2*(H*tan(gamma)*tan(alfa_2)/(tan(gamma)+tan(alfa_2))+b0);
D2=2*(b0+H*tan(alfa_2));
syms x_r y
y_r=b0+(H-x_r)*tan(gamma);
b_c=(L0-x_r)*tan(alfa_1);
y_0=b0+x_r*tan(alfa_2);
b_m=b0-b_c+x_r*tan(alfa_2);
u_r=u0*exp(-(y-b_c)^2/b_m^2);
J_1=int(rou*u_r^2,y,b0,y_r);
J_2=int(rou*u_r^2,y,y_r,y_0);
J_0=int(rou*u_r^2,y,0,y_r);
digits(2)
eq1=J_0*cos(gamma)-J_1+J_2==0;
x_r=vpasolve(eq1,x_r,0.0005508);
x_r=double(x_r);
y_r=b0+(H-x_r)*tan(gamma);
错误信息:
The function 'syms' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.