Dear all,
I am trying to connect a function-file in MATLAB to Simulink via 2nd level S-function. But I have a global variable defined in my function file.
Can anyone let me know, how to declare global variables in S-functions?
thank you.
Dear;
This is realized through the option Simulation parameters in the menu Simulation and choosing Advanced, inline parameters and click in Configure. Then specify the variable as Global parameter.
Thank you Wasim Soliman. I will surely try with this.
try this
function [sys,x0,str,ts]=Crane(t,x,u,flag)
global mp mr mc K1 K2 K3 mu1 mu2 g
mp=1;
mr=1;
mc=14;
g=9.81;
K1=350;
K2=375;
K3=416;
mu1=mp/mc;
mu2=mp/(mc+mr);
I have a tube with a fixed inside thickness. Now, I want to change thickness of some part of this tube to X mm and some part to Y mm. Rest of the part has no change. Moreover, the parts of...
02 March 2019 7,711 3 View
I recently saw an example of water-hammering effect example of COMSOL Multiphysics. The example shows that the sudden closing of a valve produces pressure-shock through out the pipe upstream to...
31 December 2018 1,411 3 View
I'm simulating a shell and tube heat exchanger in comsol . I am plugging some of the tubes within the structure to see its effect on del.P and temperature. When I plug 18 of 19 tubes, and one...
09 October 2018 9,825 4 View
Dear all, I want to know about the wall lift off in CFD simulations What's it's significance and why they are different in FEM and FVM? Moreover, if it only depends on meaning, then why in...
08 September 2018 4,778 0 View
I have a doubt: A : 1. If a parameter value (say 'x = 100 ') is changed in model via Matlab-Livelink (via Matlab coding) 2. model is run. After it, B : 1. Again the paramater value is changed...
07 August 2018 6,347 0 View
I have simulated a heat-exchanger in COMSOL. The same heat-exchanger is simulated (with the exact geometry ) in Aspen Plus. I'm facing following problems in above: 1. The results of Aspen Plus...
06 July 2018 6,033 0 View
I have a shell and tube heat exchanger (1-1 pass ). It has shell of 250 mm ID and tubes of 50 mm ID (# 19). Length is 500 mm. I want to know the time-constant for this heat-exchanger (approx....
05 June 2018 1,172 0 View
Hello, I want to add an external material to the COMSOL for simulation. How can we do it? thanks.
04 May 2018 4,035 0 View
Dear all, I want to use the S-function in Simulink to connect it to COMSOL. I am able to use the Livelink and can import COMSOL model to MATLAB and can access the results. But my problem is as...
03 April 2018 9,674 1 View
Dear all, I am trying to co-simulate a chemical process in two-different environment. One is Aspen Plus and another is an CFD based simulator. The process has different units to be simulated in...
02 March 2018 4,485 4 View
Hello, I am working on a soil project and I found a primary research article that tests how the modification of agricultural soil can cause global warming, using a thermal collector, however I...
02 March 2021 7,161 3 View
Hello, I have simulated a single battery cell using Thevenin equivalent circuit. For a battery pack, I have a large number of cells connected in series and parallel connections. Is there any way...
28 February 2021 2,116 1 View
I think we were all surprised at the first time we got to know quantum mechanics that the squared modulus of the wave function is the probability density of the existence of the particle? The role...
28 February 2021 6,282 9 View
I am familiar with finite element simulations and numerical schemes like the Gauss Legendre quadrature. I also know that the Gauss integration yields exact values for polynomials up to degree 2n-1...
27 February 2021 6,818 3 View
I am interested in evaluating mesh optimization solvers that converge to high aspect ratio unstructured hexahedral grids. In other words, I am interested in a solver that optimizes warpage,...
26 February 2021 7,279 2 View
I am required to learn about Flyback converters and I got stuck not knowing to full design of the power supply flyback converter Based USB Charger Model using Simulink, especially the design model...
25 February 2021 5,435 2 View
I'm in the process of updating a meta-analysis and in one of the new studies, effect sizes are reported as Tau-U. Two of the effect sizes are reported as Tau-U = 1.00. I am using Andy Field's...
24 February 2021 2,265 3 View
I am trying to seek out some Transgenomic Wavemaker software (happy to purchase a computer too) to operate a fraction collector. The only way to connect to the fraction collector so far is to...
23 February 2021 9,181 1 View
I am working with several continous, environmental marine datasets at varying original spatial resolutions. My aim is to regrid each dataset to one common, high resolution grid. I am currently...
22 February 2021 2,290 2 View
How to build fouling and erosion simulation model for Aero Engine compressor and turbine rotor in Simulink / Matlab?
22 February 2021 3,697 1 View